ds18b20 not detecting, using ATmega2561

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

Hi,

 I have three d18b20 sensors connected to my ATmega2561 on PE2 pin. I tried modifying an example from dallasTemperature library to print on lcd rather then to serial monitor, and it outputs 0 as the address. Meaning it's not detecting my ds18b20 sensors. I am programing in Arduino. And I changed the pullup resistor from 470 ohm to 4.7k ohm. 

Attachment(s): 

This topic has a solution.
Last Edited: Tue. May 11, 2021 - 03:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well the first thing that strikes me about that is some commented code:

// arrays to hold device addresses
DeviceAddress insideThermometer, outsideThermometer;

// Assign address manually. The addresses below will need to be changed
// to valid device addresses on your bus. Device address can be retrieved
// by using either oneWire.search(deviceAddress) or individually via
// sensors.getAddress(deviceAddress, index)
// DeviceAddress insideThermometer = { 0x28, 0x1D, 0x39, 0x31, 0x2, 0x0, 0x0, 0xF0 };
// DeviceAddress outsideThermometer   = { 0x28, 0x3F, 0x1C, 0x31, 0x2, 0x0, 0x0, 0x2 };

As you just instantiate the variables but do not (as in the commented example) assign an address then haven't you missed a step here? Or am I misunderstanding what this comment is telling you?

 

It does mention doing a "search" but the code that might do that:

  // method 2: search()
  // search() looks for the next device. Returns 1 if a new address has been
  // returned. A zero might mean that the bus is shorted, there are no devices,
  // or you have already retrieved all of them. It might be a good idea to
  // check the CRC to make sure you didn't get garbage. The order is
  // deterministic. You will always get the same devices in the same order
  //
  // Must be called before search()
  //oneWire.reset_search();
  // assigns the first address found to insideThermometer
  //if (!oneWire.search(insideThermometer)) Serial.println("Unable to find address for insideThermometer");
  // assigns the seconds address found to outsideThermometer
  //if (!oneWire.search(outsideThermometer)) Serial.println("Unable to find address for outsideThermometer");

is commented.

 

I know the active code is:

  // Search for devices on the bus and assign based on an index. Ideally,
  // you would do this to initially discover addresses on the bus and then
  // use those addresses and manually assign them (see above) once you know
  // the devices on your bus (and assuming they don't change).
  //
  // method 1: by index
  lcd.setCursor(0,0);
  if (!sensors.getAddress(insideThermometer, 0)) lcd.print("Unable Dev 0");
  lcd.setCursor(0,1);
  if (!sensors.getAddress(outsideThermometer, 1)) lcd.print("Unable Dev 1");

but is this actually enough?

 

To be honest I don't know. If it were me I would probably ask on arduino.cc but for the time being I have simply moved this thread to the Arduino forum as it seems to be more about Arduino library code than anything else.

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


fifi5675 wrote:
I tried modifying an example from dallasTemperature library

Did it work before you changed it?

 

EDIT

 

fifi5675 wrote:
I changed the pullup resistor from 470 ohm to 4.7k ohm

4k7 is the value recommended by Maxim in the datasheet:

https://www.maximintegrated.com/en/products/sensors/DS18B20.html

 

So where did 470 ohms come from ?

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. May 4, 2021 - 04:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

4k7 should be fine as a pullup on OneWire bus.

 

PE2 port pin is not accessible on an MEGA2560 Arduino board.

ATmega2561 is not supported as a genuine Arduino.

 

Your INO file assigns Digital #2 for OneWire bus.    This is PE4 on a MEGA2560.

 

I suggest that you study the documentation of whatever Third Party Core you are using in the Arduino IDE.

Post a link to your Third Party ATmega2561 Core.

Post a link to your ATmega2561 board.

 

David.

 

 

Last Edited: Tue. May 4, 2021 - 04:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using megaCore library for board.

 

 

Your INO file assigns Digital #2 for OneWire bus.    This is PE4 on a MEGA2560.

I am using Atmega2561

 

 

I also tried doing it with atmega168, with different code, but again without success. This time the cursor dances on the lcd display.

 

Attachment(s): 

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

So did the library & its example work as delivered - without any changes?

 

Have you tried it on a genuine Arduino?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well I can't know if it worked without any changes because I can't read from serial monitor. And only changes I made is convert from serial output to lcd. 

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

Post a link to your "MegaCore"

A properly implemented Core will have its own pins_arduino.h variants.

A properly implemented OneWire.h library would use these Digital pins.

 

So if Digital#2 is assigned to PE2 everything should work fine.

Likewise Serial, Serial1, Serial2, Serial3 should all work 100%.

 

It is absolutely fine to quote genuine Arduino boards by "name".

But Third Party Libraries, Cores, Boards, ... require links.   So that we know exactly what you are talking about.

 

David.

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

fifi5675 wrote:
I can't read from serial monitor.

That sounds like a pretty fundamental issue that needs to be solved before you move onto 1-Wire stuff!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

fifi5675 wrote:
 I have three d18b20 sensors connected to my ATmega2561 on PE2 pin

 

That will not work unless there is a way to individually address each sensor. Or, does Maxim give them unique addresses?

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

Last Edited: Tue. May 4, 2021 - 07:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


ka7ehk wrote:
does Maxim give them unique addresses?

Yes.

 

EDIT

 

It is a key feature of the 1-WireTM bus:

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. May 4, 2021 - 07:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I think it might be reasonable to put just one DS chip on the bus, and get that working correctly, before adding additional DS chips to the bus.

 

JC

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

DocJC wrote:
put just one DS chip on the bus, and get that working correctly, before adding additional DS chips to the bus.

Absolutely - always start simple, and get the basics working first.

 

Speaking of basics, before even do anything at all with 1-Wire, getting the serial IO has to be the first step - see #9

 

And, before that, does a basic "blinky" even work? 

 

So:

  1. Get "blinky" working - check that the pin intended for 1-Wire does actually work at all
  2. Once that's working, Get serial IO working - you can then use this to instrument your code
  3. Once that's working, Try 1-Wire with a single sensor, and fixed address
  4. Once that's working, Try the address scanning - still with a single sensor
  5. Finally, you should have proven the ingredients to get a multi-sensor system working.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. May 5, 2021 - 07:23 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Any respectable Arduino OneWire library and Arduino Core will just work.

 

Maxim published the necessary algorithms for all the operations e.g. reading unique Serial Number,  writing to the specific Serial Number device, ...

 

So it just comes down to revealing which Arduino OneWire library and Arduino Core is used.

Preferably items available via the IDE Library Manager and the Board Manager.

 

Then readers could build and test the OP's sketch.

 

Oh,  and DocJC's advice is sound.   Test with individual DS chips first.   You might have a faulty DS that does not play cricket.   All participant chips on a common bus must be Team players.

 

David.

Last Edited: Wed. May 5, 2021 - 07:30 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
You might have a faulty DS

or faulty or incorrect wiring - which would prevent even good team-playing chips from working.

 

david.prentice wrote:
All participant chips on a common bus must be Team players

The hardware is also part of the team.

 

@fifi5675 - what hardware debug facilities do you have; eg, oscilloscope ... ?

 

Maxim published the necessary algorithms for all the operations

Indeed - see: https://www.avrfreaks.net/commen... for key document references

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. May 11, 2021 - 04:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

fifi5675 wrote:
I tried modifying an example from dallasTemperature library

You mean this: https://www.arduino.cc/reference/en/libraries/dallastemperature/ ?

Documented here: https://github.com/milesburton/Arduino-Temperature-Control-Library 

Which says:

please include OneWire from Paul Stoffregen in the library manager before you begin

So did you do that?

 

EDIT

 

and note the "additional documentation" here: https://www.milesburton.com/Dallas_Temperature_Control_Library

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. May 5, 2021 - 08:13 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

It is very simple to post proper links.   Then we don't have to guess.

 

Otherwise we would just install the supported Library, Board, ... and run the associated example.

I bet that any examples would work 100%.   After all,  people have been using multiple DS18B20 for years.

 

Running something that works 100% is not much good for the OP.   The OP probably has some unusual or hacked top secret versions.

 

David.

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

david.prentice wrote:
The OP probably has some unusual or hacked top secret versions.

Indeed.

 

That fact that basic, standard stuff like Serial IO isn't working doesn't bode well for the setup ...

 

frown

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

There's no reason why it shouldn't work. I wired up my TQFP-64 AVR development board (with an ATmega2561) and connected a DS18B20 sensor with a 4.7k pullup. Worked perfectly.

 

For Arduino ATmega2561 support I used MegaCore, and I used the OneWire library to communicate with the sensor.

 

FYI the OneWire library will not work on any of the pins on PORTF. Here's some more info about that  - MegaCore issue #102.

 

Here's the example code I used:

#include <OneWire.h>

// OneWire DS18S20, DS18B20, DS1822 Temperature Example
//
// http://www.pjrc.com/teensy/td_libs_OneWire.html
//
// The DallasTemperature library can do all this work for you!
// https://github.com/milesburton/Arduino-Temperature-Control-Library

OneWire  ds(PIN_PE2); // PIN PE2 - Arduino pin 2

void setup(void) {
  Serial.begin(9600);
}

void loop(void) {
  byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;

  if ( !ds.search(addr)) {
    Serial.println("No more addresses.");
    Serial.println();
    ds.reset_search();
    delay(250);
    return;
  }

  Serial.print("ROM =");
  for( i = 0; i < 8; i++) {
    Serial.write(' ');
    Serial.print(addr[i], HEX);
  }

  if (OneWire::crc8(addr, 7) != addr[7]) {
      Serial.println("CRC is not valid!");
      return;
  }
  Serial.println();

  // the first ROM byte indicates which chip
  switch (addr[0]) {
    case 0x10:
      Serial.println("  Chip = DS18S20");  // or old DS1820
      type_s = 1;
      break;
    case 0x28:
      Serial.println("  Chip = DS18B20");
      type_s = 0;
      break;
    case 0x22:
      Serial.println("  Chip = DS1822");
      type_s = 0;
      break;
    default:
      Serial.println("Device is not a DS18x20 family device.");
      return;
  } 

  ds.reset();
  ds.select(addr);
  ds.write(0x44, 1);        // start conversion, with parasite power on at the end

  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a ds.depower() here, but the reset will take care of it.

  present = ds.reset();
  ds.select(addr);
  ds.write(0xBE);         // Read Scratchpad

  Serial.print("  Data = ");
  Serial.print(present, HEX);
  Serial.print(" ");
  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = ds.read();
    Serial.print(data[i], HEX);
    Serial.print(" ");
  }
  Serial.print(" CRC=");
  Serial.print(OneWire::crc8(data, 8), HEX);
  Serial.println();

  // Convert the data to actual temperature
  // because the result is a 16 bit signed integer, it should
  // be stored to an "int16_t" type, which is always 16 bits
  // even when compiled on a 32 bit processor.
  int16_t raw = (data[1] << 8) | data[0];
  if (type_s) {
    raw = raw << 3; // 9 bit resolution default
    if (data[7] == 0x10) {
      // "count remain" gives full 12 bit resolution
      raw = (raw & 0xFFF0) + 12 - data[6];
    }
  } else {
    byte cfg = (data[4] & 0x60);
    // at lower res, the low bits are undefined, so let's zero them
    if (cfg == 0x00) raw = raw & ~7;  // 9 bit resolution, 93.75 ms
    else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms
    else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms
    //// default is 12 bit resolution, 750 ms conversion time
  }
  celsius = (float)raw / 16.0;
  fahrenheit = celsius * 1.8 + 32.0;
  Serial.print("  Temperature = ");
  Serial.print(celsius);
  Serial.print(" Celsius, ");
  Serial.print(fahrenheit);
  Serial.println(" Fahrenheit");
}

 

Output from the serial monitor:

ROM = 28 B4 3D 65 8 0 0 99
  Chip = DS18B20
  Data = 1 C0 1 4B 46 7F FF 10 10 8F  CRC=8F
  Temperature = 28.00 Celsius, 82.40 Fahrenheit
No more addresses.

ROM = 28 B4 3D 65 8 0 0 99
  Chip = DS18B20
  Data = 1 BF 1 4B 46 7F FF 1 10 E8  CRC=E8
  Temperature = 27.94 Celsius, 82.29 Fahrenheit
No more addresses.

ROM = 28 B4 3D 65 8 0 0 99
  Chip = DS18B20
  Data = 1 BF 1 4B 46 7F FF 1 10 E8  CRC=E8
  Temperature = 27.94 Celsius, 82.29 Fahrenheit
No more addresses.

 

Last Edited: Wed. May 5, 2021 - 04:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MCUdude wrote:

There's no reason why it shouldn't work. I wired up my TQFP-64 AVR development board (with an ATmega2561) and connected a DS18B20 sensor with a 4.7k pullup. Worked perfectly.

 

For Arduino ATmega2561 support I used MegaCore, and I used the OneWire library to communicate with the sensor.

 

Yes,  I assumed that it would work 100% with known Core and known library.

 

It will be interesting to hear from the OP.    And discover what software she was using.   Most importantly,  from where on the Internet.

The Arduino Library Manager has been a Godsend.   But there are still a lot of sites with random code that might have been hacked from ancient library versions.

 

David.

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

It will be interesting to hear from the OP.    And discover what software she was using.   Most importantly,  from where on the Internet.

I'm also waiting patiently...

 

The Arduino Library Manager has been a Godsend.   But there are still a lot of sites with random code that might have been hacked from ancient library versions.

Semi off-topic question: My impression is that most "pro" users on this forum generally don't hate or really dislike Arduino. On the other side, users on other forums like the EEVblog forum or Hackaday comment section always bring up how terrible Arduino is and how it makes users dumb when they have a chance.

 

The question is; since you guys know AVRs more than everyone and know how "slow" it can perform compare to "the real deal", how come that the general tone about Arduino is positive on this forum, while people are complaining elsewhere? Or turn the question around, how come that so many people "hate" Arduino while you guys generally don't?

 

Bottom line: I use Arduino regularly, but I'm using it on a "chip-level" and not a "board-level". I'm also maintaining a few Arduino cores myself, and it seems like there is demand for Arduino support on other AVRs with other hardware configurations that Arduino themselves offer.

There is a lot of things I like about Arduino (open source, Serial bootloader tons of libraries), and there are many things I think are outright dumb (no Serial.printf in the official cores, lots of badly designed code in the core files, etc.).

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

MCUdude wrote:
how come that the general tone about Arduino is positive on this forum

Well for me, I have an Arduino or an xplained board with in reach, I can use it with just about any external device, as I can find I'm rarely the first to connect one to an Arduino and so can find working code, make a quick test to verify the h/w works using the library found online.    Then I can use the lib or write my own as needed, most of my apps are not performance challenged, but if they are, I know how to talk to ports directly if I need too.  

So bottom line, the time it takes to get to a working prototype (and get paid for it) is more important then the time it takes the app to run. If the client needs more performance, then I can negotiate a better price for better performance, once I can  produce the prototype. 

 

It seems to be a badge of honor to build apps for bare metal chips for hobbyists, but for a pro, time is money in our pockets! 

 

Jim

 

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

I think that Jim has explained it very well.   Arduino is excellent for verifying hardware,  testing ideas, prototypes, ...

 

However,  8 or 10 years ago AvrFreaks was very snooty about Arduino.

Now that most people have actually tried it,   we get experienced opinion instead of prejudice.

 

I find it difficult to understand the hobbyist that started with Arduino and now wants to reject it for C in AS7.0

It is much more effective to "tweak" the bottlenecks than to start from scratch.

 

David.

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

I find it difficult to understand the hobbyist that started with Arduino and now wants to reject it for C in AS7.0

It is much more effective to "tweak" the bottlenecks than to start from scratch.

Exactly! Sone of the built-in Arduino libraries like Serial, Wire, and SPI has some overhead compared to bare-metal, but they are quick and easy to use, exposes the hardware features you usually need, and are very proven.

 

I've seen the most "Arduino hate" in the Hackaday comment section really. I find it hard to believe it when people write that they started out with an AVR-based Arduino but quickly ran out of memory and processing power, so they went straight over to STM32F4 and their "wonderful" CubeMX HAL and their lives have never been better. The learning curve is like a brick wall!

 

I've written some beefy firmware to run on an audio amplifier that's powered by an ATmega1284P. The firmware compiles down to ~100kB, and it's communicating with an audio DSP, doing DSP-related math, has a full-blown menu system on an OLED screen with capacitive touch and a beefy RS485 protocol for remote control. I'm running the AVR at 8 MHz due to a 3.3V supply, and performance is still not an issue. I see no reason to switch over to 32-bit "just because it's 2021".

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hello, it's been a while, but I figured it out why none of your advices didn't work. ATmega2561 and other microcontrolers have set fuse to divide speed by 8. Meaning that 2us delay wasn't 2us but likely 0. That's why I couldn't read sondes. 

 

Thank you all for your help, I used all of your advices.

 

P.S I am not a girl.

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

fifi5675 wrote:
  fuse to divide speed by 8.

which, presumably, also explains why your serial IO was not working - see Tip #2 and Tip #3 in my signature; also FAQ#3 in clawson's

 

So, if you'd have followed the advice in #13, you would have found the problem much quicker.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...