View previous topic :: View next topic |
Author |
Message |
TSEYFARTH
Joined: 01 Jul 2006 Posts: 1054
|
Posted: Thu Nov 01, 2012 12:32 am Post subject: AVR Studio 6 bricks M88/168 uC? |
|
|
Hello all,
I have a new problem not sure what it is.... On a new revision to a board (two samples), I have tried both M168 and M88's. The USB programmer sees the uC in every case. However, as soon as I clicl Program for the Fuses (16Mhz xternal xtal, CHKDIV8 (OFF), BODLEVEL 4.7, SPI ON - the app tells me that it could not finish, and then that it cannot enter programming mode. This has happened with 3 different chips.
The power looks good at 5.1V, Osc (16Mhz crystal with 15pF caps) looks good on the scope too.
Does anyone know why this is?
Thanks
Tim |
|
Back to top |
|
|
TSEYFARTH
Joined: 01 Jul 2006 Posts: 1054
|
Posted: Thu Nov 01, 2012 1:27 am Post subject: |
|
|
Found it!
The caps on the crystal appear to have messing with the crystal. Not all of the time however. I removed them, and the uC works and is not a brick.
Tim |
|
Back to top |
|
|
hgrueneis
Joined: 04 Apr 2009 Posts: 902 Location: A-4786 Brunnenthal
|
Posted: Fri Nov 02, 2012 4:08 am Post subject: |
|
|
That's why I mostly use oscillators now whenever there is enough room, instead of crystals.
Now it takes less room on the board with smd oscillators. With sizes of less than 3mm it is no problem for low voltages.
Hubert |
|
Back to top |
|
|
TSEYFARTH
Joined: 01 Jul 2006 Posts: 1054
|
Posted: Fri Nov 02, 2012 4:27 am Post subject: |
|
|
Hi Hubert,
Thanks for the recommend. I was wondering what the cost is on these and any other issues that you have seen arise by using an osc Vs a crystal.
Thanks
Tim |
|
Back to top |
|
|
hgrueneis
Joined: 04 Apr 2009 Posts: 902 Location: A-4786 Brunnenthal
|
Posted: Fri Nov 02, 2012 3:31 pm Post subject: |
|
|
As mentioned previously, with crystals I had nothing but continuous trouble....too many differences even with the same type.
So far I have only managed to kill one SMD osc. ....it was a 3.3V but I applied 5V. You might say that it was a stupid mistake. Other than that , there was one 24MHz half can that was DOA. The advantage of the oscillators is that they can be tested before soldering and if they are OK then you can be sure that the MCU starts.
The cost is usually between $2 and $6. Like mentioned above, you have to determine first for what VCC it is meant to be. Also look at the frequency stability if you have tight tolerances for communication.
An other advantage is for example. More than one MCU can run off one clock source without the use of the MCU clock output. With the addition of gates, the MCU can switch to different clocks (useful if it is an Atmega master with lots of different slave communication).
One disadvantage is the current consumption of the oscillators.
Most of them use more power than the MCU.
For a battery unit that has to run for years I would stich with the internal oscillator and/or a clock crystal (32K).
Hope this helps a bit.
Hubert |
|
Back to top |
|
|
TSEYFARTH
Joined: 01 Jul 2006 Posts: 1054
|
Posted: Fri Nov 02, 2012 4:41 pm Post subject: |
|
|
Hi Hubert,
Thanks again for the feedback. The part is a bit on the pricey side, unless tight tolerance is necessary. I pay about $0.18 for xtal, so >$2.00 is quite a jump.
Quote: | An other advantage is for example. More than one MCU can run off one clock source without the use of the MCU clock output. With the addition of gates, the MCU can switch to different clocks (useful if it is an Atmega master with lots of different slave communication). |
This is interesting however. Also, to be sure I am understanding the above correctly, it appears the same oscillator device can provide a reference freq for several MCUs simultaneously. Is that correct? Also, I did not know it was possible to change the reference frequency on the fly - in code. How do you do that?
Thanks again Hubert.
Tim |
|
Back to top |
|
|
hgrueneis
Joined: 04 Apr 2009 Posts: 902 Location: A-4786 Brunnenthal
|
Posted: Sat Nov 03, 2012 3:10 am Post subject: |
|
|
The output of the oscillators usually can support several ttl loads. Have used it for boards with two M168s. Never had a problem with that. The clock is also in sync. The other advantage is, that you can use XTAL2 for other functions, so you gain one pin.
The change clock with an output pin has one advantage when there are a lot of different com ports or spi with different speeds where you can not change the slave speed but can not generate the correct bitrate with the maximum clock wanted.
This can be switched different ways but you have to make sure that the crystal frequency matches your main setting, everything else you have to calculate yourself on the second clock.
You also have to switch the gates or analog switches so that you start out correctly after a reset. Will also require external pull up/down resistor because of tristate output pins during reset.
It is not meant to be for every application but in some cases it helps to solve a problem with communication if for the rest of the time max. speed or overclocking is required.
For example the M168 runs on max. 20 MHz at 5V(new datasheets). Running it at 24MHz has never caused a problem for me. I often used that because XMEGA was still too unreliable and had too many problems.
I have to be fair and mention that I do not use internal eeprom, instead I use Fram because of the virtually unlimited reprogramability and no wait writes at any AVR frequency (a lot faster).
If doing commercial products then you should really stick to the datasheets.
For me it is a matter of functionality. If I have to spend half a day because a couple of boards are not working with an unmatched crystal, then I rather spend a bit more and have it work right and dependable.
Hope this clears up some...or makes it more difficult to decide what to do.
HUbert |
|
Back to top |
|
|
|