Difference: MassStorage (16 vs. 17)

Revision 172019-02-06 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Changed:
<
<
image="/twiki/pub/Cosmac/RaspiElf/raspi-elfmemcard-s.jpg"
>
>
image="/twiki/pub/Cosmac/MassStorage/eeprom-bottom-s.jpg"
  title="Serial EEPROMs as Mass Storage" titlestyle="color:#F00000;" }%
Line: 169 to 169
 
    4 GND GND
Changed:
<
<
mc-eeprom-u1.png
Schematic
>
>
mc-eeprom-u1.png
Schematic
eeprom-mc.jpg
EEPROM on Veroboard
 

Read Byte

Line: 308 to 308
 
Mini Boot Loader

Mini Boot Loader

Added:
>
>
For RAM only Membership Cards you need some kind of bootstrap loader. To type in a monitor or even BASIC or FORTH is nearly impossible. Serial EEPROMs in DIP8 packages are cheap and easy to get. But you still have to use the front panel to type in the boot loader itself (this is the first-stage boot loader).
 
                        ;       TITL    "EEPROM Boot Loader for Elf Memebership Card"
                        ;               EJCT    60

Line: 357 to 358
  ; R4.0 carry bits ; R7 destination address ; R8 length
Added:
>
>
; R9 start address
 
Changed:
<
<
>
>
START
  1. c0:11000000 LBR BOOTLOADER
  2. 00:00000000
  3. 03:00000011
  BOOTLOADER
Changed:
<
<
  1. f8:11111000 LDI 080H ; set destination address
  2. 80:10000000
  3. b7:10110111 PHI R7
  4. f8:11111000 LDI 080H ; set length
>
>
  1. f8:11111000 LDI 080H ; set destination address
 
  1. 80:10000000
Changed:
<
<
  1. b8:10111000 PHI R8
  2. 90:10010000 GHI R0 ; D = 00H
  3. a7:10100111 PLO R7 ; destination address begins at page
  4. a8:10101000 PLO R8 ; lenght in pages
  5. b1:10110001 PHI R1 ; high byte subroutine
  6. a a2:10100010 PLO R2 ; stack pointer = 0100H
  7. b f8:11111000 LDI 01H
  8. c 01:00000001
  9. d b2:10110010 PHI R2
  10. e f8:11111000 LDI LOW WRITEBYTE ; low byte subroutine
  11. f 48:01001000
  12. a1:10100001 PLO R1
  13. f8:11111000 LDI 01H ; for the carry
  14. 01:00000001
  15. a4:10100100 PLO R4
  16. 61:01100001 OUT P1 ; deactivate CS to start operation
  17. 00:00000000 BYTE 00H

  1. e1:11100001 SEX R1 ; for immediate OUT in subroutine
  2. f8:11111000 LDI 03H ; EEPROM read command
  3. 03:00000011
  4. d1:11010001 SEP R1 ; CALL WRITEBYTE
  5. a 90:10010000 GHI R0 ; address bit 16 to 23 = 0
  6. b d1:11010001 SEP R1 ; CALL WRITEBYTE, replace by NOP for ; 8 to 512 Kibit EEPROMs
  7. c 90:10010000 GHI R0 ; address bit 8 to 15 = 0
  8. d d1:11010001 SEP R1 ; CALL WRITEBYTE, replace by NOP for
>
>
  1. b7:10110111 PHI R7
  2. b9:10111001 PHI R9 ; start address
  3. f8:11111000 LDI 080H ; set length
  4. 80:10000000
  5. b8:10111000 PHI R8
  6. a 90:10010000 GHI R0 ; D = 00H
  7. b a7:10100111 PLO R7 ; destination address page boundry
  8. c a8:10101000 PLO R8 ; length in pages
  9. d a9:10101001 PLO R9
  10. e b1:10110001 PHI R1 ; high byte subroutine
  11. f a2:10100010 PLO R2 ; stack pointer = 0100H
  12. f8:11111000 LDI 01H
  13. 01:00000001
  14. b2:10110010 PHI R2
  15. a4:10100100 PLO R4 ; for the carry
  16. f8:11111000 LDI LOW WRITEBYTE ; low byte subroutine
  17. 4f:01001111
  18. a1:10100001 PLO R1
  19. 61:01100001 OUT P1 ; deactivate CS to start operation
  20. 00:00000000 BYTE 00H

  1. e1:11100001 SEX R1 ; for immediate OUT in subroutine
  2. a f8:11111000 LDI 03H ; EEPROM read command
  3. b 03:00000011
  4. c d1:11010001 SEP R1 ; CALL WRITEBYTE
  5. d 90:10010000 GHI R0 ; address bit 16 to 23 = 0
  6. e d1:11010001 SEP R1 ; CALL WRITEBYTE, replace by NOP for ; 1 to 512 Kibit EEPROMs
  7. f 90:10010000 GHI R0 ; address bit 8 to 15 = 0
  8. d1:11010001 SEP R1 ; CALL WRITEBYTE, replace by NOP for
  ; 1 to 4 Kibit EEPROMs
Changed:
<
<
  1. e 90:10010000 GHI R0 ; address bit 0 to 7 = 0
  2. f d1:11010001 SEP R1 ; CALL WRITEBYTE

  1. e6:11100110 SEX R6 ; Rx for OUT
  2. 90:10010000 BLOCKLOOP GHI R0 ; D = 0
  3. a5:10100101 PLO R5 ; reset all bits
  4. f8:11111000 LDI 0 - 8 ; counting up 8 times
  5. f8:11111000
  6. a6:10100110 PLO R6 ; bit counter
  7. 84:10000100 RDBITLOOP GLO R4 ; set CARRY
  8. f6:11110110 SHR
  9. 85:10000101 GLO R5
  10. 3d:00111101 BN2 SETBIT ; branch if bit set (EF2 == 0)
  11. a 2e:00101110
  12. b fe:11111110 SHL ; bit not set
  13. c 30:00110000 BR SAVEBIT
  14. d 2f:00101111
  15. e 7e:01111110 SETBIT SHLC
  16. f 62:01100010 SAVEBIT OUT P2 ; CLK for SPI, INC Rx
  17. a5:10100101 PLO R5
  18. 86:10000110 GLO R6
  19. 3a:00111010 BNZ RDBITLOOP
  20. 26:00100110
  21. 85:10000101 GLO R5 ; get byte
  22. 57:01010111 STR R7 ; save byte
  23. 17:00010111 INC R7
  24. 28:00101000 DEC R8
  25. 88:10001000 GLO R8
  26. 3a:00111010 BNZ BLOCKLOOP
  27. a 21:00100001
  28. b e2:11100010 SEX R2 ; one page finished
  29. c 98:10011000 GHI R8
  30. d 52:01010010 STR R2
  31. e 64:01100100 OUT P4 ; show page count on LEDs
  32. f 22:00100010 DEC R2
  33. 3a:00111010 BNZ BLOCKLOOP-1
  34. 20:00100000
  35. 61:01100001 OUT P1 ; deactivate CS to stop operation
  36. e0:11100000 SEX R0
  37. c0:11000000 LBR 08000H ; start loaded program
  38. 80:10000000
  39. 00:00000000

  1. d0:11010000 SEP R0
  2. a5:10100101 WRITEBYTE PLO R5 ; save transmit byte
  3. f8:11111000 LDI 8 ; counter 8 bits
  4. a 08:00001000
  5. b a6:10100110 PLO R6
  6. c 85:10000101 WRBITLOOP GLO R5 ; get the next bit
  7. d fe:11111110 SHL ; next bit is in the carry
  8. e a5:10100101 PLO R5
  9. f c7:11000111 LSNF ; skip if bit is 0
  10. 62:01100010 OUT P2
  11. 01:00000001 BYTE 00000001B ; CLK for SPI with data bit cleared
  12. cf:11001111 LSDF ; skip if bit is 1
  13. 62:01100010 OUT P2
  14. 00:00000000 BYTE 00000000B ; CLK for SPI with data bit set
  15. 26:00100110 DEC R6
  16. 86:10000110 GLO R6
  17. 3a:00111010 BNZ WRBITLOOP
  18. 4c:01001100
  19. 30:00110000 BR WRITEBYTE-1
  20. a 47:01000111
>
>
  1. 90:10010000 GHI R0 ; address bit 0 to 7 = 0
  2. d1:11010001 SEP R1 ; CALL WRITEBYTE
  3. e6:11100110 SEX R6 ; Rx for OUT
  4. 90:10010000 BLOCKLOOP GHI R0 ; D = 0
  5. a5:10100101 PLO R5 ; reset all bits
  6. f8:11111000 LDI 0 - 8 ; counting up 8 times
  7. f8:11111000
  8. a6:10100110 PLO R6 ; bit counter
  9. 84:10000100 RDBITLOOP GLO R4 ; set CARRY
  10. a f6:11110110 SHR
  11. b 85:10000101 GLO R5 ; get bits
  12. c 3d:00111101 BN2 SETBIT ; branch if bit set (EF2 == 0)
  13. d 30:00110000
  14. e fe:11111110 SHL ; bit not set
  15. f 38:00111000 SKP ; BR SAVEBIT
  16. 7e:01111110 SETBIT SHLC ; set bit
  17. 62:01100010 SAVEBIT OUT P2 ; CLK for SPI, INC Rx
  18. a5:10100101 PLO R5 ; save bits
  19. 86:10000110 GLO R6
  20. 3a:00111010 BNZ RDBITLOOP
  21. 29:00101001
  22. 85:10000101 GLO R5 ; get byte
  23. 57:01010111 STR R7 ; save byte
  24. 17:00010111 INC R7
  25. 28:00101000 DEC R8
  26. a 88:10001000 GLO R8
  27. b 3a:00111010 BNZ BLOCKLOOP
  28. c 24:00100100
  29. d e2:11100010 SEX R2 ; one page finished
  30. e 98:10011000 GHI R8
  31. f 52:01010010 STR R2
  32. 64:01100100 OUT P4 ; show left pages on LEDs
  33. 22:00100010 DEC R2
  34. 3a:00111010 BNZ BLOCKLOOP-1
  35. 23:00100011
  36. 61:01100001 OUT P1 ; deactivate CS to stop operation
  37. e0:11100000 SEX R0
  38. 18:00011000 INC R8 ; set R8 to 0001h
  39. 99:10011001 GHI R9 ; store start address
  40. 58:01011000 STR R8
  41. 18:00011000 INC R8
  42. a 89:10001001 GLO R9
  43. b 58:01011000 STR R8
  44. c 30:00110000 BR START
  45. d 00:00000000

  1. e d0:11010000 SEP R0
  2. f a5:10100101 WRITEBYTE PLO R5 ; save transmit byte
  3. f8:11111000 LDI 8 ; counter 8 bits
  4. 08:00001000
  5. a6:10100110 PLO R6
  6. 85:10000101 WRBITLOOP GLO R5 ; get the next bit
  7. fe:11111110 SHL ; next bit is in the carry
  8. a5:10100101 PLO R5
  9. c7:11000111 LSNF ; skip if bit is 0
  10. 62:01100010 OUT P2
  11. 01:00000001 BYTE 00000001B ; CLK for SPI with data bit cleared
  12. cf:11001111 LSDF ; skip if bit is 1
  13. a 62:01100010 OUT P2
  14. b 00:00000000 BYTE 00000000B ; CLK for SPI with data bit set
  15. c 26:00100110 DEC R6
  16. d 86:10000110 GLO R6
  17. e 3a:00111010 BNZ WRBITLOOP
  18. f 53:01010011
  19. 30:00110000 BR WRITEBYTE-1
  20. 4e:01001110
 

END

Line: 490 to 498
 
META FILEATTACHMENT attachment="raspi-eeprom.png" attr="" comment="" date="1548624176" name="raspi-eeprom.png" path="raspi-eeprom.png" size="26456" user="PeterSchmid" version="3"
META FILEATTACHMENT attachment="raspi-zero-eeprom.jpg" attr="" comment="" date="1548625222" name="raspi-zero-eeprom.jpg" path="raspi-zero-eeprom.jpg" size="206454" user="PeterSchmid" version="1"
Added:
>
>
META FILEATTACHMENT attachment="eeprom-bottom-s.jpg" attr="" comment="" date="1549483153" name="eeprom-bottom-s.jpg" path="eeprom-bottom-s.jpg" size="58634" user="PeterSchmid" version="1"
META FILEATTACHMENT attachment="eeprom-mc.jpg" attr="" comment="" date="1549483330" name="eeprom-mc.jpg" path="eeprom-mc.jpg" size="274595" user="PeterSchmid" version="1"
META FILEATTACHMENT attachment="mc-eeprom-u1.png" attr="" comment="" date="1549484119" name="mc-eeprom-u1.png" path="mc-eeprom-u1.png" size="18349" user="PeterSchmid" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback