AT89LP4052 and opcode preamble

Bus Pirate support for AVRDude AVR programmer

AT89LP4052 and opcode preamble

Postby tehDorf » Wed Dec 05, 2012 5:27 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 all
    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 all
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?
tehDorf
Newbie
Newbie
 
Posts: 1
Joined: Wed Dec 05, 2012 4:54 pm

Return to AVRDude

cron