Society of Robots - Robot Forum
Software => Software => Topic started by: Kirk on June 26, 2010, 09:59:05 PM
-
Greetings,
It seems that Procyon AVRlib is dieing. (the last update I found was 2006) Has anyone updated the uart.c for the ATmega328. I am upgrading from the ATmega8 to the 328.
There are some great utilities in this bit of code. I hope it lives on.
Thanks
Kirk
-
Well I have a partial solution.
after line 107
in uart.h add
defined(__AVR_ATmega328P__) || \
This compiles but I am getting a warning that I will be sorting out soon
Kirk
-
You could use WebbotLib ;)
-
Well I did download it an look at it. It would require a near total rewrite of my bot's code :-(
Kirk
-
If you are coming from an ATMega8 then your code won't be that big/complex.
If you PM me the existing code then I reckon I could re-write it for WebbotLib and the ATMega328 fairly quickly (if its reasonably documented)
Once done then your code will become very portable across different processors and sensors.
Let me know if you are interested.
-
I definitely recommend WebbotLib over AVRLib. It took me less than a day to convert my entire ERP code to it.
Its like using a round wheel vs a square wheel for your car . . .
-
Well I have a partial solution.
after line 107
in uart.h add
defined(__AVR_ATmega328P__) || \
This compiles but I am getting a warning that I will be sorting out soon
Kirk
Instead of adding the above (defined(__AVR_ATmega328P__) || \), insert this at line 23 of uart.h:
#if defined(__AVR_ATmega328P__)
#define UDR UDR0
#define UCR UCSR0B
#define RXCIE RXCIE0
#define TXCIE TXCIE0
#define RXC RXC0
#define TXC TXC0
#define RXEN RXEN0
#define TXEN TXEN0
#define UBRRL UBRR0L
#define UBRRH UBRR0H
#define SIG_UART_TRANS USART_TX_vect
#define SIG_UART_RECV USART_RX_vect
#define SIG_UART_DATA SIG_USART_DATA
#endif
That should clear up the warnings, haven't tested it on hardware though.