"The only hurdle I see really is that I'm not sure if the Arduinos Wire library will work with it."
Do you (or anybody else) know if there is another library I could use instead?
//Use Wire Library to do I2C communication
#include <Wire.h>
/***** Function to write commands and data to I2C bus ***************************/
uint8_t I2C_write(uint8_t command, uint8_t data)
{
Wire.beginTransmission(AS1130ADDRESS);
Wire.write(command);
Wire.write(data);
int ack = Wire.endTransmission();
#ifdef DEBUG
if (ack != 0)
{
Serial.print("Error: ");
Serial.print(ack);
Serial.print("\r\n");
}
#endif
return ack;
}
/***** Start-up sequence as per datasheet - see Page 13 ******************************/
// (1) define ram configuration - see table 20 page 25
// (2) Fill the On/Off Frames with our data
// (3) Set-up Blink & PWM sets
// (4) Set-up Dot Correction (if required)
// (5) Define Control Registers - see table 13 page 20
// (6) Define Current Source (0 to 30mA) - see table 19 page 24
// (7) Define Display Options
// (8) Start Display (Picture or Movie) Movie takes precedence over Picture
The above answers every question you asked to start with and is all taken from my example code.
And if I use four AS1130 to build a 11x48 Matrix, how do I have to connect the Sync Pins?
- I'll do it like in the datasheet, on p.32 Figure 27., that there is only one Sync-Pin configured as Sync_Out and the other three AS1130 are Sync_In and then the Sync_Out is connected to the three Sync_In? But that means that the clock speed will decrease?!
Therefore I have a 2. solution: To configure every Sync Pin of the four devices as Sync_Out that each of them works (with their own oscillator) independent from the others ?
You need to understand what the sync does.
How do you conclude that the clock speed will decrease? :~
GOLDEN RULE: If it says it in the datasheet...it is 99.9999999% the way it's GOT to be done.
In the Datasheet is written: "After a first write of data to the frames, the configuration is locked in the AS1130 config register and can be changed only after a reset of the device. A change of the RAM configuration requires to re-write the frame datasets."
That is refering to the RAM configuration. You have to choose at setup time which configuration you want (1-6) For example you can have 36 frames and 1 PWM set or 18 frames and 4 PWM sets etc.
See Table 8 in the datasheet.
A soft reset can be performed using the Shutdown register...Table 23 but I have a reset button because I am developing software and want to ensure that all the data etc is cleared on restart.