Hello evryone,
I have recently got my PickKit 2 Demo board with PIC16F690 microcontroller. Since I have just begun with it and with reading book C What happens I found one simple problem I cannot get over it. I
I hope that this is right forum subsection for this sort of things regarding electornics.
My problem is very simple, I have 4 LED on port C pins 0, 1, 2, 3 and I would like to turn them on all at same time and turn them off (BLINK), I have tried with this two options:
1. void main()
{
PORTC = 0;
TRISC = 0;
while(1)
{
PORTC = 1;
Delay_ms(1000);
PORTC = 0;
Delay_ms(1000);
}
}
At this option only 1 led is turning on and off and this is on pin C0, have no clue why not all of them.
2. void main()
{
PORTC = 0;
TRISC = 0;
while(1)
{
PORTC = ~PORTC;
Delay_ms(1000);
}
}
Here all four leds turn on and stay constantly on. What I am doing wrong here?
Beside that, half of declarations I try to use are either not there or missing. So If I try to just copy from book or any other tutorial I still get errors.
For example: SET_OUTPUT_B(), GPB, INPUT_B(), SET_TRIS_B(),... evrything is not recognizeable, any reasons why?