Hello. I have small problem with usart - i have to setup it to synchronous mode.. and i think i have small error but i don't see it.
I have Arduino ProMini it's Atmega328. It will run as slave receiver from another device.
From Atmel PDF i see that XCK is on PortD5
My code looks like this for now :
const byte ledPin = 13;
void setup() {
//Serial.begin (19200,SERIAL_7N1);
UBRR0 = 0;
UCSR0C = (1 << UCPOL0)|(1 << UCPHA0)|(0 << UMSEL01)|(1 << UMSEL00);
UCSR0B = (1<<RXEN0)|(1<<TXEN0);
UBRR0 = 127;
}
void loop() {
digitalWrite(ledPin, 1);
delayMicroseconds(50);
//Serial.write(8);
UDR0 = B10001001;
delay(10);
digitalWrite(ledPin, 0);
delay(10);
}
Problem - code behave like it still is in asynchronous mode (without clock signal it still send data).
Also for other ppl
Arduino MEGA 2560 dont have any XCK pins that you can connect :O.