pic first build test board not running


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    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.

  2. #2


    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

  3. #3
    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.

  4. #4


    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

  5. #5


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

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

  7. #7


    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

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 : 0

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