Hi
I have a strange thing, I get no problem with the code:
void c328r_init(void)
{
Serial.begin(9600);
do
{
// Send SYNC sequence
Serial.print(0xAA, BYTE);
Serial.print(0x0D, BYTE);
Serial.print(0xAA, BYTE);
Serial.print(0xAA, BYTE);
Serial.print(0xAA, BYTE);
Serial.print(0xAA, BYTE);
delay(1000);
} while(!c328r_look_for_ack());
}
int ledpin = 13;
void setup(void)
{
delay(10000);
c328r_init();
digitalWrite(ledpin, HIGH);
}
void loop(void)
{
}
With the above code, i can read AA 0D AA AA AA AA if i use gtkterm
HOWEVER if i modify the code to :
void c328r_init(void)
{
Serial.begin(9600);
do
{
// Send SYNC sequence
Serial.print(0xAA, BYTE);
Serial.print(0x0D, BYTE);
Serial.print(0x00, BYTE);
Serial.print(0x00, BYTE);
Serial.print(0x00, BYTE);
Serial.print(0x00, BYTE);
delay(1000);
} while(!c328r_look_for_ack());
}
int ledpin = 13;
void setup(void)
{
delay(10000);
c328r_init();
digitalWrite(ledpin, HIGH);
}
void loop(void)
{
}
Well with the above code, I get for example (with gtkterm):
AA 0D 00 0A 00 00
AA 0D 00 00 5D 3E
AA 0D 00 0A 00 00
AA 0D 00 0A C0 D8
=> in a conclusion, the first hexa are good (AA, 0D, 00) but not the other 3
one would say that after the first print(0x00, BYTE), next print(0x00, BYTE) are completely crapy...
Bug ?
Please let me now, i really think this is a bug in software...