[Icc-avr] Reading fuses on Mega168

Johan Wallström johan at edab.nu
Tue Apr 29 01:52:42 PDT 2008



Notice how the calls are slightly different, in the first one you have a 
1 instead of a 0

;   dbg[0] = readfusesbyte(0x57,0x0001);
    ldi R18,1
    ldi R19,0

The above loads 0x0001...

    ldi R16,87
    ldi R17,0

The above loads 0x57

where as passing the value SPMCSR results in this:

;   dbg[1] = readfusesbyte(SPMCSR,0x0000);
    clr R18
    clr R19

The above loads 0x0000 (by clearing the registers)

    in R16,0x37
    clr R17

The above loads what 0x57 POINTS TO, and clears the upper byte to 
prepare for the function call





More information about the Icc-avr mailing list