Author Topic: Procyon AVRlib for ATmega328?  (Read 4445 times)

0 Members and 1 Guest are viewing this topic.

Offline KirkTopic starter

  • Jr. Member
  • **
  • Posts: 44
  • Helpful? 2
Procyon AVRlib for ATmega328?
« 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

Offline KirkTopic starter

  • Jr. Member
  • **
  • Posts: 44
  • Helpful? 2
Re: Procyon AVRlib for ATmega328?
« Reply #1 on: June 26, 2010, 11:09:55 PM »
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

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Procyon AVRlib for ATmega328?
« Reply #2 on: June 27, 2010, 06:54:49 AM »
You could use WebbotLib  ;)
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline KirkTopic starter

  • Jr. Member
  • **
  • Posts: 44
  • Helpful? 2
Re: Procyon AVRlib for ATmega328?
« Reply #3 on: June 27, 2010, 11:58:09 AM »
Well I did download it an look at it. It would require a near total rewrite of my bot's code :-(
Kirk

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Procyon AVRlib for ATmega328?
« Reply #4 on: June 27, 2010, 05:20:01 PM »
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.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,704
  • Helpful? 173
    • Society of Robots
Re: Procyon AVRlib for ATmega328?
« Reply #5 on: June 29, 2010, 04:49:17 PM »
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 . . .

Offline euchrid

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Procyon AVRlib for ATmega328?
« Reply #6 on: August 26, 2010, 01:28:34 PM »
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.

 

SMF spam blocked by CleanTalk