Can't seem to make my Custom Microcontroler board work (ATMEGA32U4)

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

Currently a student in computer/electrical engineering and doing a custom made microcontroler board.

 

I've assembled it, wrote a simple code that turned the I/Os on and off, then programmed it through JTAG. Uploaded and verified the code succesfully and then it doesn't seem to do anything. I checked the I/Os and seem to be getting 1.6V at every IO, can't seem to figure out what's wrong with it.

 

We're using the internal clock and I can't communicate by USB for now because I'm waiting on an order for my 22ohm Resistors.

 

Here's the code I wrote and the circuits:

 

 

#define PORTD   _SFR_IO8(0x12)

#include <asf.h>

#include <avr/io.h>
#define F_CPU 8000000
#include <util/delay.h>


int main (void)
{

	DDRD = 0xFF;
	DDRB = 0xFF;
	DDRF = 0xFF;
	DDRC = 0xFF;
	while(1) //infinite loop
	{
          PORTD ^= 0xFF; 
	  PORTB ^= 0xFF;
	  PORTF ^= 0xFF;
	  PORTC ^= 0xFF;
          _delay_ms(500); 
	}
}

 

And here's the circuit:This is just the connection to the headers

 

Last Edited: Thu. Mar 14, 2019 - 12:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How are you measuring the 1.6V?

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

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

Well, I'd don't know C, but I fine it interesting that one can toggle the output of a port by XOR'ing the port to a constant.

I get the concept, it just isn't / wasn't clear to me WHAT the program used as the Port value against which to run the XOR.

 

For a test program I would skip the MUX and put an LED on PortC.6, for example.

Then make that pin an output.

Then loop on set the pin high, delay, set the pin low, delay; loop.

 

Can you post a photo of your PCB?

 

Welcome to the Forum.

 

JC

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

Brian Fairchild wrote:
How are you measuring the 1.6V?

 

I measured it with my multimeter.

 

DocJC wrote:
For a test program I would skip the MUX and put an LED on PortC.6, for example. Then make that pin an output. Then loop on set the pin high, delay, set the pin low, delay; loop. Can you post a photo of your PCB?

 

I did something similar but simply probed the output with my multimeter and got the same 1.6V which I thought was pretty weird.

 

But I'm not going to waste anymore of your time. Seems like we've resolved the issue for the moment.

 

It looks like we didn't configure the internal oscilator properly. Sorry for wasting your time. Thank you very much for your help.

 

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

guillaume958 wrote:

Brian Fairchild wrote:
How are you measuring the 1.6V?

 

I measured it with my multimeter.

 

 

How are you measuring a multi-MHz pulse waveform on a multimeter?

 

And if you do, what voltage do you expect to see?

 

 

 

guillaume958 wrote:

It looks like we didn't configure the internal oscilator properly. Sorry for wasting your time. Thank you very much for your help.

 

No, that's not your problem. If it has solved it then you changed something else as well.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

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

Brian Fairchild wrote:
How are you measuring a multi-MHz pulse waveform on a multimeter? And if you do, what voltage do you expect to see?

 

I messed around with the code a bunch of time and changed the delay on my IOs at the entrance of my MUX but I pretty much expected it what I'm seeing now, the voltage switching between 0 and 5V at the corresponding delays. 

 

Brian Fairchild wrote:
No, that's not your problem. If it has solved it then you changed something else as well.

 

Well, seem to be working for now. May or may not run into some issues later if that truly didn't really resolve the issue. I included into this message my Gerber and Ultiboard files. Not sure if that helps. My apologies if the design is amateurish. I'm also aware that the footprints for the IC are incorrect, still kicking myself over that one, me and my partner made it work by stretching the pins a bit. 

Attachment(s): 

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

DocJC also requested a picture of my PCB so here it is:

 

 

 

 

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

little side step, but is your dragon yours or from your school?

 

I would suggest searching for "avr dragons liar plons"  to put a bit of protection around your dragon. Would be a pitty when if in the heat of the battle the dragon is killed by some stupid mistake.

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

"Dare to be naïve." - Buckminster Fuller

Last Edited: Thu. Mar 14, 2019 - 01:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meslomp wrote:
little side step, but is your dragon yours or from your school?

 

It's not mine, it's borrowed from our college. We're fully aware that the Dragon is a fragile piece of hardware. Our professors and the technicians that lend it to us told us as much. It's actually the last one they have because the rest all broke in the clumsy hands of students from previous years. I don't think they expect to get this one back either but we've been extra careful with it. Not sure if I want to buy/invest into something that I won't be keeping afterwards.

 

Worst case scenario, we actually have an alternative lying around. It's one of those USB to JTAG thingy : https://www.olimex.com/Products/...

 

We haven't used it so far because the Dragon is just more convenient and we couldn't be bothered to mess around with the drivers when we have simpler & quicker means available to us.

Last Edited: Thu. Mar 14, 2019 - 01:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

guillaume958 wrote:
We haven't used it so far because the Dragon is just more convenient
There's no point trying to use it. The "JTAGICE clones" are cloned of the original Atmel JTAG interface (from around 2000) and they are limited to supporting about 10 models of AVR that were the "current" ones (with JTAG) when that device was released. 32U4  is not one of them.

 

(actually the Olimex thing you linked to is MSP430 not AVR anyway!)

EDIT the Olimex one for AVR appears to be: https://www.olimex.com/Products/...

As it says there:

 

  • Programs all AVR flash microcontrollers supported by ATJTAGICE (ATmega16, ATmega32, ATMega323, ATmega162, ATmega169, ATmega128)

 

So not many I'm afraid.

 

If you want to try an alternative to the Dragon this new $15 "Snap" from Microchip is cheap enough it is probably worth a gamble! 

Last Edited: Thu. Mar 14, 2019 - 02:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oops, You are correct. I don't think I linked the right one but the one we have is AVR though

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

clawson wrote:
If you want to try an alternative to the Dragon this new $15 "Snap" from Microchip is cheap enough it is probably worth a gamble!
mega32U4 in MPLAB X v5.15 :

Beta : MPLAB Snap, MPLAB PICkit 4, Atmel-ICE

Tested : Simulator

Come Join Us (MPLAB Now Supports AVRs) | AVR Freaks

MPLAB Snap

 

"Dare to be naïve." - Buckminster Fuller

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

guillaume958 wrote:

 

Our professors and the technicians that lend it to us told us as much. It's actually the last one they have because the rest all broke in the clumsy hands of students from previous years.

 

If they still have them lying around for scrap, then perhaps send them here. Most of the times just 1 part fails and that also is well documented here.

 

Then again, buying an Atmel-ICE or Snap tool will also give a more secure tool coming inside a nice box already.