interferences?

Discussion in 'General Electronics Chat' started by Lem0nHead, Oct 28, 2010.

  1. Lem0nHead

    Thread Starter New Member

    May 4, 2009
    4
    0
    hello
    I just started playing with a PIC12F675

    The first problem I'm having is that its output pins are around 3.2V instead 5V, when I use a 5V power supply

    The second problem is that it's extremely "unstable".
    I mean, if I put a wire somewhere and just touch it, a LED connected turns off, or blink... sometimes even if I just come closer

    I noticed this happens specially when I use a delay() function in my code (in fact, if my delay is bigger than 20000 cycles in the code below, the LED never turns on)
    Any suggestions?

    Code ( (Unknown Language)):
    1. #include <htc.h>
    2. #include <pic.h>
    3.  
    4. __CONFIG(INTIO & WDTDIS & PWRTDIS & UNPROTECT & BORDIS);
    5.  
    6. #define _XTAL_FREQ 4000000
    7.  
    8. void main(void) {
    9.     INTCON = 0;
    10.     TRISIO = 0x00;
    11.     ANSEL = 0b00000000;
    12.     CMCON = 0x07;
    13.  
    14.     GPIO=0b00000000;
    15.     _delay(10000);
    16.  
    17.     while(1) {
    18.         GPIO=0b00000001;
    19.     }
    20. }
     
  2. R!f@@

    AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    Show us ur setup first
     
Loading...