Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner