Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Support => AVRDude => Topic started by: tehDorf on December 05, 2012, 11:27:40 pm

Title: AT89LP4052 and opcode preamble
Post by: tehDorf on December 05, 2012, 11:27:40 pm
Hi, I'm trying to program an AT89LP4052 using AVRDude and a Bus Pirate, but I'm having an issue because the chip requires a preamble (0xAA) before each SPI command. I'm not sure how to work around this.

This is what the write instruction format would need to look like:
Code: [Select]
    memory "flash"
        size            = 4096;
        ...

        write          = "  1  0  1  0    1  0  1  0", # Preamble
                          "  0  1  0  1    0  0  0  0", # Opcode
                          "  1  1  1  1  a11 a10  a9  a8", # Addr High
                          " a7  a6  a5  a4  a3  a2  a1  a0", # Addr Low
                          "  i  i  i  i    i  i  i  i"; # DataLn 0 .. DataLn N (up to 32)
                                                              # ... but now it's 40 bytes

      ...

My Setup, but I haven't actually been able to test it yet because of the Part Definition issue.
Code: [Select]
Bus Pirate <> AT89LP4052
      GND -- 10 (GND)
      +5V -- 20 (VCC)
      AUX --  1 (RST)
      CLK -- 19 (P1.7 - SCK: SPI Clock)
      MISO -- 18 (P1.6 - MISO: SPI master-in/slave-out)
      MOSI -- 17 (P1.5 - MOSI: SPI master-out/slave-in)
        CS -- 16 (P1.4 - SS: SPI slave select)
I'm a little worried about the AUX pin behaving correctly. Is there anything else I need to change in the avrdude.config file or on the Bus Pirate?

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.00902054480session_write_close ( )...(null):0
20.00932186072ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.00932186848Database_MySQL->query( ).../DatabaseHandler.php:119
40.05312325584Database_MySQL->error( ).../Db-mysql.class.php:273