Testing PIC16F628A with LED - Which PCB and fuses?

Discussion in 'Embedded Systems and Microcontrollers' started by leye0, May 12, 2008.

  1. leye0

    Thread Starter New Member

    Apr 7, 2008
    1
    0
    Hi!

    I'm new with PIC but I can easily program I2C EEPROM from PCB.
    But for the PIC, I get no life signs. It looks like nothing works...

    For my 16F628A PIC, I made a simple circuit based on:
    http://walter.schreppers.com/files/f..._schematic.gif
    This is a LED Flash programs:

    program myprog
    main:
    CMCON=%00000111
    OPTION_REG = $80 ' Regs config: No pull-up '
    trisa = $FF ' PortA Out '
    trisb = 0

    boucle:
    PORTA = $FF
    Delay_ms(1000)
    PORTA = not PORTA
    Delay_ms(1000)
    goto boucle
    end.

    And it is programmed with WINPIC800.

    My fuses are set with no external clock or MCLR, and I've tried WDT On or Off. My current is USB power (~ 4.7V). I've tried a lot of capacitors (From 1n to 100n).

    And nothing is working!
     
  2. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    To set a pin as an output, you have to set the corresponding TRIS register to low. In your code above, you set TRISA to FFh, as inputs, and TRISB to 0h, as outputs. However, you then write to PORTA which is not configured as output pins.
     
Loading...