LCD über PCF8574 / TWI ansteuern

  • 1
  • 2
  • Page 2 of 2
Harry
Moderator
Avatar
Gender:
Location: zwischen Augsburg und Ulm
Age: 59
Posts: 2089
Registered: 03 / 2003
Subject:

Re: LCD über PCF8574 / TWI ansteuern

 · 
Posted: 21.05.2019 - 14:40  ·  #9
Hallo Joachim,

du kannst das ja als Beispiel hier im Forum unter "Software" bereit stellen. Evtl. einen kleinen Anschlussplan dazu - perfekt.

Quote
übrigens, die funktionen der LCDIOS lassen sich problemlos aus auch aus der App aufrufen.

Ja aber man macht das nicht. Man(n) ("Frau" schreib ich, wenns hier eine gibt :D) will doch die offiziellen AVRCo-Funktionen nutzen.

Gern geschehn :).

Harry
jomixl
Benutzer
Avatar
Gender:
Posts: 223
Registered: 02 / 2008
Subject:

Re: LCD über PCF8574 / TWI ansteuern

 · 
Posted: 22.05.2019 - 08:51  ·  #10
hallo zusammen,
falls jemand Verwendung dafür hat hab ich mal mein Testprogramm angehängt.
Hab noch keine Idee warum der Aufruf von TWIstat in der LCDIOS zum Absturz führt.
Vielleicht kann Rolf noch dazu was sagen.

Gruß Joachim
Attachments
program LCDIOS;
{$LCDNOINIT}
{$NOSHADOW}
{ $WG} {global Warnings off}


Device = mega328p, VCC = 5;
{ $BOOTRST $03800} {Reset Jump to $03800}

define_fuses
Override_Fuses;
NoteBook = A;
COMport = USB;
LockBits0 = [];
FuseBits0 = [];
FuseBits1 = [];
FuseBits2 = [];

ProgFuses = true;
ProgLock = true;
ProgFlash = true;
ProgEEprom = true;
AutoRelease = true;


import SysTick, SerPort, TWImaster, LCDport;

from System import;


define
ProcClock = 16000000; {Hertz}
SysTick = 10; {msec}
StackSize = $0100, iData;
FrameSize = $0100, iData;

LCDport = LcdUserPort;
LCDtype = 44780; {66712}
LCDrows = 2; {2 rows}
LCDcolumns = 16; {16 chars per line}

TWIpresc = TWI_BR400;

SerPort = 19200, Stop2; {Baud, StopBits|Parity}
RxBuffer = 32, iData;
TxBuffer = 60, iData;


implementation

{$IDATA}

{--------------------------------------------------------------}
{ Type Declarations }

type


{--------------------------------------------------------------}
{ Const Declarations }
const
// this example uses the PCF8574 as an 8bit I/O port to the display
// the display is operated in 4bit mode
// the display control lines are connected to PCF8574 0..3
// the display data lines are connected to PCF8574 4..7

// Belegung des PCF8574(a)
// Achtung: es gibt wohl auch Displays die anders belegt sind !!
// HiNibble = Daten
// LowNibble = Steuerleitungen
En : byte = %0100;// Enable bit
Rw : byte = %0010;// Read/Write bit : 0= write
Rs : byte = %0001;// Register select bit : 0=Instruction Register
BL : byte = %1000;// Backlight on

// PCF8574 I2C address alle Address-Leitungen offen
// LcdAdr : byte = $27;
// PCF8574A I2C address alle Address-Leitungen offen
LcdAdr : byte = $3F;

{--------------------------------------------------------------}
Filename: lcdios.PAS
Filesize: 6.65 KB
Title: LCD mit TWI und LCDIOS
Download counter: 25
wilbo
Benutzer
Avatar
Gender:
Age: 67
Posts: 23
Registered: 11 / 2023
Subject:

Re: LCD über PCF8574 / TWI ansteuern

 · 
Posted: 07.01.2024 - 18:28  ·  #11
Hallo,
ich habe mir mal gestatet das einmal in einer Unit zu verpacken. Da ich mich erst in das Thema uC einarbeite war es ganz
lehrreich.
Attachments
Filename: PCF8574.zip
Filesize: 4.6 KB
Title:
Download counter: 7
  • 1
  • 2
  • Page 2 of 2
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 17 · Cache Hits: 15   67   82 · Page-Gen-Time: 0.025786s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI