From b8d34ebd54d3c247740a5e645ba7a307054cee7d Mon Sep 17 00:00:00 2001 From: Fisch Date: Wed, 8 Feb 2023 19:37:12 +0100 Subject: [PATCH] add use of annax board shift register reset input --- flipcontrol_esp32/include/flipdot.h | 1 + flipcontrol_esp32/src/flipdot.cpp | 17 +++++++++++++++-- flipcontrol_esp32/src/main.cpp | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/flipcontrol_esp32/include/flipdot.h b/flipcontrol_esp32/include/flipdot.h index 780ffdb..d62e85d 100644 --- a/flipcontrol_esp32/include/flipdot.h +++ b/flipcontrol_esp32/include/flipdot.h @@ -23,6 +23,7 @@ D3 - _clear //Pins connected to stuff on annax driver board #define PIN_DATA_DRVBRD 33 #define PIN_CLK_DRVBRD 32 +#define PIN_RESET_DRVBRD 15 //#define PIN_CLEAR 25 //active low diff --git a/flipcontrol_esp32/src/flipdot.cpp b/flipcontrol_esp32/src/flipdot.cpp index b03915c..8e38c11 100644 --- a/flipcontrol_esp32/src/flipdot.cpp +++ b/flipcontrol_esp32/src/flipdot.cpp @@ -12,6 +12,7 @@ void Flipdot::init() pinMode(PIN_DATA, OUTPUT); pinMode(PIN_CLK, OUTPUT); pinMode(PIN_OE, OUTPUT); + pinMode(PIN_LATCH, OUTPUT); pinMode(PIN_CLEAR, OUTPUT); pinMode(PIN_DRIVE, OUTPUT); @@ -19,12 +20,18 @@ void Flipdot::init() pinMode(PIN_DATA_DRVBRD, OUTPUT); pinMode(PIN_CLK_DRVBRD, OUTPUT); + pinMode(PIN_RESET_DRVBRD, OUTPUT); digitalWrite(PIN_OE, HIGH); //Active Low + digitalWrite(PIN_LATCH, LOW); digitalWrite(PIN_DRIVE, LOW); + + digitalWrite(PIN_RESET_DRVBRD,HIGH); //high = reset. set low to enable data flow to driverboard shift registers + + } @@ -83,6 +90,8 @@ bool Flipdot::clearSelectedColumn() { delayMicroseconds(MICROS_DRIVEDOTCLEAR); digitalWrite(PIN_CLEAR, LOW); digitalWrite(PIN_DRIVE, LOW); + + digitalWrite(PIN_RESET_DRVBRD,HIGH); //reset driverboard shift registers return 1; } @@ -108,6 +117,8 @@ bool Flipdot::setSelectedDot() { delayMicroseconds(MICROS_DRIVEDOTSET); //Drive Dot digitalWrite(PIN_OE, HIGH); //Active Low digitalWrite(PIN_DRIVE, LOW); + + digitalWrite(PIN_RESET_DRVBRD,HIGH); //reset driverboard shift registers return 1; } @@ -125,8 +136,8 @@ bool Flipdot::HBridgeOK() { return 1; } -void Flipdot::shiftData() { //send out all data to shift registers - + +void Flipdot::shiftData() { //send out all data to shift registers //select Rows via shift registers on own controller board shiftOutSlow(PIN_DATA, PIN_CLK, LSBFIRST, row&0xff); //lower byte @@ -135,6 +146,8 @@ void Flipdot::shiftData() { //send out all data to shift registers delayMicroseconds(MICROS_SHIFT_LATCH); digitalWrite(PIN_LATCH, LOW); + digitalWrite(PIN_RESET_DRVBRD,LOW); //get driverboard shift registers out of reset + //Select Columns via Shift registers for (uint8_t i=0;i