Hi all, 1284p processor it' is supported by software serial library?
I use this pins for rx and tx but with any result ;(
// RX1/INT0 (D 10) PD2 16
// TX1/INT1 (D 11) PD3 17
Any suggest for debug?
thanks Marco
Hi all, 1284p processor it' is supported by software serial library?
I use this pins for rx and tx but with any result ;(
// RX1/INT0 (D 10) PD2 16
// TX1/INT1 (D 11) PD3 17
Any suggest for debug?
thanks Marco
You have 2 hardware serial ports and you want to use software serial?
RX0/TX0 and RX1/TX1 are supported with
Serial.begin(speed);
and
Serial1.begin(speed);
I try to communicate 1284p with arduino uno via hardaware serial with this simple example:
In 1284p:
void setup() {
Serial1.begin(9600);
pinMode(1, OUTPUT);
}
void loop() {
digitalWrite(1,HIGH); // set the LED on
if(Serial1.available())
{
char c = (char)Serial1.read();
if (c == 'A')
{
digitalWrite(1, LOW); // set the LED off
Serial1.print('B');
delay(1000);
}
}
}
and in Arduino Uno:
#include <SoftwareSerial.h>
#define RX_PIN 3
#define TX_PIN 2
SoftwareSerial SerialCom = SoftwareSerial(RX_PIN, TX_PIN);
void setup() {
SerialCom.begin(9600);
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13,HIGH); // set the LED on
SerialCom.print("A");
if(SerialCom.available())
{
char c = (char)SerialCom.read();
if (c == 'B')
{
digitalWrite(13, LOW); // set the LED OFF
delay(1000);
}
}
}
and i connect pins:
pin 16 ( 1284p) to pin 2 Arduino uno
pin 17 ( 1284p) to pin 3 Arduino uno
but don't work ;( what is wrong?
bye Marco
You seem to be mixing what you are sending out, " " vs ' '
SerialCom.print("A");
Serial1.print('B');
opsss i seen the mismatch ... thanks!