Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Communicate between tow microcontrollers by using USART

Status
Not open for further replies.

vhk

New Member
There is one switch in Transmitter part ( Attiny2313 : PORTB.1) and one LED (Attiny2313:pORTB.0) in Reciever part. The LED must On and Off with pressing the switch but it not works. What is the problem?

The Codes in Transmitter part: (codevision)

(codewizard-->USART-->Transmitter)
...
int Data;
while(1)
{
Data=PINB.1;
printf( "%u",Data);
};

The Codes in Reciever part:

(codewizard-->USART-->Reciever)
....
int Data=0;
while(1)
{
scanf("%u",Data);
PORTB.0=Data;
};

(TX pin in Transmitter part is connected to RX pin in Reciever part)

Thanks
 
Last edited:
How is the switch connected? Check that the switch actually works and the state of the PORTB.1 actually changes between logic 1 and 0 when the switch is pressed.
Is the code an example code that comes with Codevision? Did you alter the code in any way?
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top