Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

AVR register from C program

Status
Not open for further replies.

Diamant

Newbie level 6
Joined
Oct 23, 2003
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
113
Im working with avr300.asm file from Atmel (software master I2C). Simply make it accessible for IAR AVR C. Conversion between Atmel assembler to IAR assembler was succesful.
The assembler program uses R16-R18 registers in my 2313 AVR chip to store variables.
I need to write and read these registers from my C program.
Is there a way to create pointers at R16-R18 registers in my C program?
may be there is another more simple way to achieve registers?

Thanks
 

revolt

Full Member level 2
Joined
Feb 3, 2002
Messages
121
Helped
4
Reputation
6
Reaction score
1
Trophy points
1,298
Activity points
1,008
Hi diamant,

i think the registers are located in the ram space.
so u can access them with pointer. Try this code:

void main(void)
{
char *p;
p=(char *)0x00;// Register 0
*p=10;
}
 

Diamant

Newbie level 6
Joined
Oct 23, 2003
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
113
revolt
Bingo, Thanks
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top