C3 Read a decimal value to the FLASH
nestor73
Posts: 33
Hi,
i'm fairly new to this, so can someone explain me how a decimal value (1..20)
is written to the flash memory ? I have studied and tried the c3_flash_demo_010.spin
and i can write values , but the reading doesn't return the values. I'm sure i'm doing
something wrong with the address or the value , or the bytes to read write
thanx for any eplanation
i'm fairly new to this, so can someone explain me how a decimal value (1..20)
is written to the flash memory ? I have studied and tried the c3_flash_demo_010.spin
and i can write values , but the reading doesn't return the values. I'm sure i'm doing
something wrong with the address or the value , or the bytes to read write
thanx for any eplanation
Comments
You're asking how a decimal value is written to flash memory. You probably don't want the literal answer to your question, it's interesting, but won't help you get things to work. Tell us what you're doing and maybe we can help more.
I don't really have written new code to do this in my project, i'm still messing with the demo to try and figure out how to make it easier to implement.
I don't really get the whole setup in the Flash_Write and Flash_Read , i was hoping to just point to an address and write a hex and read it from the
same place. If only life was that simple ? :P
I cant seem to find any demo that writes a decimal value and reads it back as example
and i try to read the second address :
the value of NP remains empty (=00)
not sure where it goes wrong..
Maybe i am going wrong in displaying the returns to the screen ?
I make sure that the Flash_Erase has been done in the startup,
then i write a value to the buffer[1] , but so far no real readout
and the readout of 1 byte at address 1 gives me 0C
I'm going to write a new small test program, the whole program would take too much.
I forgot to add :
As Homer Simpson would say..... DOH !
Ok, so i tried the following :
1) When i delete the entire chip at startup, then add a new value to the address, things work fine
2) When i change that value and want to update it to the flash, i therefor read the 0..512 bytes into
a buffer, i change buffer of the value ( buffer [address]= newvalue) , i erase the whole chip and
i write the whole buffer again. Doesn't work . For some reason i have the feeling that the erasing
doesn't happen, i don't know why since i call the same function (Flash_Erase_Chip(1))
3) i tried to write a $FF to the address , doesn't work either.
Someone knows a method to erase only the address i want to update ?
Are you just looking to learn how to use the flash memory or do you have a specific application in mind?
Attached is an object for reading and writing to either flash or SRAM on the C3. It's functionally the same as the Winbond flash driver already in the Object Exchange. It lets you set up named files that you can read or create (no updating in place). It also lets you read and write individual blocks and erase 4K sectors.