Cannot connect to AVR using 128KHz Int. Osc.

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Using a ATmega88PA I changed it from the Internal Calibrated RC Oscillator to the 128KHz Internal Oscillator by changing the CKSEL3..0 bits in the LFuse from 62 to 63.

Now the clock is running much slower, this can be determined because the LED blink rate has slowed quite a bit. However, now I cannot get into it to program the chip. It is running on an STK500 via a USB port. I also cannot get access to the programming mode via AVRDUDE using the terminal mode which is how I changed the LFuse bits.

Any ideas on how to access this chip? Have looked at parallel programming but if there is a easier way please let me know.

I know just enough to be dangerous,
Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you checked that the ISP clock frequency is not larger than 1/4th of the target clock frequency?

If you're using internal 128 kHz oscillator, the ISP clock frequency must be less than 32 kHz

/Jakob Selbing

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AVR clock need to be 4 times faster than ISP clock.
So you need to change ISP clock in Studio.
Note that you probably need to click "write" tab in the pop-up window to make the change take effect.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
It is running on an STK500 via a USB port.

I presume the mega88 is physically in the SCKT3200A2 socket. The STK500 CTRL port is connected wih a USB->RS232 cable.

Select ISP clock of 4kHz (or less) in Studio. (128kHz / 4 / CKDIV8 fuse)

Program sensible fuse setting. Principally, remove CKDIV8. You can set the clock division in software. 128kHz / 256 is pretty slow (500Hz). Even 8MHz /256 is pretty slow (31kHz)

As a general rule, you are probably better off with running at high speed and sleeping for a long time.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I knew about the 4 to 1 clock speed. The last time I tried to use AVR Studio I couldn't get it to connect to the STK500 via a USB port. Like most of us I have no serial port but a USB to Serial Adapter. Using Linux Ubuntu that works fine.

I did go and try Windows and AVR Studio and it worked.

I tried to compile and program the m88pa but telling it to Build done nothing. Why would Studio refuse to Build a C program?

Is there a way to get AVRDUDE to slow down in the programming?

Thanks for your help,
Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Reading the avrdude manual would show you how to set the ISP clock speed.

It is wise to set the Vtarget to a sensible value on the STK500. Likewise the STK500 programmable clock.

With any 'make' you need to do a 'make clean' to force a new Build.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

David,

I ask for some help, not wise ass criticism. I have read the manual, looked through it several times and I don't remember seeing anywhere that AVRDude has a method of changing the speed of how fast it sends programming info to the chip being programmed. Its obvious you don't know, you just want to put people down.

The world needs fewer people like you!

Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brewski wrote:
David,

I ask for some help, not wise ass criticism. I have read the manual, looked through it several times and I don't remember seeing anywhere that AVRDude has a method of changing the speed of how fast it sends programming info to the chip being programmed. Its obvious you don't know, you just want to put people down.

The world needs fewer people like you!

Mike

Wow. Full disclosure: I'm not a 'Dude person. But as it seems to be the end-all around here for ISP, how could it possibly be so if it couldn't configure ISP bit rate? Similarly, how could it be so wildly acclaimed without at least a serviceable manual?

So I do a
http://www.lmgtfy.com/?q=avrdude...
to see what all the hoo-rah is about. The first hit is the Linux man page:

Quote:
Specify the bit clock period for the JTAG interface or the ISP clock...

The fourth hit is the same manual from the GCC collection, it appears.
The surrounding hits on the same page of results are the same question/answer.

What parts of the manual did you examine?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think Brewski mus be wearing special glasses or something? I've read and re-read the helpful post that David made and cannot for the life of me spot the point where "you just want to put people down".

If he responds like that to someone who's just trying to help (as reading any of his former helpful posts would also illustrate) I wonder how he'd react to Arnold or MBedder? :lol:

Moderator.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Going to the link you provided, I remember seeing that in, I believe, the terminal programming section of the AVRDude doc. That was when I was doing the dastardly deed of changing the lfuse to use the 128K internal clock instead of the internal 8m clock.

This is the stuff that happens to you when you have had chemotherapy treatment. You can remember a lot of stuff but you also forget a lot of stuff too. Then there is the problem, at least for me, of connecting the all dots. On the brighter side I have the tendency of FORGETTING "those that have trespassed against me".

Thanks for the help,
Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mike,

Type 'avrdude' by itself. You get a quick reminder of the options. 4kHz will be a period of 250us (-B250). 1kHz would be -B1000

Google for 'avrdude manual' will probably get a fuller explanation.

Remember that your AVR sitting in a STK500 needs to have Vtarget of 5V or so.
Likewise if you set external crystal or external clock, you will rely on what the STK500 is providing. 3.684MHz is fine.

I am sorry if my replies were unhelpful. Chemotherapy will hit you harder than any original disease. Judging by my sister's (and father's) experience, it is worse than radiotherapy. At least you have got a timetable to work by --- the last treatment is something to look forward to!

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

David,
I apologize for going off on you. I have seen many folks that have ask for help on here. Some deserve to be brushed off, to "read the manual". Others have no idea where to look or start or whatever. They are lost.

When the only chip of that flavor you have in stock and you have sent it to "never never land". You have tried all the magic ya know and today magic is not working, HELP.

I could see the processor was working, much slower than before but working, so the change to 128K worked, but now nothing else works. I had forgotten seeing that in the manual earlier that evening. That is not the info I was after at the time. Later on, deep in the 'Oh crap' mode, well I didn't connect that dot.

A few months ago my netbook system board went south and the new one I didn't think I had gotten Studio to work on it. I mostly is Ubuntu. Only use Windoze when I have to so didn't even try that. After someone's post above I tried Studio. I knew exactly where to set the com freq there. Did it and the Mega88 started paying attention attention.

So now I'm back pounding code.

Thanks to you and all the folks that have helped me out here and over the years. I apologize for my abrasiveness.

Oh, my Chemo and radiation ended in the middle of March. The operation to remove my left tonsil got rid of the source of the cancer but cancer had collected in my left saliva gland and it was about the size of the last joint in your thumb. Fortunately the Chemo and radiation shrink and killed it all I didnot need a massive operation on my gland. Actually the cancer was a blessing. I needed to loose about 80 lbs. I have been trying to loose it for years and failed. I'm 64 and that weight is going to start to affect my knees, and that did it. But I don't recommend it!

Again I apologize and thanks guys,
Mike