
48-CHANNEL, 16-BIT PWM LED DRIVER
Lumissil Microsystems – www.lumissil.com 9
Rev. A, 12/19/2022
APPENDIX Ⅰ: IS32FL3248 Arduino Test Code VSB V01A
#include<SPI.h>
#include<avr/pgmspace.h>
uint8_t PWM_data[96];
uint8_t SL_data[48];
uint8_t FC1_data[6]={0x00,0x00,0x03,0xB1,0x00,0xBA};
uint8_t FC0_data[6]={0x00,0x00,0x0B,0xFF,0xFF,0xFF};
const int slaveSelectPin = 10;
byte PWM_Gamma64[64]=
{
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x08,0x09,0x0b,0x0d,0x0f,0x11,0x13,0x16,
0x1a,0x1c,0x1d,0x1f,0x22,0x25,0x28,0x2e,
0x34,0x38,0x3c,0x40,0x44,0x48,0x4b,0x4f,
0x55,0x5a,0x5f,0x64,0x69,0x6d,0x72,0x77,
0x7d,0x80,0x88,0x8d,0x94,0x9a,0xa0,0xa7,
0xac,0xb0,0xb9,0xbf,0xc6,0xcb,0xcf,0xd6,
0xe1,0xe9,0xed,0xf1,0xf6,0xfa,0xfe,0xff
};
void setup()
{
// put your setup code here, to run once:
// set the slaveSelectPin as an output:
pinMode (slaveSelectPin, OUTPUT);
// initialize SPI:
SPI.begin();
SPI.beginTransaction(SPISettings(20000000, MSBFIRST, SPI_MODE0));
//SPI.setClockDivider(SPI_CLOCK_DIV4);
SPI.setDataMode(3);
pinMode(4,OUTPUT);//SDB
digitalWrite(4,HIGH);//SDB_HIGH
Init3248();
}
void loop()
{
// put your main code here, to run repeatedly:
IS32FL3248_mode1();
}
void VSB_WriteBuffer(uint8_t* pBuffer, int length_dat, uint8_t Dev_Add)
{
digitalWrite(slaveSelectPin, LOW); // take the SS pin low to select the chip:
SPI.transfer(Dev_Add); // send in the address and value via SPI:
while(length_dat--)
{
SPI.transfer(*pBuffer);
pBuffer++;
}
digitalWrite(slaveSelectPin, HIGH); // take the SS pin high to de-select the chip:
}
// SET the Scaling Register//
void SL_set(uint8_t byte1)
{
uint8_t i;
for(i=0;i<48;i+=2)
{
SL_data[i] = byte1;
}
VSB_WriteBuffer(SL_data,48,0x40);// DC SL
}
void FL3248_FC0_set(uint8_t byte6,uint8_t byte5,uint8_t byte4,uint8_t byte3,uint8_t byte2,uint8_t byte1)
{
FC0_data[0] = byte6;//BIT41-48
FC0_data[1] = byte5;
FC0_data[2] = byte4;
FC0_data[3] = byte3;
FC0_data[4] = byte2;