this
Member level 2
Hello world!
I'm trying to write my "Hello world" program for PIC16F677.
I just want it to set all I/O pins high.
But the only pins that gets high are:
#4 - RA3 but it's input only, so I gues that's not set by my code.
#16 and #19 which are both marked as a comparator "+" input.
What am I missing?
I haven't read whole datasheet yet, so It's probably something obvious.
Hope someone can enlighten me.
I'm using HI-TECH Software\PICC\9.81\bin\picc.exe compiler.
I'm trying to write my "Hello world" program for PIC16F677.
I just want it to set all I/O pins high.
But the only pins that gets high are:
#4 - RA3 but it's input only, so I gues that's not set by my code.
#16 and #19 which are both marked as a comparator "+" input.
What am I missing?
I haven't read whole datasheet yet, so It's probably something obvious.
Hope someone can enlighten me.
I'm using HI-TECH Software\PICC\9.81\bin\picc.exe compiler.
Code:
#include<htc.h>
__CONFIG(MCLRE_OFF & CP_OFF & WDTE_OFF & FOSC_INTRCIO );
//clear off,code protect off, watchdog off, I'm not sure what should I set for osc. I'm using internal
void main()
{
//set all I/O ports as output
TRISA = 0;
TRISB = 0;
TRISC = 0;
//set all I/O ports high
PORTA = 1;
PORTB = 1;
PORTC = 1;
while(1)
{
//neverending story
}
}