|
Forum Index : Microcontroller and PC projects : Issues with i2C serial eeprom
| Author | Message | ||||
| pdeivendran Newbie Joined: 18/09/2020 Location: MalaysiaPosts: 9 |
Dear Guys, I need some help. I have been using Micromite and developing products based on this platform actively over the past 5 years or so. I have used both the i2C and SPI protocols on many peripherals without any real issues but recently I tried using the i2C protocol on the Microchip / Atmel, AT24CS01/AT24CS02 Serial Eeprom Memory chip with UID. I am not sure what I am doing wrong but I don't seem to able to address the devices correctly. 1. Unable to write or read correctly onto the memory section of the device. Keeping getting "Wrong Address" of "NACK" response. 2. Unable to access the read only memory for UID (128-bit). Can anyone out there able to assist me, if its not too much trouble. A simple sample code, accessing these devices would be great. Really would appreciate the help. Thank you guys in advance. |
||||
| CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 2171 |
Twofingers published some code here a while back. see here |
||||
| pdeivendran Newbie Joined: 18/09/2020 Location: MalaysiaPosts: 9 |
Dear Capt., Thank you for the heads up. Will try to implement as suggested by 2Fingers. Will keep you posted on outcome. Thank you again. |
||||
| MustardMan Senior Member Joined: 30/08/2019 Location: AustraliaPosts: 175 |
Hi pdeivendran I'd be interested to hear how you go. I had a nasty time recently with a flash memory chip manufactured by Microchip being accessed over SPI. I won't be using Microchip Flash memory from now on! Cheers, |
||||
| pdeivendran Newbie Joined: 18/09/2020 Location: MalaysiaPosts: 9 |
Dear Capt / MustardMan, Sorry for my lateness in responding to this thread. I have tried the codes from 2Fingers, it kinda works in writing non-protected areas of the AT24CS01/AT24CS02, but to access the UID of the EEPROM, we need to do a "dummy" write which includes the "Device Address" & "Word Address" before I can read the "UID Serial Number" from the chip. If I tried to do this, Micromite outputs a communication error. You can check out the datasheet from Atmel or Microchip, it may shed some light on something that I may have overlooked. Maybe we can ask 2Fingers about it. In the meantime, can any of you guys help me out using the MCP23S17 SPI Port Expander chip? I am trying to write to Port A and read from Port B. To write to port A, as a test, I have written the following simple code, all the A0~A2 are tied to ground CPU 10 PIN(CS)=1 'Active Low PIN(RST)=1 ' Active High for normal operation Pulse RST,10 ' A 10ms low pulse to reset the MCP23S17 SPI OPEN 500000,0,8 PIN(CS)=0 SPI WRITE 5, &h40, &h0A, &h40, &h14, &H01 PIN(CS)=1 SPI CLOSE The bit output on PORT A still remains low. Can anyone send me a simple code that would control the output of PORT A and read the inputs of PORT B? Really appreciate it. DAve |
||||
| disco4now Guru Joined: 18/12/2014 Location: AustraliaPosts: 1045 |
A PULSE of 3ms or more is run in the background, i.e. non blocking. You may be trying to talk to it before it is reset as the code keeps going. Put a PAUSE 10 after the PULSE to test this. F4 H7FotSF4xGT |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |