I think the subject is concludent.
How do we read any register from "Production Signature Row" for a XMega128A1 using mikroPascal PRO for AVR?
Reading register in "Production Signature Row"
Reading register in "Production Signature Row"
126296 linux user
Re: Reading register in "Production Signature Row"
The answer is quite simple, but needs some extra documentation. In my humble opinion, the original Atmel datasheet is poor.
Code: Select all
asm
ldi zl, 0x20 ;adress 0x20, ADCACAL0
clr zh
ldi R27, 2 ;command, read "Production signature row"
sts NVM_CMD+0, R27
lpm r27, z ;read in r27
sts _temp_lo+0, R27 ;store from r27
end;
126296 linux user
Re: Reading register in "Production Signature Row"
Hi,
this doesn'T work for me
It says _temp_lo isn't declared.....if I do this in VAR section it doesn't work too..
this doesn'T work for me
It says _temp_lo isn't declared.....if I do this in VAR section it doesn't work too..
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: Reading register in "Production Signature Row"
Hello,
Have you tried declaring a global variable temp_lo variable (without first underscore)?
Best regards.
Have you tried declaring a global variable temp_lo variable (without first underscore)?
Code: Select all
program MyProject;
var temp_lo : byte;
begin
asm
ldi zl, 0x20 ;adress 0x20, ADCACAL0
clr zh
ldi R27, 2 ;command, read "Production signature row"
sts NVM_CMD+0, R27
lpm r27, z ;read in r27
sts _temp_lo+0, R27 ;store from r27
end;
end.
Re: Reading register in "Production Signature Row"
ah,, ok, no, I try this again later.
But can you help me, and say, how this in Pascal looks like?
But can you help me, and say, how this in Pascal looks like?
Re: Reading register in "Production Signature Row"
it doesn't work..
If I do this, the System hangs up
If I do this, the System hangs up