Ребята, у меня какая то фигня, не соображу, нужно перекомпилить проект из меги 16 под мегу 128, переделал мейк файл, подключил вроде все, при компиляции ругается вот так:
main.c:300: error: 'UBRRH' undeclared (first use in this function)
main.c:300: error: (Each undeclared identifier is reported only once
main.c:300: error: for each function it appears in.)
main.c:301: error: 'UBRRL' undeclared (first use in this function)
main.c:308: error: 'UCSRC' undeclared (first use in this function)
main.c:310: error: 'UCSRB' undeclared (first use in this function)
main.c:311: error: 'UDR' undeclared (first use in this function)
Вот кусок программы где он не понимает эти имена:
// Initiate RS232
// USART Baud rate: 9600
UBRRH = MYUBRR >> 8;
UBRRL = MYUBRR;
// UCSR0C - USART control register
// bit 7-6 sync/ascyn 00 = async, 01 = sync
// bit 5-4 parity 00 = disabled
// bit 3 stop bits 0 = 1 bit 1 = 2 bits
// bit 2-1 frame length 11 = 8
// bit 0 clock polarity = 0
UCSRC = 0b10000110;
// Enable RS232, tx and rx
UCSRB = (1<<RXEN)|(1<<TXEN);
UDR = 0x00; // send an empty byte to indicate powerup.
как я понимаю что то неполучается с уартом, может потому что на меге 128 их как бы два и я неправильно указываю их название?
main.c:300: error: 'UBRRH' undeclared (first use in this function)
main.c:300: error: (Each undeclared identifier is reported only once
main.c:300: error: for each function it appears in.)
main.c:301: error: 'UBRRL' undeclared (first use in this function)
main.c:308: error: 'UCSRC' undeclared (first use in this function)
main.c:310: error: 'UCSRB' undeclared (first use in this function)
main.c:311: error: 'UDR' undeclared (first use in this function)
Вот кусок программы где он не понимает эти имена:
// Initiate RS232
// USART Baud rate: 9600
UBRRH = MYUBRR >> 8;
UBRRL = MYUBRR;
// UCSR0C - USART control register
// bit 7-6 sync/ascyn 00 = async, 01 = sync
// bit 5-4 parity 00 = disabled
// bit 3 stop bits 0 = 1 bit 1 = 2 bits
// bit 2-1 frame length 11 = 8
// bit 0 clock polarity = 0
UCSRC = 0b10000110;
// Enable RS232, tx and rx
UCSRB = (1<<RXEN)|(1<<TXEN);
UDR = 0x00; // send an empty byte to indicate powerup.
как я понимаю что то неполучается с уартом, может потому что на меге 128 их как бы два и я неправильно указываю их название?
