#include <SoftwareSerial.h>
SoftwareSerial mySerial(21, 20);
void setup()
{
Serial.begin(57600);
Serial.println("Goodnight moon!");
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
mySerial.println("Hello, world?");
}
void loop() // run over and over
{
mySerial.println("ping from the board");
delay(2000);
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}
that works fine on 644P (both way communication) and it does not work on 1284P (no communication at all).
The "...644P__" and "...1284P__" macros are paired correctly in the sanguino files.
Humous seeing this, I was going to test out this issue, in a way.
My approach is to test out the fuses settings. Default high fuse is 0x9E, but rumor is that 0xDE is better. Tomorrow, I will set the fuses at:
avrdude -v -p m1284p -c usbasp -U hfuse:w:0xDE:m -U lfuse:w:0xFF:m -U efuse:w:0xFD:m
57k baud has a pretty high error rate, if you are using the internal oscillator, it might be that the 1284p deviates enough to prevent serial from working...
My approach is to test out the fuses settings. Default high fuse is 0x9E, but rumor is that 0xDE is better. Tomorrow, I will set the fuses at:
avrdude -v -p m1284p -c usbasp -U hfuse:w:0xDE:m -U lfuse:w:0xFF:m -U efuse:w:0xFD:m
That did not help. Actually it makes matters worse (I tried both 9E and DE), since even the upload fails.
57k baud has a pretty high error rate, if you are using the internal oscillator, it might be that the 1284p deviates enough to prevent serial from working...
I am using external crystal (16MHz). The board has been working reliable for quite a while, so hardware-wise is solid.
I am using 57k for the serial monitor, 9,600 for SoftwareSerial.