(solved)Atmega 324p Ghost in the machine(Noob)

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

Built myself a little veroboard pcb(1st MCU pcb), but i've got a ghost in the machine.

Specs:
7805 1A with 100nf and electrolitic (16v/XXXXmf)
ATmega 324p
18.432Mhz crystal with 22pf capacitors(Fuses 1111 111)
Modified version of Peter Fleury's STK500v2Bootloader(added 324p and changed Crystal frequency)
Jtag, clkdiv8 disabled, 512 Blocksize etc as stated in Bootloader doc.
100nf over vcc and gnd, all power/gnd pins connected, 100nf over vref.
Isp connector, reset button.
External pullup on reset line.

Only the bootloader is installed, and if i pul a pin low(switch) it is activated, it pulls a pin low if active(led).

Now the problem, even if i connect one side of a small piece of wire(10cm) to the input pin the bootloader is activated and the led lights up :shock: , the voltage is 4,95v(and yes, measuring the voltage activates the pin also) so the internal pullup is active.
Tried with different pins and different ac/dc adapters(9v400mA/12v1A)

Sometimes when i reset the led will become active to(maby 1 out of 20 times)

If i leave the dragon connected to the isp port the protoboard seems intimidated and works ok(short test).

PSU ripple?
Crystal?

I'm at work at the moment but will test any suggestions when i come home later today

Thanks for the time!

Last Edited: Sat. Jul 21, 2007 - 09:55 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello (beginner here),

I am unsure that I completely understand your "ghost" but, without any program at all...some of your port pins may be floating. Also, depending on the commands at the start of your bootloader, if your BOOTRST fuse bit is set then you will end up there after a reset and..on power up.

Is there any reason you are not using the JTAG interface to program the flash? The bootloader is an "OPTION" you know! For me programming is sticky enough without trying to keep the bootloader and my application code separate.

Also, and maybe some of the more expert guys can jump in, the only selection I see for an external crystal over 16Mhz is the "Full Swing Crystal Oscillator" fuse bit selection off 0111, not the 1111 you have above. still, I doubt that is causing your issue.

John

Just some guy

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

To clear up the problem.
If the selected pin is tied to ground at startup/after reset the bootloader should start, but the bootloader starts sometimes(1 out of 20 times) directly after reset/powerup, or if i touch the pin with a small piece of wire/multimeter etc.
The internal pullup is veified to be working.
If i leave my dragon connected, everything seems to work correctly(and the activation pin isn't an isp pin)

I'm almost 100% sure this is an electrical problem

johnrk wrote:
some of your port pins may be floating. Also, depending on the commands at the start of your bootloader, if your BOOTRST fuse bit is set then you will end up there after a reset and..on power up.

Almost all pins are in the default powerup configuration and are not touched bij the bootloader, and i'm using an existing bootloader witch should work out of the box (with only very small modifications no where near the activation code, only tried anothr pin for activation)

johnrk wrote:

Is there any reason you are not using the JTAG interface to program the flash? The bootloader is an "OPTION" you know! For me programming is sticky enough without trying to keep the bootloader and my application code separate.
John

I disabled the jtag fuse because i wanted to make sure all the pins were usable as standard(no special options that could interfere), and i use ISP for programming as a start

Last Edited: Fri. Jul 20, 2007 - 09:38 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
The internal pullup is veified to be working.
But the internal pull up could be 50-100K, put an external 1K resistor and see what happens.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:
Quote:
The internal pullup is veified to be working.
But the internal pull up could be 50-100K, put an external 1K resistor and see what happens.

Ahh, didn't know that it could be that high

The bootloader has an option to use the internal pullup or the external pullup, so i figured the internal pullup should be enough.

Also on my butterfly i never used pullups for switches ant that always worked(will check with the same setup)

Are there situations(ripple on vcc or interference or so) that would cause these kind of problems?

And if the pullups aren't ment for switches etc are they only usefull to stop floating pins?

Will add the resistor tonight, 99% sure it will work

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

Works like a charm, but still baffeled on the questions

Maximilian wrote:

Also on my butterfly i never used pullups for switches ant that always worked(will check with the same setup)

Are there situations(ripple on vcc or interference or so) that would cause these kind of problems?

And if the pullups aren't ment for switches etc are they only usefull to stop floating pins?

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

The internal pullups are only meant for onboard use and VERY SHORT distances, ie a DIP switch to set systems parameters. Once you put along cable on the pin it becomes an antenna, if your fingers are also touching it, then it's a lot worse. By reducing the pullup resistor value you reduce the garbage picked up by the "antenna".

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

As a matter of similarity, there are "touch plate" switches that work on this principle. An antenna that when you touch it, generates enough of a signal to trigger a light.

Harvey

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

js wrote:
The internal pullups are only meant for onboard use and VERY SHORT distances

Ah that explains why the butterfly didn't have any problems, those tracks are about 2 cm total to the switch

Thanks!!!