Is the program working properly or not (18F4520)

Status
Not open for further replies.

camerart

Well-Known Member
Hi,

I'm asking a general question about PIC programs and odd results. I have a program on an 18F4520 PIC, which works one day then doesn't the next. I have attached a link to the program, but it may complicate things, here it is: https://www.electro-tech-online.com/threads/gps-controlled-nmea-data-following-tracker.146733/page-2

The PIC program gives different results at different times. Once it gives the correct results, then it will keep working ok. What I want to know is, can a PIC work correctly intermittently, or is it most likely to be something I'm doing?

Camerart.
 
Hard to tell from the board/PCB diagram, but do you have the recommended 0.01uF and 1000pF bypass caps close to the VDD and VSS pins on the chip? It may be possible it is breaking into some kind of oscillation at random times? Just a guess from a hardware point of view...
 

H Sagor,
Yes, I have the required capacitors.
When this sort of thing happens, I keep checking in case it is my fault, and as expected I have found an error in the TXT file I use for testing
Thanks for your reply,
C.
 
Yes, I had some doubts you would miss that, we all know to add those capacitors. Just thought I'd ask, since the PCB picture showed one or two caps close, but not two at a time - hard to see..
Anyway, glad you worked it out. Cannot see the forest for the trees in the way....
 

Hi S,
I spend much of my life in the trees and not seeing the forest (Actually, in the wild, I'm quite observant)

Anyway, there was a second thing wrong in my program, and if you're interested, you can see it here: https://mymathforum.com/trigonometry/333045-divide-zero-correction-9.html
I thought I wouldn't complicate things, then thought it may be interesting, for some people. so I've added it.
Cheers, C.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…