I misinterpreted the data sheet (not hard to do in this particular case) and thought the mode3 op-codes were mode0 op-codes. Once I swapped everything started working. Having your init code tying 0x57 with mode3 was the clue that set me on the right path. Thanks! ----------- Larry Barello www.barello.net | -----Original Message----- | From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf | Of raimond712002 | Sent: Saturday, October 29, 2005 1:04 AM | To: AVR-Chat@yahoogroups.com | Subject: [AVR-Chat] Re: Atmel Data Flash | | The file below is my dataflash library. It is a professional | implementation, but I can make it open source here because you | can't know the real application (which is very big). | Some comments: SPI is mode 3, I can't remember why, but I can | remember this was a 'must' at that time. GCC please. | | Check the SPI pins, they are used for programming the mega32 too. | Check the 3.3V power for the dataflash chip. | Good luck! | | /*==================================================================== | ==================== | AT45DB041 DataFlash Library | Chip: ATMEGA64 | Freq: 4.9152 MHz | ====================================================================== | ==================*/ | #include <string.h> | #include <avr/io.h> | #include <avr/pgmspace.h> | #include <avr/eeprom.h> | #include "type.h" | #include "rtos.h" | #include "dataflash.h" |
Message
RE: [AVR-Chat] Re: Atmel Data Flash
2005-10-29 by Larry Barello
Attachments
- No local attachments were found for this message.