Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

External memory

Posted by Nobody/Anonymous on August 9, 2005
I am working with an ATmega128 chip that has 64KB external memory. I would like to be able to configure the program to use some of this memory. Any ideas on how to access that memory and use it?

Also, I want to be able to access only one pin instead of the whole port. I have used DDRB to set the direction of a port and PORTx to set a port. I see there is a definition for PINx, and there are some #defines in the following manner -

#define PINB7 7

If I have PINB = 0 in my code, then I come up with no errors, but this does not specify a pin. If I have PINB7 in my code, then I come up with error messages.

How do I specify which pin I want?

Thanks for any and all help. It is always much appreciated.

- Josh

RE: External memory

Posted by Nobody/Anonymous on August 10, 2005
These are really questions for the compiler and linker, rather than FreeRTOS.

You don't say which compiler you are using. If you want to use the external memory you will have to enable the memory bus in the startup code, set the wait states (if any) and set the linker script so that it knows about the memory and what to put there (eg read only for program code, read/write for RAM etc.). How all this is done depends on the compiler. If you are using GCC then take a look at the linker script and boot code to see what it is doing now.

It looks like the PINB7 definition is intended for use with the PORTx definition. As in PORTx &= ~PINB7 to clear the bit, and PORTX |= PINB7 to set the bit. I don't know enough about the AVR to know if there instructions to set and clear specific bits, rather than using byte access in this way. I suspect there will be.

RE: External memory

Posted by Nobody/Anonymous on August 10, 2005
I am using GCC with the WinAVR environment. Thanks for the help.

After I wrote this, I was told by somebody else that my memory question was probably more related to WinAVR.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists