Skip to content

Latest commit

 

History

History
123 lines (79 loc) · 3.01 KB

hc1200-mcu.md

File metadata and controls

123 lines (79 loc) · 3.01 KB

Microcontroller with Lattice MachXO2-1200 microboard

Back to main page

Board

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.

Top

UART

The UART has a fixed baud rate of 115200.

Address Description
$FFE0 Status
$FFE1 Data
Status bit Description
0 Byte received
1 Byte transmitting

Top

GPIO

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.

Top

Timer

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.

Top

Bootloader

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)

Top

Examples

The examples are compiled by a microassembler and loaded by the bootloader via UART.

Top

UART I/O

Example of use UART printuart.asm

Top

Led Matrix

Example of use with led matrix (MAX7219) matrix.asm

Top

Led Display

Example of use with led matrix display hcms.asm

Top