Forum: Mikrocontroller und Digitale Elektronik Fleury Lib mit ATMega1284P


von Pete K. (pete77)


Lesenswert?

Hat jemand zufällig die uart Fleury Lib für den ATMega1284P portiert?
Ich würde mich freuen, wenn das hier jemand uploaden könnte. Ich habe 
mit einen RS232 Adapter gebaut, aber es funktioniert nicht. Möchte gerne 
die Software als Fehlerquelle ausschließen...

Besten Dank!

von Pete K. (pete77)


Lesenswert?

Eine Portierung für den 644P tut es auch.

von Pete K. (pete77)


Lesenswert?

Habe folgendes gefunden und hänge das hier mal als Antwort rein:

****
So as me you ended up here because you want to use the UART of an ATmega 
1284p with Peter Fleury lib and you get compile errors or crashe when 
transmitting ?
The fix is quite simple, strangely the headers from WinAVR are different 
from the 644 family and the 1284.
The lib is not working as is because of missing specific constants and 
macros.

In uart.c, just above
#else
 #error "no UART definition for MCU available"

Add the 1284p specific uart definitions :

#elif defined(_AVR_ATmega1284P_)
 /* ATmega with two USART */
 #define ATMEGA_USART0
 #define ATMEGA_USART1
 #define UART0_RECEIVE_INTERRUPT   USART0_RX_vect
 #define UART1_RECEIVE_INTERRUPT   USART1_RX_vect
 #define UART0_TRANSMIT_INTERRUPT  USART0_UDRE_vect
 #define UART1_TRANSMIT_INTERRUPT  USART1_UDRE_vect
 #define UART0_STATUS   UCSR0A
 #define UART0_CONTROL  UCSR0B
 #define UART0_DATA     UDR0
 #define UART0_UDRIE    UDRIE0
 #define UART1_STATUS   UCSR1A
 #define UART1_CONTROL  UCSR1B
 #define UART1_DATA     UDR1
 #define UART1_UDRIE    UDRIE1

Note that the interrupt names have changed from the 164p, 324p and 644p 
just above in the code, so just adding a "|defined(_AVR_ATmega644P_)" 
won't work.
****

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.