The system uses a microfpga board
Implemented 15 bit I/O port, UART, TIMER and RESET signal. The default configuration includes 6KB of RAM, pre-initialized with bootloader code.
The UART has a fixed baud rate of 115200.
Address | Description |
---|---|
$FFE0 | Status |
$FFE1 | Data |
Status bit | Description |
---|---|
0 | Byte received |
1 | Byte transmitting |
I/O port uses 15 bits (maximum available pins for this board).
Address | Description |
---|---|
$FFE8 | I/O bits 14..8 |
$FFE9 | I/O bits 7..0 |
$FFEA | Direction bits 14..8 |
$FFEB | Direction bits 7..0 |
Direction bits 1 - output, 0 - input. By default, all bits are input.
Address | Description |
---|---|
$FFF0 | Initial value bits [7:0] |
$FFF1 | Initial value bits [15:8] |
$FFF2 | Status |
Status bits: 1 - countdown finished, 0 - interrupt. The interrupt bit is cleared after reading the status register.
The UART bootloader uses 256 bytes of memory (from address 0) and allows you to load, save, and execute code.
Bootloader commands:
Command bytes | Size in bytes | Description |
---|---|---|
'L' <start address> <end address> |
5 + (payload) |
Loading code into RAM |
'S' <start address> <end address> |
5 + (<end address> - <start address>) |
Saving code from memory |
'G' <start address> |
3 |
Execute code from start address |
Data is transmitted to the bootloader in packets of 14 bytes, after which a sync byte is received.
The loader contains the following subroutines:
Address | Description |
---|---|
$0000 |
RESET |
$0008 |
WARM UP |
$000C |
Get char from UART to register V0 |
$000E |
Put char to UART from register V0 |
$0010 |
Put string to UART (V0 is pointer to null-terminated string) |
The examples are compiled by a microassembler and loaded by the bootloader via UART.
Example of use UART printuart.asm
Example of use with led matrix (MAX7219) matrix.asm
Example of use with led matrix display hcms.asm