??? 05/08/06 16:08 Read: times |
#115802 - Silab - Erasing and writing to Flash Fro |
After lot of trouble, I reduced my code to following and tested in silabs IDE. Still It shows Flash error. This small program tries to erase sector 0x1000 and tries to write at 0x1030 location.
Initialisation code is derived from Configutor from Silab. Program was tested in single stepping and free run, with same result. I have screen shot of event, but I do not know how to post. Vimal Amin $include (C:\Keil\C51\ASM\C8051F350.INC) cseg at 00 Start: Mov VDM0CN,0x80; Enable vcc monitor Mov Dptr,#0 Loop: Djnz Dpl,$ Djnz Dph,Loop; Mov PCA0MD,#~040H; Disable PCA and watchdog Mov PCA0MD,#0 Mov OSCICN,#0x83; Enable Internal Osc. with devider = 8 Mov PCA0CPM0,#0; Disable comparators Mov PCA0CPM1,#0 Mov PFE0CN,#0; Prefatch disabled Mov Dptr,#01030H Mov PSCTL,#3; // PSWE = 1, PWEE = 1 Mov FLKEY,0xA5; // Key Sequence 1 Mov FLKEY,0xF1; // Key Sequence 2 Mov A,#0 Movx @Dptr,A // Erase Mov PSCTL,#0x00; // PSWE = 0 disable write to Flash Mov PSCTL,#1; // PSWE = 1 Mov FLKEY,0xA5; // Key Sequence 1 Mov FLKEY,0xF1; // Key Sequence 2 Mov A,#07 Movx @Dptr,A Mov PSCTL,#0x00; // PSWE = 0 disable write to Flash Sjmp $ end |
Topic | Author | Date |
Silab - Erasing and writing to Flash Fro | 01/01/70 00:00 | |
Posting Screenshot | 01/01/70 00:00 | |
If you use interrupts? | 01/01/70 00:00 | |
This is test software | 01/01/70 00:00 | |
common courtesy require ... | 01/01/70 00:00 | |
You are right here also Erik | 01/01/70 00:00 | |
I can't help you | 01/01/70 00:00 | |
Thanks Erik | 01/01/70 00:00 | |
Any flash pages locked? | 01/01/70 00:00 | |
Locked Page | 01/01/70 00:00 | |
Section 15.3 of Data Sheet | 01/01/70 00:00 | |
Key codes | 01/01/70 00:00 | |
Not my choise | 01/01/70 00:00 | |
Choices ... | 01/01/70 00:00 | |
You are right Rob | 01/01/70 00:00 | |
a General comment | 01/01/70 00:00 | |
131 & 133 | 01/01/70 00:00 | |
but remember![]() | 01/01/70 00:00 |