16F676 Please explain this problem...


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2008
    Posts
    6

    Default 16F676 Please explain this problem...

    Here is some very simple example code that exhibits a problem I am unable to explain.
    The following code WORKS. Following it, I will show something that does NOT WORK.

    @ DEVICE pic16F676, INTRC_OSC_NOCLKOUT
    @ DEVICE pic16F676, WDT_OFF
    @ DEVICE pic16F676, PWRT_OFF
    @ DEVICE pic16F676, MCLR_OFF
    CMCON = %00000111
    ANSEL = %00000000
    TRISC = %000000

    PAUSE 1

    Main:
    HIGH PORTC.0
    HIGH PORTC.1
    HIGH PORTC.2
    HIGH PORTC.3
    HIGH PORTC.4
    HIGH PORTC.5
    PAUSE 500
    LOW PORTC.0
    LOW PORTC.1
    LOW PORTC.2
    LOW PORTC.3
    LOW PORTC.4
    LOW PORTC.5
    PAUSE 500
    GOTO MAIN

    Now, If I replace the Main section with:

    Main:
    PORTC = %111111
    PAUSE 500
    PORTC = %000000
    PAUSE 500
    GOTO MAIN

    It hiccups. Will blink once or twice.. maybe several times.. but will hiccup and stop and start very intermittently. What am I doing incorrectly here?

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    1 - What are you using for the power supply?

    2 - Do you have decoupling cap close to VDD (to GND)?
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Question

    Hi,

    adding to Paul's ( good !!! ) questions ...

    What kind of load do you place on your outputs ( LEDs Ok, I wonder ! , but current = ? series resistor = ? )

    What kind of supply do yo have provided ??? ( a 6 LR 61 batt . ... joking ! )

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Apr 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Ahh.. I rearranged the board and forgot to put the cap back.. i gotta go find that -- although that does make sense.

    I am using a 9V AC adapter with a 5V Vreg for the positive supply...

    I am running LED's but they are buffered from the PIC's outputs with BJT's.

    EDIT: putting the cap back solved the problem... argh! sometimes I feel so foolish =)
    Thanks guys..
    Last edited by Jayhovah; - 9th May 2008 at 22:06.

Similar Threads

  1. 16F676 programming problem
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 18th May 2009, 17:39
  2. 16F676 Really simple, stupid problem - Help!
    By Jayhovah in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 1st May 2008, 03:28
  3. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  4. Problem during compilation 16F676
    By mat janssen in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th October 2005, 07:05
  5. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59

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