FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [October 2008 Threads] How to make demo work on AVR Atmega128Posted by voidlizard on October 23, 2008 Greetings,
Did anybody make the FreeRTOS Demo for on Atmega128 ?
I have the following installation:
AVR_ATMega232_WinAVR demo to use STK500/STK501 board
Linux AVR toolchain: avr-gcc, avrdude, etc.
I have patched the demo to compile for atmega128: some changes to use UART0 in demo's sources, makefile to use proper platform.
So the demo is compiled and programmed OK (but with a strange PORTB LEDs blinking during the programming) and that's all. No LED blinking, no port output.
If I try to make and program minimalistic application which blinks LED inside a cycle with linked FreeRTOS sources - it also does not work - just setup DDRB and PORTB outside the main loop (LEDs works as expexted) and it's does not nothing in main loop (may be something is wrong with delays or so. Although it worked OK without FreeRTOS)
Sorry if it's a silly question, but I kind a noob in embedded programming.
So could anybody point me on a minimal FreeRTOS/Atmega128 GCC example that works?
Thank you for any help,
-- Dmitry
RE: How to make demo work on AVR Atmega128Posted by maor on February 11, 2009 I'm having the same problem on Atmega644....
RE: How to make demo work on AVR Atmega128Posted by maor on February 11, 2009 for start, check this topic -" Using the ATmega323 port for ATmega8515" on this forum. now leds [1:3] blinks but there still a problem (led 5 & 7 doesn't blinks)
RE: How to make demo work on AVR Atmega128Posted by Mik Lamming on February 23, 2009 I've managed to get the leds to flash on the AT128, but still struggling with the serial port. Has anyone cracked this yet?
RE: How to make demo work on AVR Atmega128Posted by Mik Lamming on February 24, 2009 I figured out how to port the FreeRTOS demo to the ATMega128. Happy to share if anyone is still wondering how to do it.
RE: How to make demo work on AVR Atmega128Posted by circlemtn on February 24, 2009 Thanks, I'm just starting down this road, needing the Atmega128 on Frtos - and would love to know what you've found.
RE: How to make demo work on AVR Atmega128Posted by Mik Lamming on February 25, 2009 Here's what I did to get the FreeRTOS demo running on my atmega128 system.
The LEDs on my hardware are on port C, so I had to make 4 single-character changes to ParTest.c. They are so obvious that I'll skip them.
I changed my tick speed. Not sure if it matters for the demo. So in FreeRTOSConfig.c: #define configCPU_CLOCK_HZ( ( unsigned portLONG ) 7372800 )
I think the atmega323 has only one usart, but the atmega128 has two. My hardware uses USART #1. So I made the following file-wide substitutions to usart.c UCSRB -> UCSR1B UCSRC -> USSR1C UBRRL -> UBRR1L UBRRH -> UBRR1H UDR -> UDR1 If you use usart#0 then (I think) you can probably change "1" -> "0" in the above, but best check!
To make things a little easier for me to understand, I changed the following constants to reference the constants defined by ATMEL in the header file iom128.h.
/* Constants for writing to UCSR1B. #define serRX_INT_ENABLE( ( unsigned portCHAR ) (1<<RXCIE1) ) #define serRX_ENABLE( ( unsigned portCHAR ) (1<<RXEN1) ) #define serTX_ENABLE( ( unsigned portCHAR ) (1<<TXEN1) ) #define serTX_INT_ENABLE( ( unsigned portCHAR ) (1<<UDRIE1) ) // Notice that this is NOT the TX interrupt!
/* Constants for writing to UCSR1C. */ #define serUCSRC_SELECT( ( unsigned portCHAR ) (1<<UCSZ00) )// MIK #define serEIGHT_DATA_BITS( ( unsigned portCHAR ) (1<<UCSZ01) )// MIK
Finally, note that the demo sends out a bunch of characters "A...X" and expects to receive the same chars back on the serial input, and records an error if it doesn't. (I wonder if the test code expects a loop-back link connecting pins 2 and 3? Does the documentation mentions that somewhere?) I connected my USART to my PC and fired up Hyperterminal to see what it did. (Settings: 38400, 8,N and no flow control). I typed "ABC..." and saw one of the leds toggle on/off with each input.
Hope that helps.
//Mik
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|