Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:29 12 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Maximite communicating with EEPROM

Author Message
Dedericus
Newbie

Joined: 19/01/2018
Location: United Kingdom
Posts: 4
Posted: 02:25pm 13 Mar 2019
Copy link to clipboard 
Print this post

Hi,

I am using a Maximite to communicate with a Microchip 25LC512 EEPROM.I need help with the read command.
Writing a byte to it has 4 bytes in the command, first is the command, second & third the address and finally the data byte.

Writing the read command has 3 bytes; first byte is the command,next two bytes are the address. The byte at the address is immediately clocked back but I don't know how to capture the data.

This is my code.

PIN(17)=1 'preset pin17 before it is setup
Setpin 17, DOUT
SPI OPEN 4000000,0,8 '4MHz, Mode 0,8 bits
PIN(17)=0 'chip select low
SPI WRITE 4,2,0,5,8 'write 4 bytes, '2'is write instruction,
' 0005' is the memory location, 8 is data
PIN(17)=1 'CS high
'try to read back
Pause(100)
PIN(17)=0 'CS low
SPI Write 3,3,0,5 'Send the read command to the EEPROM
' Read 3 bytes,the next'3' is read cmd, 0005 is memory location
byte1=SPI(0) 'Trying to get byte from memory
PIN(17)=1
SPI CLOSE

?byte1


The data comes back as 0.

Any suggestions would be appreciated

Thanks
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025