Ocelot
Jump to navigation
Jump to search
Building custom firmware for Ocelot home automation controllers.
Specs
The device has two processors: A Z180 MPU for the main operating system and a PIC16F for offloading real-time peripheral processing from the main processor.
Processors
Main processor:
- Z180 MPU. Z8S18020VSC
- Full backwards compatibility with Z80, but with enhanced instruction set and some built-in peripherals.
- Program memory: Flash 512K x 8 bits - Atmel AT29C040A15PC
- Working memory: RAM 32K x 8 bits - Cypress CY62256LL-70PC
- Address decoder: Programmable logic device - Lattice GAL16V8D-15LP
Secondary processor:
- PIC16F MCU: Microchip PIC16F876
- Program memory: Flash 8K x 14bit words (built-in)
- Working memory: RAM 368 x 8 bits (built-in)
- Data memory: EEPROM 256 x 8 bits (built-in)
Hacking
User "Beef" created custom software for the Ocelot.
Bootloader
The serial bootloader sits in FLASH memory at address 0x0000.
Usage:
- Send data to the Ocelot serial port in 1024 byte chunks at 57600 baud. All data must be padded to 1024 bytes. Data is loaded starting at address 0x8040.
- Data is loaded until the first byte of the new chunk is 0x00. (This can cause issues with binary data that contains 0x00 bytes. Bootloader code needs to be updated.)
- After 0x00 byte is received, the bootloader jumps to the start address 0x8040. (RAM starts at 0x8000. Stack takes up 0x8000-0x803F)
Bootloader includes a jump table to bootloader functions for use by the application code. This could be considered a simple BIOS.
- ROM .equ $0000
- BL .equ ROM + 0 ; Start the bootloader
- PUTCB .equ ROM + 3 ; Print a character (blocking)
- PUTC .equ ROM + 6 ; Print a character
- PUTS .equ ROM + 9 ; Print a string
- WDT .equ ROM + 12 ; Refresh WDT
- GETCHAR .equ ROM + 15 ; Receive a character (blocking)
Monitor
History:
- Extended Woz Monitor Z180 Port (2016) for Ocelot by "Beef" (Todo: add link to source code repository)
- Extended Woz Monitor (2007) for Replica I by "fsafstrom"
- Woz Monitor (1976) for Apple I by Steve Wozniak