pic first build test board not running


Closed Thread
Results 1 to 12 of 12
  1. #1

    Default pic first build test board not running

    hi everyone...
    I finally got all the hardware and wrote a little test program for my pic (16f877A)
    i built a llittle test board with 8 3mm red LED's
    The test program i wrote is a simple knight rider led sequence...
    I'm using a 20MHz crystal with 2 X 10pf caps. the programmer was set to HS crystal...

    The software runs fine in my pic simulator software but i get no signes of life...
    it's running off a since lithium ion cell with a voltage under load at 4.3 volts.

    i've double checked the voltage is going to both sets of pins, i've re-verified the pic program by putting pic back in the prodrammer...

    I've experience building circuits with the Z80180...

    Does anyone have any ideas to find whats wrong?
    Thanks

  2. #2


    Did you find this post helpful? Yes | No

    Default

    i double checked the led's... they all light up...
    multimeter reads 1.8v DC, 0V AC on osc1... 0.8V DC, 0V AC on OSC2 compairred to VSS
    my multimeter may not be sensitive enough to detect a 20MHz xtal fluctuations

  3. #3
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Code? and try

    Try to turn on only one (or all) at the same time and leave them on. Toggle pins on the same port rapidy after each other can give RMW (read modify write) problems when running the pic at 20 MHz.

    So all on or one, but leave the blink blink for step 2

    /me
    Last edited by Jumper; - 28th June 2009 at 14:41.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    here is the program i threw together in about 2 mins just for a test sequence...

    Code:
    Define  OSC				20
    Define CONF_WORD = 0x3F72
    
    ALLDIGITAL
    TrisA	=	%00000000					'Set everything on port A as output
    TrisB	=	%00000000					'Set everything on port B as output
    TrisC	=	%00000000					'Set everything on port C as output
    TrisD	=	%00000000					'Set everything on port D as output
    TrisE	=	%00000000
    
    main:
    low 0
    low 1
    low 2
    low 3
    low 4
    low 5
    low 6
    low 7
    
    High 0
    pause 500
    Low 0
    high 1
    pause 500
    low 1
    high 2
    pause 500
    low 2
    high 3
    pause 500
    low 3
    high 4
    pause 500
    low 4
    high 5
    pause 500
    low 5
    high 6
    pause 500
    low 6
    high 7
    pause 500
    Low 7
    high 6
    pause 500
    low 6
    high 5
    pause 500
    low 5
    high 4
    pause 500
    low 4
    high 3
    pause 500
    low 3
    high 2
    pause 500
    low 2
    high 1
    pause 500
    low 1
    
    goto main
    END
    Reprogramming to turn all on and enter nop loop

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    1. The 877A has multiple Ground and Power pins, make sure you have them all connected.

    2. You did remember to do something meaningful with the MCLR pin?

    3. Whilst you have defined OSC 20 for your program, you need to set HS OSC in the PIC Configuration Fuses. Whilst your program compiles wihout error, it didn't do much for the CONFIG Fuse settings for my programmer which remained at XT OSC.

    4. I don't recall what the default Brown-Out is for that PIC (again my programmer reported it ENABLED by Default)... you might need to turn it OFF to run at 4.3v.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    jumper:
    I threw this code in and compiled it...

    Code:
    Define  OSC				20
    Define CONF_WORD = 0x3F72
    
    main:
    TrisB	=	%00000000					'Set everything on port B as output
    PORTB = 255
    goto main
    oshon pic simulator reports all LED's on port B light up...
    again, nothing on my test board...

    Mel:
    I'm using WinPIC800 and JDM programmer...
    I'm loading the program and then clicking on settings and selecting HS under OSC...
    Please correct me if i've wrong, but i thaught the CONF_WORD set the OCS type?

    Thanks

  7. #7


    Did you find this post helpful? Yes | No

    Default

    when i re-read the chip into an empty winpic800 with default fuse options it reads the program and fuse settings in which it the fuse setting and switched to HS... so, i'm 99% sure it's setting the chip to HS... unless you want to tell me diferent...

  8. #8
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default

    Defines must be in capital letters DEFINE OSC 20.

    Make sure MCLR is pulled up to VDD.

    Make sure BOR is off.

    I would take away the Conf_Word and set the config manually in my programmer. Just to make sure it is the correct setting, I have never seen your way of using a Define this way.

  9. #9


    Did you find this post helpful? Yes | No

    Default

    it seems i have some sort of oscilator problem...

    it could be a bad solder joint or something like that... but it once lit all 8 LED's and then once i disconnected the power it refused to work again...
    so i rebuilt the circuit on a small piece of plugboard and used a salvaged 1.4MHz crystal... wouldn't mind so much, but the pair of 20MHz crystals i've got spacifically to do the job are brand new...
    The second crystal is allready in my proper build board...

    I don't need the timing acuracy of an xtal but the speed will be required, has anyone got a formula for using RC? or is that not advisable at such speeds?

    Thanks to everyone

  10. #10


    Did you find this post helpful? Yes | No

    Default

    i found the problem...

    I re-checked my test board could find a problem... so i decided i must have a dead crystal so i went to unsolder it... and then i noticed that the solder created a line half way between the crystal pin and the pic's socket pin...

    So it turns out that i had a hairline crack in the copper track that, quite frankly was so small that i couldn't see it dispite looking very closely...

    So, theirs one for the FAQ... when using stripboard, run solder down the lines for the oscilator...

    Also, it's worth noting that on my prototype plug board I tried a 24.576MHz crystal which worked too... even though my 16f877A I/P is rated at 20MHz... so thats a very nice 22% overclock...

    Thanks to everyone for the help, especially Mel...

  11. #11
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Overclock

    Hi,

    Speed= increased current consumption

    that also means that the PIC will run hotter and this might work at room temperature but it will not for 100% sure keep you running at max ambient temp according to the datasheet.

    As long as you keep that in mind ...

  12. #12


    Did you find this post helpful? Yes | No

    Default

    my PC is liquid cooled with an overclock of aproximatly 10% on my processor and about 15% on my gfx card... it's the best i can run in summer... looking farware to winters sub zero cooling...

    thans for the warning Jumper, it's appreciated...

Similar Threads

  1. Replies: 6
    Last Post: - 20th December 2007, 21:56
  2. Two PIC 16F877A fried in two days!
    By manumenzella in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 18th January 2007, 10:38
  3. Replies: 8
    Last Post: - 5th January 2007, 05:10
  4. Replies: 8
    Last Post: - 7th December 2006, 15:42
  5. Build PIC bootloader firmware in PBP?
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 18th August 2006, 19:53

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts