add use of annax board shift register reset input

This commit is contained in:
interfisch 2023-02-08 19:37:12 +01:00
parent 72cfa9aa64
commit b8d34ebd54
3 changed files with 17 additions and 2 deletions

View File

@ -23,6 +23,7 @@ D3 - _clear
//Pins connected to stuff on annax driver board //Pins connected to stuff on annax driver board
#define PIN_DATA_DRVBRD 33 #define PIN_DATA_DRVBRD 33
#define PIN_CLK_DRVBRD 32 #define PIN_CLK_DRVBRD 32
#define PIN_RESET_DRVBRD 15
//#define PIN_CLEAR 25 //active low //#define PIN_CLEAR 25 //active low

View File

@ -12,6 +12,7 @@ void Flipdot::init()
pinMode(PIN_DATA, OUTPUT); pinMode(PIN_DATA, OUTPUT);
pinMode(PIN_CLK, OUTPUT); pinMode(PIN_CLK, OUTPUT);
pinMode(PIN_OE, OUTPUT); pinMode(PIN_OE, OUTPUT);
pinMode(PIN_LATCH, OUTPUT); pinMode(PIN_LATCH, OUTPUT);
pinMode(PIN_CLEAR, OUTPUT); pinMode(PIN_CLEAR, OUTPUT);
pinMode(PIN_DRIVE, OUTPUT); pinMode(PIN_DRIVE, OUTPUT);
@ -19,12 +20,18 @@ void Flipdot::init()
pinMode(PIN_DATA_DRVBRD, OUTPUT); pinMode(PIN_DATA_DRVBRD, OUTPUT);
pinMode(PIN_CLK_DRVBRD, OUTPUT); pinMode(PIN_CLK_DRVBRD, OUTPUT);
pinMode(PIN_RESET_DRVBRD, OUTPUT);
digitalWrite(PIN_OE, HIGH); //Active Low digitalWrite(PIN_OE, HIGH); //Active Low
digitalWrite(PIN_LATCH, LOW); digitalWrite(PIN_LATCH, LOW);
digitalWrite(PIN_DRIVE, 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); delayMicroseconds(MICROS_DRIVEDOTCLEAR);
digitalWrite(PIN_CLEAR, LOW); digitalWrite(PIN_CLEAR, LOW);
digitalWrite(PIN_DRIVE, LOW); digitalWrite(PIN_DRIVE, LOW);
digitalWrite(PIN_RESET_DRVBRD,HIGH); //reset driverboard shift registers
return 1; return 1;
} }
@ -108,6 +117,8 @@ bool Flipdot::setSelectedDot() {
delayMicroseconds(MICROS_DRIVEDOTSET); //Drive Dot delayMicroseconds(MICROS_DRIVEDOTSET); //Drive Dot
digitalWrite(PIN_OE, HIGH); //Active Low digitalWrite(PIN_OE, HIGH); //Active Low
digitalWrite(PIN_DRIVE, LOW); digitalWrite(PIN_DRIVE, LOW);
digitalWrite(PIN_RESET_DRVBRD,HIGH); //reset driverboard shift registers
return 1; return 1;
} }
@ -125,8 +136,8 @@ bool Flipdot::HBridgeOK() {
return 1; 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 //select Rows via shift registers on own controller board
shiftOutSlow(PIN_DATA, PIN_CLK, LSBFIRST, row&0xff); //lower byte 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); delayMicroseconds(MICROS_SHIFT_LATCH);
digitalWrite(PIN_LATCH, LOW); digitalWrite(PIN_LATCH, LOW);
digitalWrite(PIN_RESET_DRVBRD,LOW); //get driverboard shift registers out of reset
//Select Columns via Shift registers //Select Columns via Shift registers
for (uint8_t i=0;i<COLUMNBYTES;i++) { //adsf: previously i<7 for (uint8_t i=0;i<COLUMNBYTES;i++) { //adsf: previously i<7
shiftOutSlow(PIN_DATA_DRVBRD, PIN_CLK_DRVBRD, LSBFIRST, col[COLUMNBYTES-1-i]); //asdf previously col·[6-i] shiftOutSlow(PIN_DATA_DRVBRD, PIN_CLK_DRVBRD, LSBFIRST, col[COLUMNBYTES-1-i]); //asdf previously col·[6-i]

View File

@ -160,6 +160,7 @@ void loop_drawClearTest() {
flipdot.setSelectedDot(); flipdot.setSelectedDot();
unsigned long shiftduration=micros()-starttime; unsigned long shiftduration=micros()-starttime;
Serial.println(""); Serial.println("");
Serial.print("Duration="); Serial.println(shiftduration); Serial.print("Duration="); Serial.println(shiftduration);