Reading register in "Production Signature Row"

General discussion on mikroPascal PRO for AVR.
Post Reply
Author
Message
DragosP
Posts: 19
Joined: 24 Mar 2011 07:05
Location: Braila, Romania
Contact:

Reading register in "Production Signature Row"

#1 Post by DragosP » 01 Apr 2011 13:34

I think the subject is concludent.
How do we read any register from "Production Signature Row" for a XMega128A1 using mikroPascal PRO for AVR?
126296 linux user

DragosP
Posts: 19
Joined: 24 Mar 2011 07:05
Location: Braila, Romania
Contact:

Re: Reading register in "Production Signature Row"

#2 Post by DragosP » 01 Apr 2011 17:10

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

corado
Posts: 401
Joined: 28 Mar 2009 11:03

Re: Reading register in "Production Signature Row"

#3 Post by corado » 09 Apr 2014 21:16

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..

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: Reading register in "Production Signature Row"

#4 Post by dejan.odabasic » 10 Apr 2014 13:16

Hello,

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.
Best regards.

corado
Posts: 401
Joined: 28 Mar 2009 11:03

Re: Reading register in "Production Signature Row"

#5 Post by corado » 10 Apr 2014 13:32

ah,, ok, no, I try this again later.
But can you help me, and say, how this in Pascal looks like?

corado
Posts: 401
Joined: 28 Mar 2009 11:03

Re: Reading register in "Production Signature Row"

#6 Post by corado » 10 Apr 2014 14:55

it doesn't work..
If I do this, the System hangs up :-(

Post Reply

Return to “mikroPascal PRO for AVR General”