Good evening,
I hope you are well.
I am new on this forum.I am working on a project which uses an ATMEGA2650 located in a Board.
I have written a code to communicate with this board via RS232.I am using Arduino to talk to the board. But it does not seems to work at all.
I have set the right baud rate(9600).
My code seems to be ok(when I compile it), but when I upload the code into the board. The serial monitor keeps displaying "NOT printing".....So it looks like there is no "serial.available".
Can you help me please?
Here is my code:
void setup() {
// initialize serial port:
Serial.begin(9600);
}
void loop()
{
if (Serial.available()>0)
{
int inByte = Serial.read();
Serial.println("Writing");
Serial.print("AT+CGMR=0\r\n");
Serial.print(inByte, BYTE);
}
else
{
Serial.println("NOT Writing");
}
delay(1000);
if (Serial.available())
{
Serial.println("Reading");
int inByte = Serial.read();
Serial.print(inByte, BYTE);
}
}
| Tags |
|
| Similar Threads | ||||
| Thread | Starter | Forum | Replies | Last Post |
| rs232 communication with hyperterminal | dak246 | General Electronics Chat | 10 | 6th June 2005, 09:50 AM |
| LCD display and Hyperterminal communication with 16F877 | peter83 | Microcontrollers | 2 | 16th May 2004, 06:28 AM |
| Serial Communication with mobile phone | remi | Microcontrollers | 0 | 31st March 2004, 04:22 PM |
| usb device communication with my pc | defcon31 | Microcontrollers | 4 | 8th January 2004, 08:16 AM |
| Serial Communication with 16f876 help | RonDumas | Microcontrollers | 17 | 21st October 2003, 10:36 PM |