Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: vidam on March 16, 2008, 04:07:47 PM

Title: Bricked my Robostix; How to make external clock?
Post by: vidam on March 16, 2008, 04:07:47 PM
I bricked my robostix when I was setting the fuses.

I have to apply an external clock to pin 24 on the ATmega128 and choose external crystal in order to unbrick it.

Can anyone give me advise on how to make an external clock? I've never done this before in my life.

I already posted the question to the gumstix forum. http://docwiki.gumstix.org/Robostix_fuses

Thanks,
Title: Re: Bricked my Robostix; How to make external clock?
Post by: Asellith on March 16, 2008, 07:22:55 PM
What clock speed do you need? Easy way is to get a resistor and capacitor network together and make an oscillator. Better way is to use a crystal but that probobly not the best option for you. I am assuming that this needs to be done only once. I'll look up the equations to calculate later unless someone beats me to it.
Title: Re: Bricked my Robostix; How to make external clock?
Post by: vidam on March 16, 2008, 07:37:23 PM
What clock speed do you need? Easy way is to get a resistor and capacitor network together and make an oscillator. Better way is to use a crystal but that probobly not the best option for you. I am assuming that this needs to be done only once. I'll look up the equations to calculate later unless someone beats me to it.

The AtMega 128 MCU operates between 0-16 MHz if that is what you need to know. I can check at work to see if we have any crystals available. I will need a 16 MHZ external crystal. The direction say to connect the clock to pin 24. I hope that is as simple as they state.

I was reading this manual by AVRFreaks http://www.avrfreaks.net/modules/FreaksArticles/files/21/Why%20you%20need%20a%20Clock%20Source.pdf

On page 6 says, "Get a TTL or CMOS level oscillator signal and apply it to XTAL1 (pin 24).  And try different sources of oscillators to get it reprogrammed.

I found some crystal oscillators with TTL and CMOS logic outputs that might work.

http://roson.manufacturer.globalsources.com/si/6008825644803/pdtl/Crystal-oscillator/1004827646/Crystal-Oscillator.htm

Hopefully we have these at work.
Title: Re: Bricked my Robostix; How to make external clock?
Post by: Asellith on March 16, 2008, 09:49:09 PM
Do you have a function generator at home or work? You could just set a square wave ttl level signal at 16 MHZ into the clock pin and that should work just as well. Crystals usually need capacitors on them as well. Unless you get an oscillator. The cap values depend on the crystal my experience has been around 40 pf in parallel usually works good.
Title: Re: Bricked my Robostix; How to make external clock?
Post by: frank26080115 on March 16, 2008, 10:04:15 PM
you can always get another microcontroller to output a continuous square wave, but you need to lower the bit rate on your programmer
Title: Re: Bricked my Robostix; How to make external clock?
Post by: vidam on March 17, 2008, 05:29:02 AM
Yeh I can get a function generator at work to generate a 16MHz continuous pulse at 5 Volts amplitude. I have to download AVR Studio to my desktop, move the function generator and the robostix near it, so I can also change the fuse setting while the pulse is being sent to the pin. It's a lot of trouble, but I guess that is the best option for me. I do have another microcontroller, but the first way is quicker at this point because that is where i spend most of my time during the week. Thanks for the tips.
Title: Re: Bricked my Robostix; How to make external clock?
Post by: vidam on March 22, 2008, 04:09:58 PM
I used an oscillator SG51P and applied a 4.5 V amplitude to the input, and to OE (output enable). This went to pin 24 on the At mega 128 and gnd were tied through to pin 22 from the SG51P. I was still unable to change the fuse setting. The error said it was unable or failed to enter programming mode. I guess I killed the clock awhile ago. I will probably need to buy another micro-controller.

I will try to save the board by desoldering the atmega and replacing it on the board.



Title: Re: Bricked my Robostix; How to make external clock?
Post by: vidam on March 31, 2008, 01:33:44 PM
I replaced the mega128 with the mega1651 on my Robostix. Reprogammed the fuses and success felt good; The fuses were set as the Robostix was able to enter programming mode and verify it. I'm back in business again.
Title: Re: Bricked my Robostix; How to make external clock?
Post by: superchiku on March 31, 2008, 01:44:27 PM
hey vidam,

u really took a long way to get the right thing,

crystals would have worked fine with ur microcontroller u just needed to connect 2 capacitors most probably 33 pf between the leads of the crystal and then to ground

ALSO why didnt u try using the internal clock u could have saved time and money then  ;D
Title: Re: Bricked my Robostix; How to make external clock?
Post by: vidam on March 31, 2008, 01:47:53 PM
You didn't read my previous post.

My previous post explains that I did try an external clock.

The results were the same. The microcontroller failed to enter programming mode. This means that I must have killed the clock.

So I had to replace the chip or scrap the old board.

Luckily a guy at work had some extra 128L and 1651 atmega's at home.

I also had to use specialized equipment at work to remove the broken 128 chip. A guy at work showed me how the machine works. It was pretty neat learning experience for me.

I have a full-time job and I am under no pressure to get this stuff done yesterday.

 
Title: Re: Bricked my Robostix; How to make external clock?
Post by: superchiku on March 31, 2008, 01:51:20 PM
u didnt killed the clock, u just messed up the fuse bits, atmega128 has a lots of fusebits to be changed for proper implementation.

if u do one mistake with fuse bits and u dont know the initial configuration, then ur mcu will be gone ,just keep a check on that on ur further projects and what kinda job u were talking abt??
Title: Re: Bricked my Robostix; How to make external clock?
Post by: vidam on March 31, 2008, 01:55:29 PM
Is your post trying to be helpful?

Because I don't think this provides any added benefit except maybe to criticize.

in hindsight it is easy to criticize people for how they do things.

Also are you asking me what type of job I'm doing?

that isn't useful information for this post.

 


Title: Re: Bricked my Robostix; How to make external clock?
Post by: superchiku on March 31, 2008, 02:13:09 PM
sorry man for that, i wasnt criicizing , i was just saying what u must have done, sorry again for making u feel bad  and abt the job i thought u were talking abt something else so my bad..
Title: Re: Bricked my Robostix; How to make external clock?
Post by: vidam on March 31, 2008, 02:16:27 PM
Well it is hard to interpret people's writing styles and understand their intentions.

 I don't know about other people, but this is the second time I have misunderstood someone's post including yours.



Title: Re: Bricked my Robostix; How to make external clock?
Post by: superchiku on March 31, 2008, 02:25:50 PM
hey it happens man dont take it too hard on urself, be cool , and my advice bfore changing fusebits u must be 300 % sure what u are doing otherwise say ur mcu bye bye.
Title: Re: Bricked my Robostix; How to make external clock?
Post by: vidam on March 31, 2008, 02:29:48 PM
Yeah, got it. I think I learned my lesson about setting fuses right. so I posted the question on gumstix newsgroup and this is a partial response:

"You should look at the datasheet and compare what you see in
AVR-Studio with the datasheet. Each and every fuse setting in AVR
Studio is documented in the datasheet."

So  I am going to read the datasheet front to back and set the fuses right for 1651mega chip.
Title: Re: Bricked my Robostix; How to make external clock?
Post by: superchiku on March 31, 2008, 02:32:10 PM
yes do that that'll help a lot and always take a snapshot of what ur initial fuses were so that u can change them if u make any mistake
Title: Re: Bricked my Robostix; How to make external clock?
Post by: Admin on April 06, 2008, 12:31:00 PM
hey superchiku . . .

ive mentioned this to you before but:
check your spelling
check your grammar
don't post unless you truely have something useful to say
don't post with a repeat of other posts

 ;)
Title: Re: Bricked my Robostix; How to make external clock?
Post by: superchiku on April 06, 2008, 12:34:59 PM
iam not being harsh admin but where did i commit my mistake this time , do u think iam dumb or something...