??? 03/01/07 13:28 Read: times |
#134017 - More suggestions Responding to: ???'s previous message |
hi,
Rob Klein said:
Possible causes/things to check:
- Watchdog reset? (erasing a Flash page takes a while) This is very correct! Typicaly, erase cycle time takes 10...20 ms and if MCU works at 24,5 MHz then the watchdog period is 32,1 ms max. obtained. I always "ping" watchdog before perform erase or write flash. Moreover, in some cases it requires to re-configure the watchdog period before run into these tasks if current period set is too short. Secondly, it may look like paranoya, anyway my code checks for the fact that flash is unlocked really after key sequence has been processed. ; perform key sequence MOV FLKEY,#0xA5 MOV FLKEY,#0xF1 ; check for unlock MOV A,FLKEY ANL A,#00000011b ; if not - report and restart CJNE A,#00000010b,FLASH_ERR - Using the correct Flash page? (what value does "CONST1" have?)
Indeed, always check for lock byte limits, for more information reffer to Flash Security Summary table in datasheet. Regards, Oleg |
Topic | Author | Date |
Writing to flash from firmware | 01/01/70 00:00 | |
pretty sure the problem is in the erase section... | 01/01/70 00:00 | |
that's another thing ... | 01/01/70 00:00 | |
this is the case when the comment IS harmful.. :-) | 01/01/70 00:00 | |
need some sleep? | 01/01/70 00:00 | |
haha, yes | 01/01/70 00:00 | |
Key sequence | 01/01/70 00:00 | |
Thanks rob | 01/01/70 00:00 | |
"hung up"? | 01/01/70 00:00 | |
14 bytes or 15? | 01/01/70 00:00 | |
Another case where the comment is harmful :-( | 01/01/70 00:00 | |
More suggestions | 01/01/70 00:00 | |
random thought | 01/01/70 00:00 | |
RE: random thought | 01/01/70 00:00 | |
What I mean by hung up | 01/01/70 00:00 | |
since I do not use this deviate | 01/01/70 00:00 | |
the vdd monitor? | 01/01/70 00:00 | |
how you determine? | 01/01/70 00:00 | |
In response to Oleg's question | 01/01/70 00:00 | |
seen this app note? | 01/01/70 00:00 | |
problem solved... | 01/01/70 00:00 | |
are you using LARGE? | 01/01/70 00:00 | |
no large or xdata var![]() | 01/01/70 00:00 |