Hello colleagues!
Previously, you connected matrices from GKGD and Qiangli manufacturers with your help.
Now they have stopped selling matrices. And a new plant appeared - Unilumin.
They say the best in China. But I couldn't make this matrix work.
The board has SM16227 drivers and transistor assemblies. Scan frequency is 1/5.
Perhaps someone has already tried to work with these matrices?
Working test code for similar Qiangli matrices:
Display All
A red color from this code sometimes appears on the new matrix.
Help me deal with the code.
Previously, you connected matrices from GKGD and Qiangli manufacturers with your help.
Now they have stopped selling matrices. And a new plant appeared - Unilumin.
They say the best in China. But I couldn't make this matrix work.
The board has SM16227 drivers and transistor assemblies. Scan frequency is 1/5.
Perhaps someone has already tried to work with these matrices?
Working test code for similar Qiangli matrices:
Source Code
- $regfile = "m328def.dat"
- $crystal = 16000000
- $hwstack = 64 : $swstack = 64 : $framesize = 80
- Const Dy_num_h = 1
- Const Dy_num_v = 1
- Const Bytes_in_row = 5 * Dy_num_v
- Const Row_num = 20 * Dy_num_h
- Const Mem_size = Row_num * Bytes_in_row
- Const Mem_size_1 = Mem_size - 1
- Const Dy_offset = Dy_num_v * 100
- Const Channel_offset = 10 * Bytes_in_row
- Dim Last_x As Word , Max_y As Word
- Last_x = Dy_num_h * 20 : Last_x = Last_x -1
- Max_y = Dy_num_v * 40 : Max_y = Max_y -1
- '*** Pin for board 7 revision
- P_r1 Alias Portc.0 : Config P_r1 = Output
- P_g1 Alias Portc.1 : Config P_g1 = Output
- P_b1 Alias Portc.2 : Config P_b1 = Output
- P_r2 Alias Portc.3 : Config P_r2 = Output
- P_g2 Alias Portc.4 : Config P_g2 = Output
- P_b2 Alias Portc.5 : Config P_b2 = Output
- Dout_port Alias Portc
- Const Dout_pin_r1 = Pc0
- Const Dout_pin_g1 = Pc1
- Const Dout_pin_b1 = Pc2
- Const Dout_pin_r2 = Pc3
- Const Dout_pin_g2 = Pc4
- Const Dout_pin_b2 = Pc5
- P_a Alias Portd.3 : Config P_a = Output
- P_b Alias Portd.4 : Config P_b = Output
- P_c Alias Portd.5 : Config P_c = Output
- P_d Alias Portd.6 : Config P_d = Output
- P_ckl Alias Portb.5 : Config P_ckl = Output : Shift_clock_port Alias Portb : Const Shift_clock_pin = Pb5
- P_lat Alias Portb.3 : Config P_lat = Output
- P_oe Alias Portb.2 : Config P_oe = Output
- '***
- Config Base = 0
- Const Timer0reload = 150
- Config Timer0 = Timer , Prescale = 256
- Load Timer0 , Timer0reload
- On Ovf0 Display_refresh
- Enable Ovf0
- Start Timer0
- 'PWM ************************************************** *************************
- Config Timer1 = Pwm , Pwm = 8 , Compare_b_pwm = Clear_down , Prescale = 1
- '************************************************* ******************************
- Declare Sub Shift6out_4h(byreg R18 As Byte , Byreg R19 As Byte , Byreg R20 As Byte , Byreg R21 As Byte , Byreg R22 As Byte , Byreg R23 As Byte )
- Declare Sub Shift6out_4l(byreg R18 As Byte , Byreg R19 As Byte , Byreg R20 As Byte , Byreg R21 As Byte , Byreg R22 As Byte , Byreg R23 As Byte )
- Dim Memory_red(mem_size) As Byte , Memory_green(mem_size) As Byte , Memory_blue(mem_size) As Byte
- Dim Brightness As Byte , N_1 As Word
- Dim Red As Byte , Green As Byte , Blue As Byte , Yellow As Byte , Magenta As Byte , Cyan As Byte , White As Byte
- Red = 1 : Green = 2 : Yellow = 3 : Blue = 4 : Magenta = 5 : Cyan = 6 : White = 7
- Dim Page As Byte , Mem_offset_1 As Word , Mem_offset_3 As Word
- Dim R_0 As Byte , B_1 As Byte
- Dim St_byte_1 As Word , St_byte_2 As Word , St_byte_3 As Word , St_byte_4 As Word
- Dim Trigger As Bit
- Dim One_bit As Byte
- Page = 0
- One_bit = 1
- Enable Interrupts
- Brightness = 250
- Gosub Clear_memory
- 'Memory_red(0) = 255
- Do
- ' (
- Gosub Cl_green
- Wait 1
- Gosub Clear_memory
- Gosub Cl_red
- Wait 1
- Gosub Clear_memory
- Gosub Cl_blue
- Wait 1
- Gosub Clear_memory
- ' )
- Loop
- End
- Cl_red:
- For N_1 = 0 To Mem_size_1
- Memory_red(n_1) = 255
- Next N_1
- Return
- Cl_blue:
- For N_1 = 0 To Mem_size_1
- Memory_blue(n_1) = 255
- Next N_1
- Return
- Cl_green:
- For N_1 = 0 To Mem_size_1
- Memory_green(n_1) = 255
- Next N_1
- Return
- Clear_memory:
- For N_1 = 0 To Mem_size_1
- Memory_red(n_1) = 0
- Memory_green(n_1) = 0
- Memory_blue(n_1) = 0
- Next N_1
- Return
- Load_test:
- For N_1 = 0 To Mem_size_1
- Memory_red(n_1) = Lookup(n_1 , Rr1)
- Next N_1
- Return
- Display_refresh:
- Load Timer0 , Timer0reload
- $asm
- Lds r17, {page}
- Inc r17
- CPI r17,5
- brlo pageok
- clr r17
- Pageok:
- sts {page},r17
- $end Asm
- Mem_offset_1 = Page * Bytes_in_row
- Mem_offset_3 = 5 + Page
- Mem_offset_3 = Mem_offset_3 * Bytes_in_row
- For R_0 = 1 To Dy_num_h
- St_byte_1 = Mem_offset_3 : St_byte_2 = St_byte_1 + Channel_offset
- St_byte_3 = Mem_offset_1 : St_byte_4 = St_byte_3 + Channel_offset
- For B_1 = 1 To Bytes_in_row
- Shift6out_4h Memory_red(st_byte_1) , Memory_green(st_byte_1) , Memory_blue(st_byte_1) , Memory_red(st_byte_2) , Memory_green(st_byte_2) , Memory_blue(st_byte_2)
- Shift6out_4h Memory_red(st_byte_3) , Memory_green(st_byte_3) , Memory_blue(st_byte_3) , Memory_red(st_byte_4) , Memory_green(st_byte_4) , Memory_blue(st_byte_4)
- Shift6out_4l Memory_red(st_byte_1) , Memory_green(st_byte_1) , Memory_blue(st_byte_1) , Memory_red(st_byte_2) , Memory_green(st_byte_2) , Memory_blue(st_byte_2)
- Shift6out_4l Memory_red(st_byte_3) , Memory_green(st_byte_3) , Memory_blue(st_byte_3) , Memory_red(st_byte_4) , Memory_green(st_byte_4) , Memory_blue(st_byte_4)
- St_byte_1 = St_byte_1 + 1
- St_byte_2 = St_byte_2 + 1
- St_byte_3 = St_byte_3 + 1
- St_byte_4 = St_byte_4 + 1
- Next B_1
- Mem_offset_1 = Mem_offset_1 + Dy_offset
- Mem_offset_3 = Mem_offset_3 + Dy_offset
- Next R_0
- Pwm1b = 0
- Waitus 60
- P_lat = 1 : P_lat = 0
- P_a = Page.0
- P_b = Page.1
- P_c = Page.2
- Pwm1b = Brightness
- Trigger = 1
- Return
- ' R1 G1 B1 R2 G2 B2
- Sub Shift6out_4h(byreg R18 As Byte , Byreg R19 As Byte , Byreg R20 As Byte , Byreg R21 As Byte , Byreg R22 As Byte , Byreg R23 As Byte )
- 'bit7 first to bit4
- $asm
- LDI r17,4
- Loop_shift2out_h:
- in R16, dout_port
- BST r18,7
- BLD r16,Dout_pin_r1
- BST r19,7
- bld r16,Dout_pin_g1
- BST r20,7
- bld r16,Dout_pin_b1
- BST r21,7
- BLD r16,Dout_pin_r2
- BST r22,7
- bld r16,Dout_pin_g2
- BST r23,7
- bld r16,Dout_pin_b2
- LSl r18
- LSl r19
- lsl r20
- lsl r21
- lsl r22
- lsl r23
- Out Dout_port , R16
- SBI shift_clock_Port, shift_clock_Pin
- dec r17
- CBI shift_clock_Port, shift_clock_Pin
- BRnE loop_shift2out_h ; if = 0 exit
- $end Asm
- End Sub
- Sub Shift6out_4l(byreg R18 As Byte , Byreg R19 As Byte , Byreg R20 As Byte , Byreg R21 As Byte , Byreg R22 As Byte , Byreg R23 As Byte )
- 'bit3 first to bit0
- $asm
- LDI r17,4
- Loop_shift2out_l:
- in R16, dout_port
- BST r18,3
- BLD r16,Dout_pin_r1
- BST r19,3
- bld r16,Dout_pin_g1
- BST r20,3
- bld r16,Dout_pin_b1
- BST r21,3
- BLD r16,Dout_pin_r2
- BST r22,3
- bld r16,Dout_pin_g2
- BST r23,3
- bld r16,Dout_pin_b2
- LSl r18
- LSl r19
- lsl r20
- lsl r21
- lsl r22
- lsl r23
- Out Dout_port , R16
- SBI shift_clock_Port, shift_clock_Pin
- dec r17
- CBI shift_clock_Port, shift_clock_Pin
- BRnE loop_shift2out_l ; if = 0 exit
- $end Asm
- End Sub
- Rr1:
- Data 255 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
- Data 0 , 0 , 0 , 0 , 0
Help me deal with the code.