Will the program below make LEDs connected to PORTA blink pe
Solution
Dear Student,
I think this program is for 8 bit PIC Microcontroller.In PIC TRIS is an 8 bit register.Which can store a 8 bit value.
When you power on your pic microcontroller by default all pins are input pin.
The TRIS registers are 8-bit registers. The LSB (Less significant byte) corresponds to pin 0 and the MSB (Most significant byte) to the pin 7. When one bit of this register is set to \'1\', the corresponding port pin shall become an input. When it is set to \'0\', then this port pin shall become an output. So in our program we made TRIS an output port i.e. we have define the A port direction as output.
TMR1 is a timer which is used for giving delay.
So your question is whether this program blink LED periodically or not right..?
Yes..!!! The program is going to blink LED \"on\" and \"off\" beacuse we have given an bit value to PORTA as given PORTA=0x0068.Its menas the binary representaion of this will be 01101000 ignore the leading zeros(\'0\').Because numbring always start from LSB to MSB.
It means the 4th, 6th and 7th LEDs wil blink periodically.Because anodes of LEDs are connected to PORTA and Cathods are connected to ground.
So i have mentioned the comment in the program see below...
PORTA=0x0068 //make 4th, 6th and 7th pin as high
ms_delay(1000) //delay of 1000 ms
PORTA=0x00 //Makes All pins as low
ms_delay(1000) //delay of 1000 ms
******Dear Student if you are satisfied with the answer kindly provide your valubale feedback*****

