18F1320 ... Strange Memory
Hi all,
I wrote a nice piece of code ( 3200 hex lines ...) for a 16F648 an a 16F88 : Everything works OK ! ... thank you.
BUUUUUT, Trying to use it aboard a 18F1320 ... things become quite funny :
Let's see:
Program runs ... but...
I have to memorize in the EEPROM 8 values "in a row" ( from 1 to 8 ) and then Three others, one by one, at locations 10,11, and 12.
The first 8 are well Stored ... but the 3 others never want to be stored !!!
Somewhere else, after that, I can modify values 1 and 2 ...
They are properly modified and stored !!!!
So, shortly ... my 18F1320 seems to have only 8 addressable EEPROM registers.
I tried to push the 3 lonesome values to $11, 12 and 13 ... no more result.
Anyone understanding that ???
( Setting WREN to 1 doesn't modify anything ... )
Alain
Is your PIC code protected
Hi,
I once found on a PIC18F452 that if I codeprotect the first 512 bytes (boot) of the chip then my eeprom storage would no longer work. Leaving it out and protecting the other pages did the trick.
Waterloo , sad country ...
Last news :
I added a value at position 9 (0 ) and copied the "writes" from location 1 to 9 to 21 to 29 ...
result : all values Written ... except value at loc.2 that has been overwritten by "FF" .... my three lonesome further values always aren't written.
may be there are overwritten too ... i'll never know.
one sure thing ... there's a writing problem !!!
Alain
Hi, SOUGATA
All writing protections have been removed ... I have to program in two times : at first config , and then program. default configs locks the programming !!!
1 Attachment(s)
Finally got it ... but not good job !!!
Hi all,
I finally got it ...
But I had to memorize 2 times the values ... and read the second writings.
So, I think ...
one lonely WRITE command writes the value FF instead of what you want !!!
I stop here ...
Working program attached ...
Alain
PS:
for curious guys ... that is just a simple R/C gadget to use two servos in parallell ... Neutral, 2 1/2 travels, finely adjustable, plus invertible rotation for servo n°2 ...
There's also a fail-safe ... servos are driven to their neutral ( recorded ...) position, if signal lost.
Plus visual programming help w/ three LEDS ...
Yessss ....
1 Attachment(s)
Truth slowly raises from earth ...
Hi, Mel
What a nice Job .... "La Claaaasse" as we say here !!!
just one comment: I noticed here memory locations were ERASED to FF instead of Written to expected values ...
For my tests I programmed all EEPROM to zero .... and I read some "FF" 's
see attachment for that.
You're right ... result is the same. In this case not exactly !!! I did a little mistake Testing at the beginning unwritten Offsets as Words ( Declared as bytes ... no, not on the head, please ...).
So, without this little mistake, I'd never had found this BUG ... my program would simply have locked at 2nd power-up !!!
My Address is not a secret ...
xxx
FRANCE
Close to DIEPPE or Le Tréport along the Channel, for your next visit to France ( at home coffee is free ...)
Thanks one more time
Alain
Hi, Luciano
Nice result from you too ... Microchip search engine can be upgraded, I didn't find anything in the knowledge base !!!
This device is intended to be used on big scale flying models ...
so, security first !!! ... no 18F1320 reference or soft will be published then ( I saw some, last year on another project ... gasp !!! ).
I'll do a trail with BOR enabled to the lowest possible voltage to confirm ... as, to this day, std. 4.3v BOR enabled was equal to plane death !!!
I'll wait for BUGS to be solved ... to use a 18F1320.
As Mel has written, There's no "common people" way of identifying good and bad parts ... my Picstart didn't allow me to read DEVIDs ... ( restricted area !!! ) .
Thanks a lot for your help ( in general on this forum ) and here for me.
Alain