pic 16f627a problems

Discussion in 'Embedded Systems and Microcontrollers' started by ptbrpackrat, Sep 18, 2011.

  1. ptbrpackrat

    Thread Starter New Member

    Sep 18, 2011
    3
    0
    i am a newby to this type of site
    but i have no where else to go to get the answers
    i am working with a pic16f627a chip and i have blown the program onto it and it works fine in the velleman test board but when i put it on my circuit test board and wire it up the program does not work. seems the timing is not working.
    the LED will come on but not right
    any ideas
    thnx
     
  2. upand_at_them

    Active Member

    May 15, 2010
    246
    29
    Are you using the same frequency crystal? Is the supply voltage correct? Does MCLR need to be pulled high (is it enabled in the program)?
     
  3. CraigHB

    Member

    Aug 12, 2011
    127
    15
    Sounds like a layout problem. Did you bypass all of your Vcc-Vss pin pairs with .1µF capacitors?
     
  4. ptbrpackrat

    Thread Starter New Member

    Sep 18, 2011
    3
    0
    i have just wired it the way they wired it in the book!
    they did not show any caps in the wiring diagram.
     
  5. CraigHB

    Member

    Aug 12, 2011
    127
    15
    Those caps are always assumed. The data sheets for some chips will tell you to put them there, others don't. It's not uncommon to have problems without them.
     
  6. ptbrpackrat

    Thread Starter New Member

    Sep 18, 2011
    3
    0
    hi Craig thanks for the reply
    i was wondering if you know of any books that might help me with all the other things that are assumed
    i bought john morton book and i think he assumes to much also.
    thanx
    ptbrpackrat
     
  7. jwilk13

    Member

    Jun 15, 2011
    228
    12
    As far as assumptions go, I'm not sure of the others. I would check out this though, it's pretty handy for just about everything.

    Most of the info for every PIC is in the corresponding datasheet, and when I've gotten in trouble with PICs is when I didn't read the datasheet thoroughly.
     
  8. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    Add those caps for sure!

    We've all been there. The good news is the debuggers have dropped in price to where they are very good and very affordable, meaning the PicKit makes a great in-circuit debugger. If you don't have one you should get one if you are serious about using these devices.

    That said, you need to drop back and punt, meaning you need to verify your test board is working. Forget your program for a bit and write the simplest program you can, just turn on a pin or all pins on a port and stop there. Make sure it runs in the simulator, that you see the pin signals change to ONE, then program this into your device. Use the internal oscillator (your device has one) even if you have the crystal set up, the internal oscillator WILL work where the external one could give you problems.

    If that works, remake the program using the external crystal and see if it still works. If not, there is your problem.

    Keep us updated and we'll help ya!
     
  9. CraigHB

    Member

    Aug 12, 2011
    127
    15
    I "drop back and punt" a lot myself. So many times I've just overlooked something and assumed there was no problem. Sometimes you just have to go back to square one.

    I'm having an issue like that right now. I'm having a hell of time with the SPI module on a PIC24F right now. Really wierd thing, works fine with an older rev chip and is flakey with a newer rev chip. So far, I've had the same issue with two different part numbers, the PIC24FJ16GA002 and the PIC24FJ32GA004. Older rev works solid, newer rev is flakey. I've been futzing around with this a long time. I've tried everything I can think of. I'm starting to think it's a screw-up on Microchip's part. Wouldn't be the first time. I may have to bail on the hardware SPI module and implement the SPI bus in code, what a pain. It seems like Microchip screws up a lot in that regard, breaking things with silicon revisions.

    [edit next day]

    Ironically, shortly after posting this, I found my problem. I had to change the polarity on my clock signal. I think what happened is the old revision output a negative clock even though the config registers defaulted to a positive clock. They fixed that in a newer revision, but I had inadvertantly relied on it. It was sort of a case of them breaking something with a new silicon revision but actually, they fixed something that broke my code which was wrong to begin with. In any case, a strange turn of events that caused me a lot of headache. Very happy I resolved it. Hehe, still, I always cringe when upgrading silicon revisions.
     
    Last edited: Sep 21, 2011
Loading...