RGB Matrix module 20x40 1/5 scan GKGD - error of display of the image

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    Aufgrund technischer Veränderungen ist der Mailverkehr innerhalb des Forums (Private Nachrichten) nur noch eingeschränkt möglich. Die Einschränkung ist notwendig, um zusätzliche Betriebskosten für das Forum zu vermeiden. Näheres zu den Hintergründen im Thread "Aktuelles zum Forum".Wir bitten um Verständnis.

    Hinweis kann nach Kenntnisnahme deaktiviert werden!

    • Code that shows numbers without flickering

      Quellcode

      1. '20x40 Ledmatrixes RGB, 1_5 scan
      2. $regfile = "m328def.dat"
      3. $crystal = 16000000
      4. $hwstack = 40
      5. $swstack = 16
      6. $framesize = 32
      7. Const Dy_num_h = 1 'displays in a horizontal direction
      8. Const Dy_num_v = 1 'displays in the vertical direction
      9. Const Bytes_in_row = 5 * Dy_num_v
      10. Const Row_num = 20 * Dy_num_h
      11. Const Row_num1 = Row_num - 1
      12. Const Mem_size = Row_num * Bytes_in_row
      13. Const Mem_size_1 = Mem_size - 1
      14. Const Dy_offset = Dy_num_v * 100
      15. Const Channel_offset = 10 * Bytes_in_row
      16. P_r1 Alias Portd.5 : Config P_r1 = Output : Dout_port_r1 Alias Portd : Const Dout_pin_r1 = Pd5
      17. P_g1 Alias Portd.7 : Config P_g1 = Output : Dout_port_g1 Alias Portd : Const Dout_pin_g1 = Pd7
      18. P_b1 Alias Portd.6 : Config P_b1 = Output : Dout_port_b1 Alias Portd : Const Dout_pin_b1 = Pd6
      19. P_r2 Alias Portc.4 : Config P_r2 = Output : Dout_port_r2 Alias Portc : Const Dout_pin_r2 = Pc4
      20. P_g2 Alias Portc.3 : Config P_g2 = Output : Dout_port_g2 Alias Portc : Const Dout_pin_g2 = Pc3
      21. P_b2 Alias Portc.2 : Config P_b2 = Output : Dout_port_b2 Alias Portc : Const Dout_pin_b2 = Pc2
      22. P_a Alias Portc.0 : Config P_a = Output
      23. P_b Alias Portc.1 : Config P_b = Output
      24. P_c Alias Portb.0 : Config P_c = Output
      25. P_ckl Alias Portb.5 : Config P_ckl = Output
      26. P_lat Alias Portb.3 : Config P_lat = Output
      27. P_oe Alias Portb.2 : Config P_oe = Output
      28. Shift_clock_port Alias Portb : Const Shift_clock_pin = Pb5
      29. Config Base = 0
      30. Const Timer2reload = 71000
      31. Config Timer2 = Timer , Prescale = 256
      32. Load Timer2 , Timer2reload
      33. On Ovf2 Display_refresh
      34. Enable Ovf2
      35. Start Timer2
      36. 'PWM ************************************************** *************************
      37. Config Timer1 = Pwm , Pwm = 8 , Compare B Pwm = Clear Down , Prescale = 1
      38. '************************************************* ******************************
      39. Dim Memory_red(mem_size) As Byte , Memory_green(mem_size) As Byte , Memory_blue(mem_size) As Byte 'memory red/green
      40. Dim Page_counter As Byte
      41. Dim D_1 As Word
      42. Dim Index_1 As Word , Index_2 As Word
      43. Dim Character_column As Byte
      44. Dim Font_byte_low As Byte
      45. Dim N_1 As Word
      46. Dim M_1 As Word , M_2 As Word , M_22 As Word
      47. Dim Sign As String * 1
      48. Dim Tab_start As Word 'Startwert der Fonttabelle
      49. Dim X1 As Word
      50. Dim Inverting As Bit
      51. Dim Speed As Word
      52. Dim Text As String * 15
      53. Dim Max_baseline As Word
      54. Dim Startbyte_low As Word , Bit_num As Byte
      55. Dim Trigger As Bit
      56. Dim Inv1 As Bit , Inv As Bit
      57. Dim Color As Byte , Red As Byte , Green As Byte , Blue As Byte , Yellow As Byte , Magenta As Byte , Cyan As Byte , White As Byte
      58. Dim Brightness As Byte
      59. Declare Sub Shift6out(byreg R18 As Byte , Byreg R19 As Byte , Byreg R20 As Byte , Byreg R21 As Byte , Byreg R22 As Byte , Byreg R23 As Byte )
      60. Declare Sub Set_text_6_8(byval X As Word , Byval Y As Word , Byval Color As Byte)
      61. Red = 1 : Green = 2 : Yellow = 3 : Blue = 4 : Magenta = 5 : Cyan = 6 : White = 7
      62. '**************************************************
      63. 'user settings
      64. Inverting = 0
      65. '**************************************************
      66. Dim H As Byte , B_1 As Byte
      67. Brightness = 250
      68. Gosub Clear_memory
      69. Enable Interrupts
      70. Text = "374 2"
      71. Call Set_text_6_8(0 , 0 , Green)
      72. 'for B_1 = 1 To 99
      73. ' Memory_green(b_1) = B_1
      74. 'Next
      75. Do
      76. Loop
      77. End
      78. Display_refresh:
      79. Load Timer2 , Timer2reload
      80. If Page_counter < 4 Then
      81. Incr Page_counter
      82. Else
      83. Page_counter = 0
      84. End If
      85. Index_1 = 5 - Page_counter
      86. For D_1 = 1 To 9
      87. Index_2 = Index_1 + 5
      88. Shift6out Memory_red(index_2) , Memory_green(index_2) , Memory_blue(index_2) , Memory_red(index_1) , Memory_green(index_1) , Memory_blue(index_1)
      89. Index_1 = Index_1 + 10
      90. Next D_1
      91. Pwm1b = 0
      92. Waitus 100
      93. P_lat = 1 : P_lat = 0
      94. P_a = Page_counter.0
      95. P_b = Page_counter.1
      96. P_c = Page_counter.2
      97. Pwm1b = Brightness
      98. Trigger = 1
      99. Return
      100. ' R1 G1 B1 R2 G2 B2
      101. Sub Shift6out(byreg R18 As Byte , Byreg R19 As Byte , Byreg R20 As Byte , Byreg R21 As Byte , Byreg R22 As Byte , Byreg R23 As Byte )
      102. $asm
      103. LDI r17,8
      104. Loop_shift2out:
      105. in R16, dout_port_r1
      106. BST r18,0
      107. BLD r16,Dout_pin_r1
      108. Out Dout_port_r1 , R16
      109. in R16, dout_port_g1
      110. BST r19,0
      111. bld r16,Dout_pin_g1
      112. Out Dout_port_g1 , R16
      113. in R16, dout_port_b1
      114. BST r20,0
      115. bld r16,Dout_pin_b1
      116. Out Dout_port_b1 , R16
      117. in R16, dout_port_r2
      118. BST r21,0
      119. BLD r16,Dout_pin_r2
      120. Out Dout_port_r2 , R16
      121. in R16, dout_port_g2
      122. BST r22,0
      123. bld r16,Dout_pin_g2
      124. Out Dout_port_g2 , R16
      125. in R16, dout_port_b2
      126. BST r23,0
      127. bld r16,Dout_pin_b2
      128. Out Dout_port_b2 , R16
      129. SBI shift_clock_Port, shift_clock_Pin
      130. LSR r18
      131. LSR r19
      132. lsr r20
      133. lsr r21
      134. lsr r22
      135. lsr r23
      136. dec r17
      137. CBI shift_clock_Port, shift_clock_Pin
      138. BRnE loop_shift2out
      139. $end Asm
      140. End Sub
      141. Clear_memory:
      142. For N_1 = 0 To Mem_size_1
      143. Memory_red(n_1) = 0
      144. Memory_green(n_1) = 0
      145. Memory_blue(n_1) = 0
      146. Next N_1
      147. Return
      148. Sub Set_text_6_8(byval X As Word , Byval Y As Word , Byval Color As Byte)
      149. Local Col As Word
      150. '6x8font
      151. Max_baseline = Row_num - 8
      152. If Y > Max_baseline Then Y = Max_baseline
      153. Inv1 = Inverting Xor Inv
      154. For M_1 = 1 To Len(text)
      155. Sign = Mid(text , M_1 , 1) 'Only one letter
      156. Tab_start = Asc(sign)
      157. Tab_start = Tab_start - 32
      158. Tab_start = Tab_start * 6 'Starting point in the font table
      159. For Character_column = 0 To 5
      160. Bit_num = X Mod 8 'bit-number of byte
      161. Col = X / 8 'number of column
      162. Startbyte_low = Col * Row_num
      163. Startbyte_low = Startbyte_low + Y
      164. If Startbyte_low > Mem_size_1 Then Exit Sub 'there is no space, you are ready
      165. X1 = Tab_start + Character_column
      166. Font_byte_low = Lookup(x1 , Font_6x8)
      167. For M_2 = 0 To 7
      168. M_22 = Startbyte_low + M_2
      169. If Color.0 = 1 Then 'red
      170. If Inv1 = 1 Then
      171. Memory_red(m_22).bit_num = Not Font_byte_low.m_2
      172. Else
      173. Memory_red(m_22).bit_num = Font_byte_low.m_2
      174. End If
      175. Else
      176. Memory_red(m_22).bit_num = Inverting
      177. End If
      178. If Color.1 = 1 Then 'green
      179. If Inv1 = 1 Then
      180. Memory_green(m_22).bit_num = Not Font_byte_low.m_2
      181. Else
      182. Memory_green(m_22).bit_num = Font_byte_low.m_2
      183. End If
      184. Else
      185. Memory_green(m_22).bit_num = Inverting
      186. End If
      187. If Color.2 = 1 Then 'blue
      188. If Inv1 = 1 Then
      189. Memory_blue(m_22).bit_num = Not Font_byte_low.m_2
      190. Else
      191. Memory_blue(m_22).bit_num = Font_byte_low.m_2
      192. End If
      193. Else
      194. Memory_blue(m_22).bit_num = Inverting
      195. End If
      196. Next M_2
      197. Incr X
      198. Next Character_column
      199. Next M_1
      200. End Sub
      201. Font_6x8:
      202. Data 0 , 0 , 0 , 0 , 0 , 0 ' <SPACE>
      203. Data 0 , 0 , 96 , 250 , 96 , 0 ' !
      204. Data 0 , 224 , 192 , 0 , 224 , 192 ' "
      205. Data 0 , 48 , 64 , 254 , 64 , 48 ' #
      206. Data 0 , 24 , 4 , 254 , 4 , 24 ' $
      207. Data 0 , 16 , 56 , 84 , 84 , 16 ' %
      208. Data 0 , 16 , 84 , 84 , 56 , 16 ' &
      209. Data 0 , 0 , 224 , 192 , 0 , 0 ' <ZAP>
      210. Data 48 , 96 , 255 , 255 , 96 , 48 ' (
      211. Data 12 , 6 , 255 , 255 , 6 , 12 ' )
      212. Data 24 , 60 , 126 , 90 , 24 , 24 ' *
      213. Data 16 , 16 , 124 , 16 , 16 , 0 ' +
      214. Data 0 , 0 , 7 , 6 , 0 , 0 ' ,
      215. Data 0 , 16 , 16 , 16 , 16 , 16 ' -
      216. Data 0 , 0 , 6 , 6 , 0 , 0 ' .
      217. Data 2 , 4 , 8 , 16 , 32 , 64 ' /
      218. Data 0 , 124 , 138 , 146 , 162 , 124 ' 0
      219. Data 0 , 0 , 66 , 254 , 2 , 0 ' 1
      220. Data 0 , 70 , 138 , 146 , 146 , 98 ' 2
      221. Data 0 , 68 , 146 , 146 , 146 , 108 ' 3
      222. Data 0 , 24 , 40 , 72 , 254 , 8 ' 4
      223. Data 0 , 228 , 162 , 162 , 162 , 156 ' 5
      224. Data 0 , 60 , 82 , 146 , 146 , 12 ' 6
      225. Data 0 , 192 , 142 , 144 , 160 , 192 ' 7
      226. Data 0 , 108 , 146 , 146 , 146 , 108 ' 8
      227. Data 0 , 96 , 146 , 146 , 148 , 120 ' 9
      Alles anzeigen
      image_12.jpg
    • The numbers dont use high mem
      Try Text = "374 21"
      But it ditn't send mem higher then 80
      We shoud test all mem
      My be this dont overrun:

      Quellcode

      1. Display_refresh:
      2. Load Timer2 , Timer2reload
      3. If Page_counter < 7 Then
      4. Incr Page_counter
      5. Else
      6. Page_counter = 0
      7. End If
      8. Index_1 = 7 - Page_counter
      9. For D_1 = 1 To 5
      10. Index_2 = Index_1 + 5
      11. Shift6out Memory_red(index_2) , Memory_green(index_2) , Memory_blue(index_2) , Memory_red(index_1) , Memory_green(index_1) , Memory_blue(index_1)
      12. Index_1 = Index_1 + 10
      13. Next D_1
      14. Pwm1b = 0
      15. Waitus 100
      16. P_lat = 1 : P_lat = 0
      17. P_a = Page_counter.0
      18. P_b = Page_counter.1
      19. P_c = Page_counter.2
      20. Pwm1b = Brightness
      21. Trigger = 1
      22. Return
      Alles anzeigen

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Pluto25 ()

    • Quellcode

      1. Display_refresh:
      2. Load Timer2 , Timer2reload
      3. If Page_counter < 4 Then
      4. Incr Page_counter
      5. Else
      6. Page_counter = 0
      7. End If
      8. Index_1 = 5 - Page_counter
      9. For D_1 = 1 To 9
      10. Index_2 = Index_1 + 5
      11. Shift6out Memory_red(index_2) , Memory_green(index_2) , Memory_blue(index_2) , Memory_red(index_1) , Memory_green(index_1) , Memory_blue(index_1)
      12. Index_1 = Index_1 + 10
      13. Next D_1
      14. Pwm1b = 0
      15. Waitus 100
      16. P_lat = 1 : P_lat = 0
      17. P_a = Page_counter.0
      18. P_b = Page_counter.1
      19. P_c = Page_counter.2
      20. Pwm1b = Brightness
      21. Trigger = 1
      22. Return
      Alles anzeigen
      image_14.jpg

      and For D_1 = 1 To 10
      image_15.jpg

      Why pages 8? This matrix has a 1/5 scan
      Dateien
      • image_14.jpg

        (282,06 kB, 2 mal heruntergeladen, zuletzt: )
      • image_15.jpg

        (291,45 kB, 1 mal heruntergeladen, zuletzt: )
    • ich mein halt der index_1 kann nie 0 werden. Ist blöd, wenn damit eine Stelle im Bildspeicher indiziert wird, der mit 0 anfängt. Und wo wjrd das 10. Byte übertragen?
      Raum für Notizen

      -----------------------------------------------------------------------------------------------------

      -----------------------------------------------------------------------------------------------------
    • SAMEGO schrieb:

      Why pages 8? This matrix has a 1/5 scan
      It inst a Quiang Li. It works different and it overloaded with 9. byte, the 10th you killed. If you send it, it crashes more? You tested it?

      tschoeatsch schrieb:

      index_1 kann nie 0 werden
      config base = 0 ist nicht mehr da daher fängt der index mit 1 an. Ist lästig den Speicher zu lesen wenn immer um eins umgedacht werden muß.


      SAMEGO schrieb:

      Where does the index_1 have 0 here?
      In first version you have config base = 0 - later it was gone.

      Which Code resulds image_15?

      Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von Pluto25 ()

    • Pluto25 schrieb:

      Please use this code with filled mem from 1 to 100

      Quellcode

      1. For B_1 = 1 To 99
      2. Memory_green(b_1) = B_1
      3. Next



      Quellcode

      1. Display_refresh:
      2. Load Timer2 , Timer2reload
      3. If Page_counter < 7 Then
      4. Incr Page_counter
      5. Else
      6. Page_counter = 0
      7. End If
      8. Index_1 = 7 - Page_counter
      9. For D_1 = 1 To 5
      10. Index_2 = Index_1 + 5
      11. Shift6out Memory_red(index_2) , Memory_green(index_2) , Memory_blue(index_2) , Memory_red(index_1) , Memory_green(index_1) , Memory_blue(index_1)
      12. Index_1 = Index_1 + 10
      13. Next D_1
      14. Pwm1b = 0
      15. Waitus 100
      16. P_lat = 1 : P_lat = 0
      17. P_a = Page_counter.0
      18. P_b = Page_counter.1
      19. P_c = Page_counter.2
      20. Pwm1b = Brightness
      21. Trigger = 1
      22. Return
      Alles anzeigen
      image_17.jpg
    • naja, wenn ihr jetzt alles umhaut und base=0 raus nehmt, soll mir recht sein. Ihr murkst halt dann im Beschreiben des Bildspeichers auch rum. Da hab ich keine Lust mehr, mit zu denken. Ihr ward doch schon recht weit. So, wie ich das sah, hätte man nur prüfen müssen, ob das display nicht wie üblich in obere und untere Hälfte (2 Blöcke) physikalisch aufgeteilt ist, sondern mal in 4 Blöcke. Laut Bild wurde der Text dann in Block0 und Block2 verteilt. Block2 hätte in Block1 gemußt, hätte aber die andere Elektronikhälfte übernehmen müssen. Ich hab jetzt noch kein display gesehen, wo alles linear, so wie es rein geschrieben wurde, auch angezeigt wurde. Ich nehme an, die übliche Verteilung gemäß eines Musters dient zur Verhinderung eines Flackereffektes.
      Raum für Notizen

      -----------------------------------------------------------------------------------------------------

      -----------------------------------------------------------------------------------------------------
    • tschoeatsch schrieb:

      naja, wenn ihr jetzt alles umhaut und base=0 raus nehmt, soll mir recht sein. Ihr murkst halt dann im Beschreiben des Bildspeichers auch rum. Da hab ich keine Lust mehr, mit zu denken. Ihr ward doch schon recht weit. So, wie ich das sah, hätte man nur prüfen müssen, ob das display nicht wie üblich in obere und untere Hälfte (2 Blöcke) physikalisch aufgeteilt ist, sondern mal in 4 Blöcke. Laut Bild wurde der Text dann in Block0 und Block2 verteilt. Block2 hätte in Block1 gemußt, hätte aber die andere Elektronikhälfte übernehmen müssen. Ich hab jetzt noch kein display gesehen, wo alles linear, so wie es rein geschrieben wurde, auch angezeigt wurde. Ich nehme an, die übliche Verteilung gemäß eines Musters dient zur Verhinderung eines Flackereffektes.
      Perhaps post #37 is closer to the truth?