![]() PORTC &= ~(1 << binary_pins) //master reset PORTC &= ~(1 << binary_pins) //latch to LOW bevor filling memory PORTA |= (1 << binary_pins) //master reset 1 ![]() PORTA &= ~(1 << binary_pins) //master reset 0 PORTA &= ~(1 << binary_pins) //latch to 0 bevor filling memory PORTC = (_bit) ? PORTC | (1 << binary_pins) : PORTC & ~(1 << binary_pins) //data PORTA = (_bit) ? PORTA | (1 << binary_pins) : PORTA & ~(1 << binary_pins) //data PORTA |= (1 << binary_pins) //latch to 1 causes to display the register Serial.readBytes(serial_from_max, serial_length) īyte index = byte(serial_from_max) byte val = byte(serial_from_max) įor(int _bit=0 _bit> _bit) & 1, _row) //read bit per bit the serial message row 3 data, clock, latch, master reset, pwm_b1, pwm_b2, pwm_b3, control inīoolean phrase_check // array to verifie if the register was completely filled with bits 0 or 1 Ĭhar serial_from_max Here is the Arduino-code: const int row_count = 4 //count of rowsĬonst int blk_count = 3 //count of block per rowĬonst int dpb_count = 6 //count of digits per blockĬonst int pin_count = 8 //count of pins used per row When I am setting the PWM signal on setup of the Arduino (not chaining it on runtime) everything is working fine. I can't explain how this is happening, it seems that the PWM signal is affecting the pins for the shift register. ![]() If a PWM-change is needed MAX MSP will wait until the the actual row is finished and then send the PWM control-message before continuing with the next row.Īt this point everything is getting out of control: either the segments of the digits are lightened more or less randomly or the entire row is flickering and jumping around. ![]() first byte for index of the block and second byte for the PWM-value. Luminosity uses also the control message type of two bytes. My problem is that I will need to change luminosity on runtime. This is working at the highest speed I can get, at about 15 milliseconds for updating one row.Įverything is working fine until this point. And this way it is iterating through the 4 rows. When the shift register is filled up Arduino returns 255 to indicate that the action has been executed and setting back the serial buffer to 2 bytes. Than MAX MSP sends back the content message up to 18 bytes to fill the digits of row. Then Arduino will adjust the serial buffer to the needed size of the next content message and sending an ready-message to MAX MSP. The control message sends an index for the next row to be updated and the number of digits consisting the content message. content message, up to 18 bytes (depending on how many digits are active in a row).Serial communication is structured as follow: the numbers displayed on the screens are generated in realtime using MAX MSP and transmitted by serial port to the Arduino.each block of 6 digits has a PWM signal in order to change luminosity of the screens.every row uses 4 pins on the Arduino Mega 2560 (data, clock, latch, master reset).4 rows of 18 digits (consisting 3 blocks of 6 digits).I am using an Arduino Mega 2560 to control 72 high-powered LED 7 segment displays with 72 shift register (74HC595) driving transistors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |