I have bought one radio module and wanted to connect with Arduino Due, As I have looked there is no library like SoftwareSerial for the ARM controller.
In this case, how can i make a serial connection between my radio module and Arduino and get the data and information from the radio module and send the AT commands to the radio module.
Adalheida:
I am very new to this embedded world, Is there any example software for it ?
Thank you very much for your reply
1. Setup:
DUE and UNO are connected via DUE's hardware UART1 and UNO's software UART.
2. At every 1-sec interval, DUE transmits ABC; UNO receives the message and shows it on Serial Monitor.
3. The Codes are: DUE Codes:
void setup()
{
Serial.begin(9600); //hardware UART0 of DUE
Serial1.begin(9600); //hardware UART1 of DUE
}
void loop()
{
Serial1.println("ABC");
delay(1000);
}
Thank you very much for your response I really appreceate it. but In my case I do not have another controller like UNO. I need to send the data from the same controller and receive it from the same module.
Adalheida:
Thank you very much for your response I really appreceate it. but In my case I do not have another controller like UNO. I need to send the data from the same controller and receive it from the same module.
As you don't have another Arduino, you can make a loop back connection between UART1 and UART2 of DUE and then upload the following sketch. (TX1 -----> RX2; RX1 <----- TX2).
Codes:
void setup()
{
Serial.begin(9600); //hardware UART0 of DUE
Serial1.begin(9600); //hardware UART1 of DUE
Serial2.begin(9600); //hardware UART2
}
void loop()
{
Serial1.println("ABC");
if(Serial2.available()>0)
{
Serial.print((char)Serial2.read());
}
delay(100);
}
+1 Can't upload your datasheet. Provide the datasheet in attachement.
Anyway, if your radio module "breakout board" has RX and TX pins, connect RX to TX1 from DUE and TX to RX1 from DUE. Serial1 is USART0 BTW and there are 5 (five) hardware Serial (Serial,Serial1,2,3 and 4 by adding 3 lines of code).