Tricka90
Member level 1
I'm trying to light up a LED with a PIC 16F876 (datasheet: https://ww1.microchip.com/downloads/en/devicedoc/30292c.pdf) on port RA5. The LED just doesn't light up.
I've set TRISA = 0 and PORTA.RA5 = 1 of course.
In the datasheet I found that RA5 is also an analog port, so I set up all ports as digital with ADCON1 = 0b00000110 and ADCON0 = 0.
Still the LED doesn't work.
Then I found that RA5 is also a "slave select for the synchronous serial port" so I tried to disabilitate this function with PIE1.SSPIE = 0 and SSPCON.SSPEN = 0.
The LED continues not lighting up.
Do you think I'm doing something wrong? Could it be that pin RA5 is just faulty?
I've set TRISA = 0 and PORTA.RA5 = 1 of course.
In the datasheet I found that RA5 is also an analog port, so I set up all ports as digital with ADCON1 = 0b00000110 and ADCON0 = 0.
Still the LED doesn't work.
Then I found that RA5 is also a "slave select for the synchronous serial port" so I tried to disabilitate this function with PIE1.SSPIE = 0 and SSPCON.SSPEN = 0.
The LED continues not lighting up.
Do you think I'm doing something wrong? Could it be that pin RA5 is just faulty?