2nd Set of eyes needed for SST26VF064B code that is not working.

Thread Starter

Sarah412

Joined Sep 19, 2019
3
Hi All!

Thanks for taking the time. I am working with the SST26VF064B serial external memory and trying to get it up and running but seem to be having some difficulties. I am programing a PIC18LF26K22 in assembly language, and have read the data sheet and created subroutines for all the functions needed (Please see my attached complete code). I have my circuit set up where I am using the 'A' Port to output results to '8' LEDs as a visual to rerify that the code is working. I send a byte to an address and then attempt to read it back with no success. I have not been able to see any positive results from my code as I am not even able to read the configuration register.
I would like to have a second set of eyes take a look at my code to see if one could help me figure this beast out.

Thank you for your time and help in helping me figure this out.

Sarah
 

Attachments

Papabravo

Joined Feb 24, 2006
12,563
I'm no expert on the PIC 18 family but I have worked with a number of SPI devices. One thing many users are unaware of is that every time you write to the device you have an opportunity to read something back. Most of the time you read the data back that comes with the write operation and you throw it "on the floor" so to speak. When you want to read something, you must first write something to the device in order to get back the contents of the status register for example.

I'm guessing that you wrote all of this code without testing or debugging any of it. I don't see any evidence that you have constructed the scaffolding required to test basic functions of the device to build confidence that you have things coded correctly. I don't know what other features you have but if you could start by dumping and displaying the contents of each register in the device that would be a great start. Once you have confidence in your ability to read any register in the device and the values coming back make sense to you it is time to try writing. One register at a time until you can read and write all of them. At this point you may be ready to start trying the actual functions of the device.

I did this with the ESS9018 Saber DAC using I2C. I could not have written the operational code for this part without writing a utility to read and write each and every register. it was like the old days of pouring through "core dumps".

https://www.datasheet4u.com/datasheet-parts/ESS9018-datasheet.php?id=903100
I hope this helps you.
 

jpanhalt

Joined Jan 18, 2008
8,129
I also am not familiar with the 18LF series. Have you tried simply writing to the on-chip EEPROM? Have you tried your SPI routine with other chips/devices (e.g., a display, compass or any other simple device) where you do not have the added complexity of writing to EEPROM? I didn't go through every line of code to be sure, but it appears you are not using the extended instruction set. No problem if that is true. If not, then you need to activate it in the configuration words.

Regards.
 

MaxHeadRoom

Joined Jul 18, 2013
19,198
I have only worked with the I2C interface using assembly, I got the grounding on it originally from the Tutorials by Nigel Goodwin, not sure if they would help?
Max.
 

Thread Starter

Sarah412

Joined Sep 19, 2019
3
Hi All!,
I have spent a lot of time with this over this past week and am to the point that I am able to read the JEDEK ID, read and write to both the status and configuration register of the SST26V0F64B. So I know I am able to communicate properly with this chip.
If I read an address w/o writing to it I receive 0xff which is after my initialization of the chip which includes Write Enable, Reset, Chip Erase etc as detailed in my program which is included in updated form in this posting. Now in the datasheet it says that before you can write(Page Program) the address must be 0xff, of which it is when I read it. I am confused because it also says that when you chip erase or any other erase it will read '1'. When I read an address after a chip erase I read 0xff, and between that and Page program which when I read an address it is 0xFF, I am not sure which one is correct.
In reading the Status register it reads 0x00 as it should. I have Made WREN active and read the Status register and it shows that the WREN Bit is high telling me I am correctly reading the status register value. Same goes for the configuration register which shows me the 4th bit only as being high.
From what I see between these and my coding I should be able to write a value to an address, but I am still missing something in my coding that is not allowing me to do so. I believe that there is still some sort of write protection active but in combing through the datasheet numerous times I am able not to find anything pointing me to not being able to write to an address.
Please look at my updated code taking into consideration all that I have detailed above. I am looking to be guided to the resolution of this issue I am having so I can learn and get better at troubleshooting issues such as these.


Thank you,

Sarah
 

Attachments

Top