Witam. Wysy³ac dane juz umiemiem ale niestety mi mikroprocesor nie odbiera. Oto kod programu
#include <avr/io.h>
#include <avr/iom128.h>
#include <avr/sfr_defs.h>
#include <avr/delay.h>
#include <avr/interrupt.h >
void usart_init(void) { UCSR0A = 0x00; UCSR0C = 0x06; UBRR0L = 0x67; UBRR0H = 0x00; UCSR0B = 0x18; }
unsigned char usart_receive(void) { while(!(UCSR0A & (1<<RXC0))); return UDR0; }
void usart_transmit0(unsigned char data) { while(!(UCSR0A & (1<<UDRE0))); UDR0 = data;
}
int main(void) { int i,j =0;
usart_init(); while(1) { DDRD = 0b10000000; usart_transmit0(0x02);
if (usart_receive||'1') { PORTD |= (1<<PD7); } else { PORTD &= ~(1<<PD7); }
} }
w przypadku wyslania na rs232 wartosci 1 powinna szgasnac dioda a tu ciagle swieci. Jak ktos jest w stanie pomuc to thx:)