Pages: [1]   Go Down
Author Topic: Atmega 328 vs 328P Problem  (Read 948 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 2
Posts: 106
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does anyone know if there is some difference between the 328 and the 328p that will affect Serial.print?
I made my own Nano board and I guess I ordered 328 instead of 328P. I only found that out when bootloading with AVRISP and AVR Studio reports. I loaded the Optiboot Boot loader. It runs the Blink sketch no problem but when I add a Serial.Print command, it just prints garbage.
When I do the same with my original Nano, it prints fine.
Any help or input would be appreciated. Sorry I am a noob who may be doing something wrong.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 208
Posts: 12929
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Does your board use a resonator or crystal?

What values did you use for the fuses?
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 'P' is for PicoPower.
It uses less power. But Serial.print should be just the same.
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 106
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I used a ceramic resonator 16MHz. In the eagle files from Gravitech it says resonator. It looks identical to the one on the original board. Do you think it needs to be a crystal?
I did not change the fuse bits.
Sorry i am a hardware guy and this is a little new for me.
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

At 16MHz, I would prefer a crystal.
The fuses are different for resonators or crystals (not always).
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could your clock frequency be off?  Make a blink sketch with a really long delay, like 20 minutes, and time it with a stopwatch as accurately as you can.  An error of <4% is usually ok, but tolerances vary.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 208
Posts: 12929
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I used a ceramic resonator 16MHz. In the eagle files from Gravitech it says resonator. It looks identical to the one on the original board. Do you think it needs to be a crystal?

No.

Quote
I did not change the fuse bits.

From the factory, the processor is configured to run at 1 MHz using the internal oscillator.  If you did not change the fuses then it is still configured to run that way.

Do you have another board?  Like an Arduino Uno?  If you do, use OptiLoader to install the bootloader.  It handles all the details including correctly setting the fuses.

I agree with @tim7.  A timing test may help determine what's wrong.  (other than the 20 minutes; 15 to 30 seconds is adequate)
« Last Edit: May 04, 2012, 07:10:03 pm by Coding Badly » Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 106
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried Optiloader earlier today and now again. Cannot get it to work. I cannot tell if it is programming the board or not as nothing is on the serial monitor. But when I use the programmed board and try to load a sketch, I get an Avrdude error. These problems led me to buy  the avrisp this morning and I am able to burn the bootloader with it. Do you know what the fuse bits should be set to?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 208
Posts: 12929
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


https://github.com/arduino/Arduino/blob/master/hardware/arduino/boards.txt#L3
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 106
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you
Those settings worked with the ATmegaBOOT_168_atmega328.hex but not with the Optiboot file.
thank you, she now speaks English.
Logged

Pages: [1]   Go Up
Jump to: