After some time, flash is corrupted. At least - the lower two bytes are corrupted (the reset vector).
Flash was not written at the time of the problem.
The problem is quite common in hardware. But it is not possible to reproduce it on the stand.
Discussion Forums
8-bit MCUs
Answered
Answered
I've always used an external VDD monitor controlling the reset line on these "old" devices. Beside that, you should read the "FLASH Corruption" article in the Knowledge Base.
1
1) do you have a pullup on !RST ?
2) do you have decoupling no more than 5mm from Vdd?
1
all thanks
0
for C8051F321, there is an requirement on VDD ramp up time.
I am wondering if you are using the internal regulator, if you are using it, you may consider to upload the schematic for review.
And also probe the VDD with a scope to see if meet the spec.
0
Yes, I use an internal regulator. The f321 is powered by an LP2985-50 chip.
The original Board was on an ancient PIC. They say it worked (the firmware is also mine). But it is difficult to check because there were not enough boards.
I replaced the microcontroller to the f321, and there were problems.
0
on the hardware side, could you upload your schematic (pdf format)?
on the software/firmware side, you may need check item by item in the KBA mentioned by @ReneK.
I did not see issue in your schematic that could explain the flash corruption issue.
1. usually silabs don't recommend to add capacitor on RSTn. only a pull-up resistor is recommended.
2. it looks you don't use USB function that was available on this device.
3. you have lot of external component for C2/program interface. usually only 3 pins are ok to program/debug the F321, GND, C2D,C2CK and you don't need other external component (except item 1) for these pin.
4. you may need to pay special attention on the LDO and 12V supply. you could probe the VDD of F321 to see if it violate the spec.
0
I've been using C2 like this for 15 years, when CYGNAL released the f300. Now a different interface recommendation?
0
As far as i know the external capacitor on RSTn may limit the C2 speed.
C8051F321 - flash is being corrupted
After some time, flash is corrupted. At least - the lower two bytes are corrupted (the reset vector).
Flash was not written at the time of the problem.
The problem is quite common in hardware. But it is not possible to reproduce it on the stand.
1) do you have a pullup on !RST ?
2) do you have decoupling no more than 5mm from Vdd?
for C8051F321, there is an requirement on VDD ramp up time.
I am wondering if you are using the internal regulator, if you are using it, you may consider to upload the schematic for review.
And also probe the VDD with a scope to see if meet the spec.
The original Board was on an ancient PIC. They say it worked (the firmware is also mine). But it is difficult to check because there were not enough boards.
I replaced the microcontroller to the f321, and there were problems.
on the hardware side, could you upload your schematic (pdf format)?
on the software/firmware side, you may need check item by item in the KBA mentioned by @ReneK.
Datasheet for the TI LDO:
https://www.ti.com/lit/ds/symlink/lp2985-n.pdf
I would like to echo what luweiguo said, the schematic will be a big help for diagnosing this issue. Also you may want to take a look at our KBA regarding our guidelines to avoid flash corruption: https://www.silabs.com/community/mcu/8-bit/knowledge-base.entry.html/2004/02/14/flash_corruption-u4VR
the scheme is simple.
I did not see issue in your schematic that could explain the flash corruption issue.
1. usually silabs don't recommend to add capacitor on RSTn. only a pull-up resistor is recommended.
2. it looks you don't use USB function that was available on this device.
3. you have lot of external component for C2/program interface. usually only 3 pins are ok to program/debug the F321, GND, C2D,C2CK and you don't need other external component (except item 1) for these pin.
4. you may need to pay special attention on the LDO and 12V supply. you could probe the VDD of F321 to see if it violate the spec.
As far as i know the external capacitor on RSTn may limit the C2 speed.
https://www.silabs.com/community/mcu/8-bit/knowledge-base.entry.html/2004/02/26/pull-up_resistorfor-2pfR
As far as i know the external capacitor on RSTn may limit the C2 speed
GET RID OF IT
in the Cygnal days some .... 'solved' noise by putting a cap on !RST and that morphed into an urban legend that the cap was beneficiial BULL....