turning LEDs ON and OFF of PIC microcontroller by reading data from putty

Submitted by Pic on

If "A" is typed in putty, then LED0 of the PIC24FJ128GA010 turns ON. If "99" is ented in putty or any other terminal program, LED1 blinks. Any idea how to do that ?

 

Have any questions?

Aswinth Raj

  Joined August 16, 2016      1000

Tuesday at 12:29 AM

In your case the PIC and computer should have been connected through Serial communication.

Putty is a serial software using which you can send serial data from compter to PIC thorugh COM port.

So all you have to do is write a program on PIC to check for any incoming serial data and based on that you have to control the LED

P

Pic

  Joined February 05, 2019      1

Tuesday at 12:39 AM

I am using this to receive the character entered in putty. But its not working. I am using PIC24FJ128GA010.

void U2_RxByte(void)
{
    while(!(U2STAbits.URXDA));
    if(!(U2STAbits.OERR))
    {
        command = U2RXREG;
        delayFunc();
    }
}

Add a comment

No account needed. Your comment appears once a moderator has reviewed it.

Never shown publicly.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.