SYSTEM words: EEPROM and expansion bus
Cursor positioning
Name | Stack Effect | Summary | Token |
AT-XY | ( col row -- ) | Position cursor at col,row | xt = 0x213 |
GET-XY | ( -- col row ) | Current cursor position | xt = 0x215 |
MAX-XY | ( -- cols rows ) | Maximum cursor coordinate | xt = 0x214 |
Serial EEPROM
Name | Stack Effect | Summary | Token |
<EE! | ( addr -- ) | Send control bytes to EEPROM | xt = 0x1F3 |
send control byte(s), return control byte for status polling | |||
<EE@ | ( addr -- ) | Set up for sequential read | xt = 0x1F7 |
EE! | ( c -- ) | Store next byte to EEPROM | xt = 0x1F6 |
EE!> | ( -- ior ) | End EEPROM write, T if error | xt = 0x1F5 |
EE=MAIN | ( -- ) | Select main serial eeprom | xt = 0x1FC |
If you have an alternate IIC EEPROM bus, you can define a word similar to this one to redirect serial EEPROM operators to that bus. | |||
EE@ | ( -- c ) | Get next sequential EEPROM byte | xt = 0x1F8 |
EE@> | ( -- c ) | Get next EEPROM byte, end read | xt = 0x1F9 |
EE@N | ( a -- n ) | Read 16-bit value from EEPROM | xt = 0x1FE |
EEDEVICE | ( -- a ) | EEPROM device select 0..7 | xt = 0x1F2 |
[cell] | |||
EEMAX | ( -- x ) | Maximum EEPROM address | xt = 0x1FB |
constant | |||
EEMIN | ( -- x ) | Minimum EEPROM address | xt = 0x1FA |
constant | |||
EEPOLL | ( -- f ) | Test for presence of EEPROM | xt = 0x1F4 |
read last selected device, return T if found. | |||
EVAL=EE | ( -- ) | Set up to evaluate EEPROM code | xt = 0x1FD |
SPIX bus probing
Name | Stack Effect | Summary | Token |
BOOTIMAGE | ( -- a ) | 2K boot ROM image | xt = 0x20B |
[RAMdata] | The BootImage array is for temporary storage of boot code. We can't boot directly from EEPROM because of possible communication errors. So, we copy it to RAM and then evaluate it. You can define this as a constant if you know of a free area of RAM that nobody will bother. | ||
CURRENTNODE | ( -- a ) | Next free node | xt = 0x20C |
[cell] | Points to the next empty node, the one after the end of the SPIX chain. This is bumped upward during ennumeration of the SPIX devices. | ||
DEADBUS | ( -- a ) | T if booting has been disabled | xt = 0x20D |
[cell] | |||
EVAL_EXT | ( -- ) | Evaluate external SIP boot code | xt = 0x210 |
HOTPLUGPOLL | ( -- ) | Test for change in bus config | xt = 0x212 |
HPTIMER | ( -- addr ) | Timer to pace hot-plug bus probing | xt = 0x211 |
[double] | Timer to limit polling bandwidth | ||
LAST_BYTE | ( -- addr ) | Result from x_byte! | xt = 0x206 |
[cell] | |||
MY | ( -- ) | Current node number | xt = 0x20E |
IMMEDIATE | state smart: compile a literal or return the number. The interpret action only makes sense when evaluating boot code. Sample Usage : emit my x_node lcd_emit ; | ||
PRIMARYBOOT | ( -- addr ) | Address of pre-boot program in EEPROM | xt = 0x1FF |
SECONDARYBOOT | ( -- addr ) | Address of post-boot program in EEPROM | xt = 0x200 |
X_BYTE! | ( c -- ) | Write byte to SPIX output | xt = 0x207 |
X_NODE | ( node# -- ) | Selects a new node | xt = 0x201 |
X_PORT | ( port# -- ) | Selects a port within a node | xt = 0x202 |
X_READ | ( src dest len -- ) | Reads from boot EEPROM on SPIX module | xt = 0x208 |
Read EEPROM into RAM using page read. Read segments twice to check for bit errors. | |||
X_RESET | ( -- ) | Clears the bus logic | xt = 0x204 |
X_SVC? | ( -- f ) | Looks for a service plug | xt = 0x205 |
A service plug disables bootup. On the SPIX bus, short pins 5 & 6 together to indicate a service plug. | |||
X_TEST | ( node -- ior ) | Test boot ROM ior: 0=valid | xt = 0x20F |
Get data from the bottom of the boot EEPROM Expecting: C0 DE ?? 07 C9 csum16 length24 | |||
X_TRANSFER | ( addr len -- ) | Xfer current port to/from memory | xt = 0x203 |
Shift an active SS to the desired node, then transfer the data. First, we assume all SS lines are inactive. As long as this is the case, it's safe to clock the port-select counter. Upon entry, the port# is indeterminate. | |||
X_WRITE | ( src dest len -- ) | Write to boot EEPROM on SPIX module | xt = 0x209 |
Write data in blocks until it's written | |||
X_WRSR | ( c -- result ) | Write to EEPROM status register | xt = 0x20A |