Confused: PDI Access of Signature Row
I am looking for a little guidance, (not code), as I think I am off track.
I am using a M168 to PDI program an Xmega64A1.
(Not there yet, but that is the goal.)
I am doing this for my own academic interest, to see if I can do it. I am aware of Atmel's programmers and Dean's LUFA as PDI options. My goal is to see if I can do it.
My current references are the Xmega A Manual, the Xmega64 Data Sheet, and Application Note AVR1612: PDI programming driver. (Should be easy with all of that :) )
The system runs at 3 V, the Mega and Xmega pins are tied directly together, there are no pull up resistors or caps on the reset line. Both uCs can be programmed and run programs just fine. Next version will have a series resistor in the Data line for bus contention protection, but that hasn't been a problem thus far.
I can "Enable" the PDI Hardware interface in the Xmega.
I can "Enter External Programming Mode", which accesses the NVM Controller.
(Send Reset Signature, Key Command, the 8-byte Xmega Key, and poll the NVMen Bit)
I successfully get to this step. :)
My next step, and current hurdle, is simply to read the Device ID, (Signature).
The Signature for the Xmega64A1 should be: 1E 96 4E where 1E is consitent for all Atmel uC's.
I believe that the PDI interface should make the entire memory structure of the Xmega accessible as a single array, 0x0000000 to 0x1FFFFFF, as shown on Figure 30-4. Memory Map for PDI accessing the data and program memories, (A Manual).
I think I ought to be able to use the PDI commands to send a read memory command to read the Device ID (Signature) Bytes.
My thought was that the SROW, Product Signature Row has a base address of: 0x008E0200 (From the Memory Map diagram sited above).
The MCU Control Register, which contains the Device ID Registers, has a base address of: 0x0090.
The MCU Device ID Register 0 has an address offset of 00.
So I thought reading, via the PDI interface, memory address: 00 8E 02 90 would provide me with the Device ID (Signature) byte value: 1E.
To read this memory I used the PDI LDS Command, configured as:
LDS, Address Size: Long (4 bytes), Data Size: One Byte: 0000 1100
Then I read a byte back, obtaining 0, not 1E
I was successful in using the PDI LDCS and STCS commands to enter the PDI programming mode, but this was my first use of the LDS Command, and of attempting to read from the PDI memory mapped Xmega.
Clearly I am not doing it correctly, and I would be thankful for any guidance in the right direction. I am certainly not a programmer, and at times like this it shows...