|
META TOPICPARENT |
name="WebHome" |
%DASHBOARD{ section="banner" |
| EEPROM Serial Communication
Serial Peripheral Interface SPI, MC is the SPI master, the host is the slave. |
|
< < | e.g. AT25M02 SPI EEPROM 2Mbit (256 KiB, $3) or 25LC512 (64 KiB, $1.50). DIL8 Package. 256 KiB seems very small for today's standards where storage is quantified in GiB, but I think it's more than enough for a small Forth system. |
> > | e.g. AT25M02 SPI EEPROM 2Mbit (256 KiB, $3), 25LC1024 (128 KiB, $2), or 25LC512 (64 KiB, $1.50). DIL8 Package. 64/128/256 KiB seems very small for today's standards where storage is quantified in GiB, but I think it's more than enough for a small Forth system. |
|
CLK MC ->- host
MOSI MC ->- host |
| SS MC ->- host or other peripherals (optional)
|
|
< < | A high-to-low transition on the CS pin is required to start an operation and a |
> > | A high-to-low transition on the CS pin is required to start an operation and a |
| low-to-high transition is required to end an operation. |
|
< < | Invalid Opcode: If an invalid opcode is received, no data will be shifted into AT25M02 and the Serial Data |
> > | Invalid Opcode: If an invalid opcode is received, no data will be shifted into AT25M02 and the Serial Data |
| Output (SO) pin will remain in a high impedance state until the falling edge of CS is detected again. This will
reinitialize the serial communication. |
|
< < | 25LC512 Instruction Set |
> > | While in Hold mode, the SO pin will be in a high impedance state. In addition, both the SI pin and the SCK pin
will be ignored.
25LC512 25LC1024 Instruction Set |
|
|
|
< < |
READ |
0000 0011 |
Read data from memory array beginning at selected address |
WRITE |
0000 0010 |
Write data to memory array beginning at selected address |
WREN |
0000 0110 |
Set the write enable latch (enable write operations) |
WRDI |
0000 0100 |
Reset the write enable latch (disable write operations) |
RDSR |
0000 0101 |
Read STATUS register |
WRSR |
0000 0001 |
Write STATUS register |
|
> > |
READ |
0000 0011 |
Read data from memory array beginning at selected address |
WRITE |
0000 0010 |
Write data to memory array beginning at selected address |
WREN |
0000 0110 |
Set the write enable latch (enable write operations) |
WRDI |
0000 0100 |
Reset the write enable latch (disable write operations) |
RDSR |
0000 0101 |
Read STATUS register |
WRSR |
0000 0001 |
Write STATUS register |
|
|
PE |
0100 0010 |
Page Erase – erase one page in memory array |
SE |
1101 1000 |
Sector Erase – erase one sector in memory array |
CE |
1100 0111 |
Chip Erase – erase all sectors in memory array |
|
|
AT25M02 Instruction Set
|
|
< < |
READ |
0000 0011 |
Read from Memory Array |
WRITE |
0000 0010 |
Write to Memory Array |
WREN |
0000 0110 |
Set Write Enable Latch (WEL) |
WRDI |
0000 0100 |
Reset Write Enable Latch (WEL) |
RDSR |
0000 0101 |
Read Status Register (SR) |
WRSR |
0000 0001 |
Write Status Register (SR) |
|
> > |
READ |
0000 0011 |
Read from Memory Array |
WRITE |
0000 0010 |
Write to Memory Array |
WREN |
0000 0110 |
Set Write Enable Latch (WEL) |
WRDI |
0000 0100 |
Reset Write Enable Latch (WEL) |
RDSR |
0000 0101 |
Read Status Register (SR) |
WRSR |
0000 0001 |
Write Status Register (SR) |
|
|
LPWP |
0000 1000 |
Low Power Write Poll |
Serial EEPROM Connected to Centronics Connector (Switches and LEDs) |
|
< < | Sharing the LED and Switch port, you loose two LEDs and one switch. Possible conflict with the bootstrap loader, if there is a read sequence (CS and read pattern 0000 0011). |
> > | Sharing the LED and Switch port, you loose two LEDs and one switch. Possible conflict with the bootstrap loader, if there is a read sequence (CS and read pattern 0000 0011). To prevent this, set the EEPROM into HOLD state e.g. with the WAIT/ signal. |
|
|
|
< < |
MISO |
J2.9 IN7 SWITCH7 (IN? EF4) |
2 SO |
diode e.g. 1N4148 |
|
> > |
MISO |
J2.1 /IN EF4 |
2 SO |
diode e.g. 1N4148 |
|
|
MOSI |
J2.11 O7 LED7 |
5 SI |
direct |
CLK |
J2.10 O6 LED6 |
6 SCK |
direct |
|
|
< < |
CS |
J2.12 O5 LED5 |
1 CS |
direct |
|
P4.3 VDD |
8 VCC |
+5V |
|
" |
3 WP |
+5V |
|
" |
7 HOLD |
+5V |
|
> > |
CS |
J2.12 O5 LED5 |
1 CS/ |
direct |
|
P4.3 VDD |
8 VCC |
+5V capacitor 100 nF to GND |
|
" |
3 WP/ |
+5V |
|
J2.14 WAIT/ |
7 HOLD/ |
direct |
|
|
Raspberry Pi can emulate SPI EEPROM. On RaspiElf the switches/LEDs are already connected to Raspi's GPIOs. No need for additional hardware. But I have to write an SPI server for the Raspberry Pi. |
|
CS |
J2.11 O7 LED7 |
1 /CS |
direct |
|
|
8 VCC |
+5V |
|
|
3 /WP |
+5V |
|
|
< < |
|
> > |
|
J2.14 WAIT/ |
7 /HOLD |
direct |
|
|
|
| the file system on the host? No need to add additional hardware (SD-card
is anyway to modern You could use an old CP/M or even a PDP11 as host. The C-Kermit Local Server mode, e.g. MC can read/write the blocks as files block.0 , block.2 , block.255 . |
|
> > | The serial communication is really slow, not only because of the 9600 baud, but you have to wait after each character to give CDP1802 some computation time. |
| https://github.com/utoh/pygmy-forth/blob/master/extras/kermit/pfkerm.doc
|