avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] Reading and writing a calibration byte in an ATTiny12


From: James A.R. Koehler
Subject: Re: [avrdude-dev] Reading and writing a calibration byte in an ATTiny12
Date: Fri, 07 Jul 2006 17:51:15 -0700
User-agent: Thunderbird 1.5 (X11/20051201)

As I understand it, the problem is that you have to read the calibration byte from a location in the signature address region of the ATTiny12 before you can write it anywhere.

Nick Lott wrote:
couldn't you do something like

OSCALBYTE=0x7F

do
echo write flash 0x3ff $OSCALBYTE | avrdude -p t12 -P /dev/whatever -c avrisp2 -t
    killall avrdude
    #..insert some script goodies here to wait for next processor
loop

WARNING: this probably won't work.

On 8/07/2006, at 1:23 AM, James A.R. Koehler wrote:

Hi,

I am programming an ATTiny12 and I have some code which sets the calibration byte into a flash location so that my program can then put it in the OSCAL register. In my program, the code looks like:

ldi r31, CALIBRATION_ADDRESS >> 8 /; calibration byte to be written to 0x3ff/
    ldi    r30, CALIBRATION_ADDRESS & 0xff
    lpm

    out    OSCCAL, r0

With Windows and Studio 4, it is then easy to read the calibration byte and to then write it to the CALIBRATION_ADDRESS which is location 0x3ff.

I'd prefer to do this using avrdude in a Linux machine. I think I should be able to do this in the 'terminal' mode of avrdude but, because I'd like to program a number of these processors in one session, I'd rather do it with a script file. Is this possible?

Also, I have a document describing avrdude 4.2 written by Brian Dean in September, 2003. Is there a more recent version of this very helpful document for the more recent versions of avrdude?

   Jim



_______________________________________________
avrdude-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avrdude-dev



_______________________________________________
avrdude-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avrdude-dev






reply via email to

[Prev in Thread] Current Thread [Next in Thread]