Go Down

Topic: Are Four 74HC595 Sift-registers in a row too many? (Read 18281 times) previous topic - next topic

Grumpy_Mike

Quote
but when just opening the serial port nothing is sent yet, right?

Wrong, often there is a junk character when the port is first opened.

takao21106

I saw a post on the Hitech C forum, there was an extra I2C bit, someone hooked it up to a logic analyzer. We figured out it was due to wrong tristating sequence before initializing the serial port.

Setting the tristate right before writing to the serial port register, not after writing, solved the problem!

I have one project where instead of a LED 7seg display, I tried to install a 5x5 LED matrix. Driven through 2x 74hc595. However it is using 5 sink lines not 4 so the PCB is patched.

It was a nightmare (in assembler) just to get to a point displaying a pattern on the matrix!
I use C now (it's a year ago when I wrote it), but I know the experience, trying around for hours to archieve something very simple.

PaulJakob

Ok, thanks a lot guys!

I took the advice from CrossRoads and send now every 4th byte from Processing, which looks like this:

Code: [Select]

void loop(){

   if (Serial.available() > 3) {
     
     // shoot off feedback LED
     digitalWrite(feedbackLED,HIGH);
     
    // Register range from 0-3
    // Pins range from 0-7
    int arrivingByte = Serial.read();
    Serial.println(arrivingByte);
   
    int registerByte = 0; // will host the serial from processing
    int pinByte = 0; // will host the serial from processing
   
    // to do! find the right register+pin
   
    sendToRegister(registerByte, pinByte);
    // end and start again, so it doesn't get triggered by the serials used within the sendToRegister() function, which would start the Serial.available() again
    Serial.end();
    Serial.begin(9600);
  }
 
  digitalWrite(feedbackLED,LOW);
 
}

Grumpy_Mike

Code: [Select]
    Serial.end();
    Serial.begin(9600);

There is no need to do this.

spycatcher2k

Hi - I have a shield I designed and had made, its the ShiftShield32 , it uses 4 x 74hc595's chained together, and I use this library by Paulo Ricca(See Attached File).
Mrs Drew
-=-
http://www.uk-pcb.co.uk - UK PCB Fab Company
I will design & code for you, but I will also charge you (PM me)
If you don't like my answers, realize : I'm not being cheeky, I'm Just trying to prompt you to use your own brain/google etc.

Go Up