Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] WinAVR / GCC question re Stack

2009-03-24 by David Kelly

On Tue, Mar 24, 2009 at 12:40:32PM -0400, David VanHorn wrote:
> How can I assign a variable to a specific point in SRAM?

Declare a pointer and set its value to the address you want to read.

Study the AVR register definitions for syntax to use so that your
pointer doesn't consume RAM for storing the address of your point of
interest. 

In avr/sfr_defs.h we find this which should tell you how to do it:

#define _MMIO_BYTE(mem_addr) (*(volatile uint8_t *)(mem_addr))

-- 
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.