Last March I put a project to bed and reopened it last week. When I put it to bed, I was getting inconsistent results. That is, one chip would work and a presumably identical chip wouldn't work. That inconsistency still exists.
Here is the basic project:
Oops: The Inclinometer chip is a PIC12F683.
T2 is the 16-bit high count for a PWM signal; T3 is the 16-bit count for the period. The ratio gives a value that is converted to inclination using a look-up table.
When I started getting inconsistencies, I stripped the program to its bare essentials and just print out the four bytes of data. That program in MPASM with a lot of comments to myself is attached (change txt extension to .asm for viewing with MPLab).
The symptom I see is that one chip (call it #1) will print to screen the register values and update several times a second as expected. Another chip (#2) will print to screen one set of register values BUT NOT UPDATE. If I reset with MCLR, then chip #2 will print appropriate new values, but still not update. Both chips have been programmed with the same build using either an ICD3 or PK3, yet one sometimes works and the other doesn't. Chip #1 is the older chip and has been erased and programmed many times. Chip #2 is actually any one of three chips. One is a bit older than the others. One was absolutely brand new out of the anti-static shipping package yesterday.
Hardware: Two setups have been used. One is a breadboard that drives the display data with PortB. It has a high-quality ZIP 40-pin socket for the MCU. The other is a commercially made PCB that drives the display with PortA. It uses a standard socket for the MCU. The includes in the header simply have the defines needed for using PortB or PortA, They are no secret and I would be happy to include them, but long questions get fewer replies. Even using the bread board only or prepared PCB, different chips behave differently.
I have tried wiggling the chips; different power-up and power-down sequences; removing chips, placing them on anti-static pad and replacing; letting the frozen display run for up to an hour or more; and anything else I could think of.
My ultimate question is what sort of things can I try to pin down the program error that appears to be handled differently by different chips? If you do a compile and disassembly, you will see that the PC goes to 0100h during the uDelay subroutine. I tried adding a Pagesel for the GOTO LCD_POWER instruction and elsewhere with no effect. (I didn't think that would be necessary with the enhanced chips for such a relatively short program.)
Regards, John
Here is the basic project:
Oops: The Inclinometer chip is a PIC12F683.
T2 is the 16-bit high count for a PWM signal; T3 is the 16-bit count for the period. The ratio gives a value that is converted to inclination using a look-up table.
When I started getting inconsistencies, I stripped the program to its bare essentials and just print out the four bytes of data. That program in MPASM with a lot of comments to myself is attached (change txt extension to .asm for viewing with MPLab).
The symptom I see is that one chip (call it #1) will print to screen the register values and update several times a second as expected. Another chip (#2) will print to screen one set of register values BUT NOT UPDATE. If I reset with MCLR, then chip #2 will print appropriate new values, but still not update. Both chips have been programmed with the same build using either an ICD3 or PK3, yet one sometimes works and the other doesn't. Chip #1 is the older chip and has been erased and programmed many times. Chip #2 is actually any one of three chips. One is a bit older than the others. One was absolutely brand new out of the anti-static shipping package yesterday.
Hardware: Two setups have been used. One is a breadboard that drives the display data with PortB. It has a high-quality ZIP 40-pin socket for the MCU. The other is a commercially made PCB that drives the display with PortA. It uses a standard socket for the MCU. The includes in the header simply have the defines needed for using PortB or PortA, They are no secret and I would be happy to include them, but long questions get fewer replies. Even using the bread board only or prepared PCB, different chips behave differently.
I have tried wiggling the chips; different power-up and power-down sequences; removing chips, placing them on anti-static pad and replacing; letting the frozen display run for up to an hour or more; and anything else I could think of.
My ultimate question is what sort of things can I try to pin down the program error that appears to be handled differently by different chips? If you do a compile and disassembly, you will see that the PC goes to 0100h during the uDelay subroutine. I tried adding a Pagesel for the GOTO LCD_POWER instruction and elsewhere with no effect. (I didn't think that would be necessary with the enhanced chips for such a relatively short program.)
Regards, John
Attachments
-
34.8 KB Views: 36