I'm trying to establish communication between the ATtiny2313 and Arduino uno through the serial port (RX) / (TX).
Question - Serial.begin () also works without a PC, or not? Because when i unplug arduino from computer and try to read a serial information the LED not want to blink :~
And if not than what can i do to establish communication?
My simple code for arduino:
int receivedata=0;
void setup()
{
Serial.begin(1200);//1200 is max baud rate
pinMode(13, OUTPUT);
}
void loop(){
if(Serial.available()> 0 )
{
receivedata=Serial.read();
digitalWrite(13, HIGH);
delay(30);
}
digitalWrite(13,LOW);
delay(10);
}
Because when i unplug arduino from computer and try to read a serial information the LED not want to blink
Which LED? My Arduinos have at least three each.
If you are referring to the RX and TX LEDs, those are controlled by the USB-to-serial converter chip, not the ATMega328 chip. If you are connecting directly from the RX and TX pins to the other chip, the TX and RX LEDs should not be expected to flash.
I'm talking about 13 LED (installed) it`s like indicator.
Then, it would appear that the Arduino is not receiving anything.
You've said nothing about how the ATtiny2313 is connected to the Arduino, or what code is running on the 2313, so we can say nothing about what the potential problem is.
Attiny2313 send data and it is correct data for test i only send one value. To check if attiny2313 send some data i used osciloscope.
The code works when arduino is connected to PC but if not than nothing happens
attiny2313 is directly connected via wire and attiny2313 tx is connected to arduino uno rx(0 pin)
Why, when i connect to pc the serial works, but when i unplug usb, there no binking?
Why, when i connect to pc the serial works, but when i unplug usb, there no binking?
Because the Arduino has no power? How are you powering the Arduino? Connect another LED with resistor, and blink that one, to confirm that the Arduino is indeed working.
It is strange but when i connect supply through Vin or jack, serial not working, but when i have usb supply without data pins it seems like it works :))
I saw the mystic. When Vin voltage is higer than 6.5V the lmv358 like shut down the atmega8u2 and serial wont work
Maybe some know how to solve this.
PS.
In my project I use Motorshield with L293D chip which need higer voltage to drive motors
It may be a stupid question but if i have a two seperate supply they never communicate through serial? If it - how can i communicate?
The boards and the various power supplies all need to have their grounds connected, unless you are communicating between arduinos with some kind of wireless module (infrared, radio frequency)