Hello!
I have lcd 16x2 and humidity(temp) sensor. Works fine on arduino uno
On Atmega8 (burn with avr910, hex from IDE) works only lcd ! On screen i see messages like: "Bus Hung", "ACK timeout".
Connection is right, im sure. Viewing forum i see message that it can be the fuses. But whats wrong with them?
Pls help
#include <LiquidCrystal.h>
#include "DHT22.h"
// Data wire is plugged into port 7 on the Arduino
// Connect a 4.7K resistor between VCC and the data pin (strong pullup)
#define DHT22_PIN 7
// Setup a DHT22 instance
DHT22 myDHT22(DHT22_PIN);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
//Serial.begin(9600);
//lcd.print("DHT22 Library Demo");
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
//lcd.print("hello, world!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
// print the number of seconds since reset:
//lcd.print(millis()/1000);
DHT22_ERROR_t errorCode;
delay(2000);
//lcd.print("Requesting data...");
errorCode = myDHT22.readData();
switch(errorCode)
{
case DHT_ERROR_NONE:
lcd.setCursor(0, 0);
lcd.print("Temperature ");
lcd.print(myDHT22.getTemperatureC());
lcd.setCursor(0, 1);
lcd.print("Humidity ");
lcd.print(myDHT22.getHumidity());
lcd.print("%");
break;
case DHT_ERROR_CHECKSUM:
lcd.print("check sum error ");
lcd.print(myDHT22.getTemperatureC());
lcd.print("C ");
lcd.print(myDHT22.getHumidity());
lcd.print("%");
break;
case DHT_BUS_HUNG:
lcd.print("BUS Hung ");
break;
case DHT_ERROR_NOT_PRESENT:
lcd.print("Not Present ");
break;
case DHT_ERROR_ACK_TOO_LONG:
lcd.print("ACK time out ");
break;
case DHT_ERROR_SYNC_TIMEOUT:
lcd.print("Sync Timeout ");
break;
case DHT_ERROR_DATA_TIMEOUT:
lcd.print("Data Timeout ");
break;
case DHT_ERROR_TOOQUICK:
lcd.print("Polled to quick ");
break;
}
}
I burn with that parameters : boards.txt
atmega8.name=Arduino NG or older w/ ATmega8
atmega8.upload.protocol=stk500
atmega8.upload.maximum_size=7168
atmega8.upload.speed=19200
atmega8.bootloader.low_fuses=0xdf
atmega8.bootloader.high_fuses=0xca
atmega8.bootloader.path=atmega8
atmega8.bootloader.file=ATmegaBOOT.hex
atmega8.bootloader.unlock_bits=0x3F
atmega8.bootloader.lock_bits=0x0F
atmega8.build.mcu=atmega8
atmega8.build.f_cpu=16000000L
atmega8.build.core=arduino
I don`t use any bootloader , maybe that problem?