Hi!
Look at the code:
When I put it in PIC LED`s RC3, RC4 and RC5 are not flashing!!! The same thing is happening when I replace 870 with 877A.
Can anybody explain where is the mistake?
Peca.
Look at the code:
Rich (BB code):
#include <htc.h>
__CONFIG(HS & WDTDIS & PWRTEN & BORDIS & LVPDIS);
/* Function: Wait()
Well, PIC16F870 is working at 20MHz so it means that the controller will execute 5 million instructions in one second. If we made loop to count up to 5 million, we will have delay of 1 (one) second.
My board is Mikroelektronika EasyPIC3 with the previosly mentioned controller running at 20MHz. */
void Wait()
{
for(int i=0;i<1000;i++) // Start counting up to 1000...
_delay(5000); // ... with 5000 instructions delay.
}
void main()
{
TRISC=0x00; // Port C is output...
PORTC=0xff; // ... and turn the all LED`s on...
while(1)
{
PORTC^=0xff; //... than turn them off.
Wait(); // Wait about one second.
}
}
Can anybody explain where is the mistake?
Peca.