[McHUG] Not Success, but Interesting

Rich Mitchell geobra at att.net
Fri Mar 21 08:00:49 EST 2008


Yesterday I took some USART code from my new book, which is based on a different compiler (IAR rather than AVR-GCC I think) and tried to port it over to the ATmega168 and ATmega169.  It ported easily with some changes to the 169, but would not compile for the 168.  The sticking points were:
data register (actually 2) UDR
control and status registers UCSRA, UCSRB
and baud rate registers UBRRH, UBRRL
These are what the registers are called in the data sheets, the book and ATmega169 io headers.  But the ATmega168 io headers call them UDR0, UCSR0A, UCSR0B, UBRR0H, UBRR0L.  Now if you look at Joe Pardue's book for the ATmega169 he also used register names with 0 in them.  So what I think is happening is that the register names with 0 in them are AVR-GCC's old naming convention (which may indeed be a convention that Atmel used in the past).  Now they are updating to match the new names.  The 169 io header file has been updated, but not the 168.
Now they load fine but still need to work to get them to run correctly.

Pete, I have not yet built my Si570 board.  Was looking at it last night and will have some questions for tonight.

CU all tonight at Stables - 6:30  Ask for Mitchell table - there will be another ham group there also.

Rich, N3III

--
McHUG - Physical Computing ;) 
MicroController Ham User Group


More information about the McHUG mailing list