frillip / averclock

Winter 2012/2013: Just an exercise in timers. Oh, it's a clock. It can be controlled via bluetooth for no reason.
http://frillip.com/
2 stars 0 forks source link

Python tinybld interface #20

Closed frillip closed 10 years ago

frillip commented 11 years ago

Added sample script from another project in 76935952708135e9d4e302569579a962ae1275f6 , however it's not particularly refined.

Might end up becoming a separate repository once completed to a decent standard.

Basic requirements: Send 0xc1 to PIC Check for 0x4b response Send first 64 bytes of data from .hex file, with the first 8 bytes replaced with the tinybld GOTO instructions Wait for 0x4b response from PIC confirming it has recieved the data correctly Send the rest of the data packets in a similar way Send some tinybld specific code at the end

Data packets consist of: 0x00 To write flash 0x0000 Flash address 0x40 Number of bytes (always 64) 64 data bytes Pad with 0xff ( nop instruction) if necessary) checksum Two's complement of the simple 8 bit sum of all the data bytes

Hex file: Each line consists of a 9 byte header, data, and a 1 byte two's complement checksum. This should be parsed by the script to extract the data bytes. http://www.microchip.com/forums/m34461.aspx

Tinybld does not write configuration bits. Those must be set in the tinybld asm.

frillip commented 11 years ago

@naggie

naggie commented 11 years ago

Hm, very interesting. I must try this with an ATmega

frillip commented 10 years ago

Probably should also be a separate project.