hd44780 not working in 4-bit mode with the LCD from Arduino Starter Kit

Aperta
#646 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go
Ambito
embedded-iot

Direzione di ricerca

Start with the example in countdown-lcd-1602-4bits/main.go and the hd44780 driver, then reproduce the gibberish on the linked Wokwi circuit using the reported TinyGo version. Compare its 4-bit behavior with the Arduino LiquidCrystal example; done means the LCD displays the expected countdown text reliably on both listed displays.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The code exhibiting the problem is pretty much a hello-world type (from here)

package main

import (
	"bytes"
	m "machine"
	"strconv"
	"time"

	"tinygo.org/x/drivers/hd44780"
)

func main() {
	m.Serial.Configure(m.UARTConfig{BaudRate: 9600})
	lcd, err := hd44780.NewGPIO4Bit([]m.Pin{m.D5, m.D4, m.D3, m.D2}, m.D11, m.D12, m.NoPin)
	if err != nil {
		println("error: create LCD", err.Error())
		return
	}
	if err := lcd.Configure(hd44780.Config{Width: 16, Height: 2}); err != nil {
		println("error: configure LCD", err.Error())
		return

	}

	println("Start")
	lcd.Write([]byte("Countdown:"))
	lcd.Display()
	time.Sleep(1 * time.Second)
	
	// snip

It happens with latest version (v0.26.0), on both:

The easiest way to reproduce the issue is with a virtual circuit on wokwi.com (such as this one), by pressing F1 there, then selecting Upload Firmware and Start Simulation and uploading the tinygo built hex file. The mis-behavior is of random "gibberish" showing up on the LCD.

Th expected behavior of the virtual circuit should be like exhibited by this one - programmed with the Arduino LiquidCrystal library.

Possibly related to #380?

Lingua principale
Go
Stelle
756
Fork
251
Merge medio
7g 12h
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tinygo-org/drivers

Tutte le issue di tinygo-org/drivers

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.