Fuse mishap - ext clock - how to feed in ext clock source?

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

Ok so I finally did it - I accidently programmed a M128's clock source fuses to 000 by mistake.

So now it expects an external clock source.

*JTAG fuses not set so that is out.

*M128 is soldered to a board so HV is out

What I've tried sofar:

The M128 is on a the ET-BASE board. I've desoldered the 16Mhz Xtal. I've taken the 22pf Cap off the board that was attached to the Xtal1 pin of the Mega128.

I then attached a wire from a Mega32 which was toggling a pin at ~1Mhz. I attached it to the Xtal1 pin of the Mega128.

I then tried programming the M128 - but it didn't work.

On my scope it doesn't appear that the Mega32 is driving the pin low enough.

So what am I doing wrong? Any Suggestions? (I've not done this before).

Thanks.

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

Did you set the programming frequency to less than 1/4 of your new clock frequency?

JC

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

And I assume they both share a common ground connection.

JC

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

Is there still a cap on the xtal2 pin? The oscillator is serving as a buffer amp in the external clock case, and if the cap on xtal2 is still there you have an unexpected load on the amp.

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

I would guess that there was no need to remove the xtal. Just provide a good GND and connect your Mega32 pin to XTAL1.

Double check that your Mega32 was providing a good signal. You should get a 5V swing quite happily from the Mega32 even at 1MHz. You could always drop to 100kHz, and reduce your ISP freq to 22kHz.

Personally, I am very critical of the ET-Base schematic. I cut the trace from PORTE.0 to the MAX232, and put a 1k resistor across. This means that your ISP programmer is not trying to fight a virtual short circuit. Which is why a STK500 will not program your board, and you are advised to use their special add-on.

David.

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

Quote:

I cut the trace from PORTE.0 to the MAX232, and put a 1k resistor across. This means that your ISP programmer is not trying to fight a virtual short circuit.

In my experience, I'd say that this is the "standard" way of addressing ISP on the Mega128-class of AVRs that have a transceiver or other UART device that would be driving RXD0. I haven't looked at the schematic in question, but that solution is certainly simpler than any "special add-on".

Lee

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

Lee,

I believe it was you that suggested the resistor. I would presume that the Mega324, Mega644 will have the same "feature" if the USART1 is used with a transceiver.

I like the ETT boards. Unfortunately they have some "features". I am surprised that they have not changed their PCB.

With luck, we should hear from Mr Dingo shortly, whether he has brought his Mega back to life.

David.

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

Quote:

I would presume that the Mega324, Mega644 will have the same "feature" if the USART1 is used with a transceiver.

I don't think so, as that series uses the SPI pins.

The consideration with the SPI-for-ISP models that have one or more SPI slave devices in the app (RTC, A/D, D/A, etc.) is to ensure that the slave devices are de-selected when the AVR is doing ISP and the AVR pins that would be doing the slave-selects are floating.

A weak pull-up or pull-down needs to be added on the slave's select line to keep it de-selected when the AVR pin is floating.

Lee

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 was thinking more in terms of ETT wiring MOSI / MISO directly to a MAX232 without a resistor.

Performing ISP is fine if any other devices are three-stated at the time. The MAX232 is not three-state-able (if that is a legal word)

David.

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

Quote:

I was thinking more in terms of ETT wiring MOSI / MISO directly to a MAX232 without a resistor.


Quote:

I would presume that the Mega324, Mega644 will have the same "feature" if the USART1 is used with a transceiver.

But USART1 doesn't share pin assignments with SPI on the '164 family. Why would a board be laid out with MISO/MOSI wired to an RS232 transceiver if the aren't UART pins?

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

Oops. I thought that the Mega644 had a second USART that shared the SPI pins.

Or does it just have a single USART and calls it USART0 ?

The Mega644P appears to have a USART0 and a USART1.

David.

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

Quote:

The Mega644P appears to have a USART0 and a USART1.

True. And on what pins do they "appear"? (pun intended). It ain't the SPI pins in my datasheet. (USART1 is right next to USART0 on INTn pins IIRC).

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.