1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Is the program working properly or not (18F4520)

Discussion in 'Oshonsoft' started by camerart, Jul 16, 2016.

  1. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,318
    Likes:
    11
    Location:
    Dorset UK.
    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: http://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.
     
  2. sagor1

    sagor1 Member

    Joined:
    Dec 11, 2014
    Messages:
    52
    Likes:
    2
    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...
     
  3. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,318
    Likes:
    11
    Location:
    Dorset UK.
    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:oops::oops:
    Thanks for your reply,
    C.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. sagor1

    sagor1 Member

    Joined:
    Dec 11, 2014
    Messages:
    52
    Likes:
    2

    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....
     
  6. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,318
    Likes:
    11
    Location:
    Dorset UK.
    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: http://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.
     

Share This Page