uisp-dev
[Top][All Lists]
Advanced

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

Re: [Uisp-dev] Two minor STK500 bugfixes


From: Theodore A. Roth
Subject: Re: [Uisp-dev] Two minor STK500 bugfixes
Date: Sat, 7 Feb 2004 09:42:53 -0800 (PST)

On Sat, 31 Jan 2004, Terran Melconian wrote:

Sorry for the late response, your message almost got lost in my inbox. :-(

> One fixes logic error in the board oscillator setup which I submitted
> previously. 

Sorry, I lost that message.

I'll commit this one later today so I can have a look at it with the 
osciloscope at work to verify it. It looks sounds though.

> -          if (p > 1)
> -              sc=0xff;
> -          else
> -              sc=(int)(8000000/setfreq) - 1;
> +          sc = 8000000/setfreq-1 > 0xff ? 0xff : (int)(8000000/setfreq)-1;

This is what I'll commit (not a big fan of the x?y:z construct):

@@ -890,7 +890,7 @@ TStk500::TStk500() {

           setfreq=clockbase/clockscale[p]/(n+1.0);

-          if (p > 1)
+          if (8000000/setfreq-1 > 0xff)
               sc=0xff;
           else
               sc=(int)(8000000/setfreq) - 1;

> The other is a fix for reading the oscillator calibration
> byte - I don't properly understand it, but I stole the magic number
> from avrdude (the other programmer I use), and it works.

The magic number comes from the SPI programming command list in the device
datasheets. I verified it with the mega128 datasheet and now works on that
device too. Probably was a typo on my part that didn't get caught until now.

Thanks for fixing it. This part has been committed.

Ted Roth





reply via email to

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