Go Down

Topic: attiny84 lcd (Read 199 times) previous topic - next topic

secretreeve

Nov 16, 2019, 11:48 pm Last Edit: Nov 17, 2019, 12:15 am by secretreeve
SOLVED!!!!

never mind. rookie mistake.

was looking at the wrong list of numbers, i was looking at the physicalpin numbers not the numbers your need to program, so adjusted those and works perfectly.


hi all,

so i've got a working sketch, i can compile it to my arduino uno and it will run perfectly fine, i made the circuit board for it and attatched it to the 16x2 lcd display.

i've uploaded the code to the attiny84 but i just get one line of blocks and one line of nothing.

i've connected the circuit board to the arduino using the same pin assignments as the chip and it works.

so im still learning about using the attiny pins perhaps one of you can spot the problem. maybe im using a pin on the chip your not supposed to?

remember, the display works when using the same pin assignments between the arduino and display so the  circuit is fine and the sketch works.

Code: [Select]
// The circuit:
 // LCD RS pin to digital pin 11
 // LCD Enable pin to digital pin 10
 // LCD D4 pin to digital pin 2
 // LCD D5 pin to digital pin 5
 // LCD D6 pin to digital pin 6
 // LCD D7 pin to digital pin 7
 // LCD R/W pin to ground
 // 10K resistor:
 // ends to +5V and ground
 // wiper to LCD VO pin (pin 3)

#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 10, en = 11, d4 = 2, d5 = 5, d6 = 6, d7 = 7;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int ledPin = 9;

void setup() {
  lcd.begin(16, 2);

}

void loop() {
  lcd.print(F("Spitfire Mk5b vs"));
  lcd.setCursor (3,1);
  lcd.print(F("Messerschmitt"));
  delay(5000);

  lcd.clear();
  lcd.setCursor (1,0);
  lcd.print(F("WW2 1939-1945"));
  lcd.setCursor (1,1);
  lcd.print(F("Lest We Forget"));
  delay(5000);

  lcd.clear();
  lcd.print(F("Spitfire Mk5b"));
  lcd.setCursor (0,1);
  lcd.print(F("Specifications"));
  delay(5000);

  lcd.clear();
  lcd.setCursor (4,0);
  lcd.print(F("Designer"));
  lcd.setCursor (2,1);
  lcd.print(F("R.J Mitchell"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(5,0);
  lcd.print(F("Length"));
  lcd.setCursor (0,1);
  lcd.print(F("29ft 11in / 9.1m"));
  delay(5000);
 
  lcd.clear();
  lcd.setCursor(4,0);
  lcd.print(F("Wingspan"));
  lcd.setCursor (0,1);
  lcd.print(F("36ft 6in / 11.2m"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(5,0);
  lcd.print(F("Height"));
  lcd.setCursor (0,1);
  lcd.print(F("11ft 5in / 3.48m"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print(F("Empty Weight"));
  lcd.setCursor (2,1);
  lcd.print(F("1953-2354KG"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(1,0);
  lcd.print(F("Loaded Weight"));
  lcd.setCursor (2,1);
  lcd.print("2692-3624KG");
  delay(5000);

  lcd.clear();
  lcd.setCursor(1,0);
  lcd.print(F("Takeoff weight"));
  lcd.setCursor (5,1);
  lcd.print(F("2911Kg"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(5,0);
  lcd.print(F("Engine"));
  lcd.setCursor (2,1);
  lcd.print(F("RR Merlin 66"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print(F("Power/Thrust"));
  lcd.setCursor (5,1);
  lcd.print(F("2000HP"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print(F("Combat Range"));
  lcd.setCursor (1,1);
  lcd.print(F("405-470 Miles"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print(F("Ferry Range"));
  lcd.setCursor (2,1);
  lcd.print(F("1135 Miles"));
  delay(5000);

  lcd.clear();
  lcd.print(F("Service Ceiling"));
  lcd.setCursor (3,1);
  lcd.print(F("43,000 FT"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(1,0);
  lcd.print(F("Rate of climb"));
  lcd.setCursor (0,1);
  lcd.print(F("1350-4660ft/min"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print(F("Machine guns"));
  lcd.setCursor (0,1);
  lcd.print(F("4x .303 Browning"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(5,0);
  lcd.print(F("Cannons"));
  lcd.setCursor (0,1);
  lcd.print(F("2x 20mm Hispano2"));
  delay(5000);

  lcd.clear();
  lcd.print(F("Messerschmitt"));
  lcd.setCursor (0,1);
  lcd.print(F("Specifications"));
  delay(5000);

  lcd.clear();
  lcd.setCursor (4,0);
  lcd.print(F("Designer"));
  lcd.setCursor (0,1);
  lcd.print(F("W.Messerschmitt"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(5,0);
  lcd.print(F("Length"));
  lcd.setCursor (0,1);
  lcd.print(F("29ft 4in / 9.9m"));
  delay(5000);
 
  lcd.clear();
  lcd.setCursor(4,0);
  lcd.print(F("Wingspan"));
  lcd.setCursor (0,1);
  lcd.print(F("32ft 7in / 9.0m"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(5,0);
  lcd.print(F("Height"));
  lcd.setCursor (1,1);
  lcd.print(F("8ft 6in / 2.6m"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print(F("Empty Weight"));
  lcd.setCursor (5,1);
  lcd.print(F("2247KG"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(1,0);
  lcd.print(F("Loaded Weight"));
  lcd.setCursor (5,1);
  lcd.print(F("3148KG"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(1,0);
  lcd.print(F("Takeoff weight"));
  lcd.setCursor (5,1);
  lcd.print(F("3400Kg"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(5,0);
  lcd.print(F("Engine"));
  lcd.setCursor (4,1);
  lcd.print(F("DB-605A"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print(F("Power/Thrust"));
  lcd.setCursor (5,1);
  lcd.print(F("1455HP"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print(F("Combat Range"));
  lcd.setCursor (3,1);
  lcd.print(F("530 Miles"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print(F("Ferry Range"));
  lcd.setCursor (3,1);
  lcd.print(F("620 Miles"));
  delay(5000);

  lcd.clear();
  lcd.print(F("Service Ceiling"));
  lcd.setCursor (4,1);
  lcd.print(F("39,000 FT"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(1,0);
  lcd.print(F("Rate of climb"));
  lcd.setCursor (2,1);
  lcd.print(F("3,300ft/min"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(1,0);
  lcd.print(F("Machine guns"));
  lcd.setCursor (1,1);
  lcd.print(F("2x 13mm MG131"));
  delay(5000);

  lcd.clear();
  lcd.setCursor(4,0);
  lcd.print(F("Cannons"));
  lcd.setCursor (0,1);
  lcd.print(F("2x 20mm MG151/20"));
  delay(5000);

  lcd.clear();
  lcd.print(F("Created By"));
  lcd.setCursor (5,1);
  lcd.print(F("Chris Marsh"));
  delay(3000);
 
  lcd.clear();
  lcd.print(F("ryder2012.cm"));
  lcd.setCursor (6,1);
  lcd.print(F("@gmail.com"));
  delay(3000);

  lcd.clear();
  delay(100);
  }




when uploading the sketch i have the following settings

screenshot by chris marsh, on Flickr

bootloader burned as well.

any suggestions?

secretreeve

never mind. rookie mistake.

was looking at the wrong list of numbers, i was looking at the physicalpin numbers not the numbers your need to program, so adjusted those and works perfectly.

DrAzzy

Glad you got it sorted out!
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Go Up