santais
Junior Member level 1
Hey guys.
I basically tried everything to get my PIC running, both on a bread board and on a print. I have also looked into the threads here on the forum, and tried some of the different solutions, but without luck.
I did succeed in getting a program running on a bread board, where it just turned all ports on and off with 1 sec delay. However, if it turned the power supply off and turned it on again, it just stopped working.
The program has been tested and used on EASYPIC5, and it's also one of the example programs, so it most definitely work. I'm using the same pic on my EASYPIC5, bread board and print. It's a 8 MHz Xtal crystal I'm using, with 2x pF conductors.
And just a quick correction. The diagram shows that I'm using a PIC 16f877, but I'm using a PIC 16f887. The pic diagrams aren't in the program from the start, and I could only find the PIC 16f877, but it's the same pins.
My diagram of the print is as following:
**broken link removed**
The print version:
**broken link removed**
And the code is:
void main() {
ANSEL = 0; // Configure AN pins as digital
ANSELH = 0;
C1ON_bit = 0; // Disable comparators
C2ON_bit = 0;
TRISA = 0x00; // set direction to be output
TRISB = 0x00; // set direction to be output
TRISC = 0x00; // set direction to be output
TRISD = 0x00; // set direction to be output
while(1) {
PORTA = 0x00; // Turn OFF LEDs on PORTA
PORTB = 0x00; // Turn OFF LEDs on PORTB
PORTC = 0x00; // Turn OFF LEDs on PORTC
PORTD = 0x00; // Turn OFF LEDs on PORTD
Delay_ms(500); // 1 second delay
PORTA = 0xFF; // Turn ON LEDs on PORTA
PORTB = 0xFF; // Turn ON LEDs on PORTB
PORTC = 0xFF; // Turn ON LEDs on PORTC
PORTD = 0xFF; // Turn ON LEDs on PORTD
Delay_ms(500); // 1 second delay
}
}
Thanks
I basically tried everything to get my PIC running, both on a bread board and on a print. I have also looked into the threads here on the forum, and tried some of the different solutions, but without luck.
I did succeed in getting a program running on a bread board, where it just turned all ports on and off with 1 sec delay. However, if it turned the power supply off and turned it on again, it just stopped working.
The program has been tested and used on EASYPIC5, and it's also one of the example programs, so it most definitely work. I'm using the same pic on my EASYPIC5, bread board and print. It's a 8 MHz Xtal crystal I'm using, with 2x pF conductors.
And just a quick correction. The diagram shows that I'm using a PIC 16f877, but I'm using a PIC 16f887. The pic diagrams aren't in the program from the start, and I could only find the PIC 16f877, but it's the same pins.
My diagram of the print is as following:
**broken link removed**
The print version:
**broken link removed**
And the code is:
void main() {
ANSEL = 0; // Configure AN pins as digital
ANSELH = 0;
C1ON_bit = 0; // Disable comparators
C2ON_bit = 0;
TRISA = 0x00; // set direction to be output
TRISB = 0x00; // set direction to be output
TRISC = 0x00; // set direction to be output
TRISD = 0x00; // set direction to be output
while(1) {
PORTA = 0x00; // Turn OFF LEDs on PORTA
PORTB = 0x00; // Turn OFF LEDs on PORTB
PORTC = 0x00; // Turn OFF LEDs on PORTC
PORTD = 0x00; // Turn OFF LEDs on PORTD
Delay_ms(500); // 1 second delay
PORTA = 0xFF; // Turn ON LEDs on PORTA
PORTB = 0xFF; // Turn ON LEDs on PORTB
PORTC = 0xFF; // Turn ON LEDs on PORTC
PORTD = 0xFF; // Turn ON LEDs on PORTD
Delay_ms(500); // 1 second delay
}
}
Thanks