This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Question about LCr read response packet



Hi there,

I've been using Matlab to control the lightcrafter. I have found it useful to issue the LCr a 'host read command packet' after setting parameters in the gui to figure out how the packets are constructed and to debug my code.

My Problem:

I've been trying to send the LCr a BMP 608x684 in size using pattern definition. This hasn't been successful so far. When I send the LCr a group of 7 packets containing my image using the 'host write command packet' set for pattern definition and read 7bytes from the lightcrafter after each packet I get a '3' as the first byte for each of the 7 reads. From the DM365 command interface guide i think this is a good thing, code 3 as the first byte means that the LCr successfully recieved the packet. However when I try to display the image I just loaded, I don't see anything. The Pattern sequence settings are correct, in fact the correct LED turns on when I start Pattern sequence. With the lights off I can even see a kind of dim green light coming out of the lens which I interpret to be the residual light from dumping the signal. It is as if there was no image loaded. This is confirmed when i disconnect matlab from the LCr and use the gui to see if there is an image loaded - there isn't.

My attempt at solving it:

I've been loading an image through the GUI, then disconnecting the gui, connecting via Matlab and issuing a 'host read command packet'. I figure this way I can see what an actual packet for pattern definition looks like. My problem is I can't decipher the packet beyond byte 3.

When asked to give me 34 bytes worth of info, here is what it sends me: 

5 4 1 0 78 203 66 77 78 203 0 0 0 0 0 0 62 0 0 0 40 0 0 0 96 2 0 0 172 2 0 0 1 0

my interpretation:

5 = read response

4 = CMD1

1 = CMD2

**04 01 is Pattern Definition

0 Flags

78?? is this Payload 1?

203?? is this Payload 2?

66? is this the number of the frame? There is only one frame, why is this 66? (See image below for what I uploaded)

Can you help me interpret this packet from the 78 onwards?

Below is the image I sent it. 608x684. Two sets of 3 dots, at the right hand corner of the image. Each dot is 1pix in size and within a group of 3 is 1pix apart. **I realize that these will get jumbled as the image is remapped from rectilinear coordinates to the Diamond pixel array, but for the purposes of the packet this doesn't matter**

Thanks

Arjun

EDIT1: 

Just tried the TI 1bit sample pattern - getting the exact same response from the LCr. 

What do those numbers mean?

  • alright I'm making some progress. I've asked the LCr for as many bytes as are available. I've examined the host read response for 3 different kinds of images that I've attached at the bottom of this post. Immediately below are the read responses from the LCR. Each column is the response for 3 different images. I understand the first 6 bytes of the packet. The next 62 are identical for all 3 images, even though the image data for them is quite different. Flag is 0 so I assume that all the image data is in this packet. The last 444 bytes are different for all three, suggesting that these are image data. Consistent with this the sum of column 2 and 3 at row 70 and greater is 255 - given that 2 and 3 are just inverts of one another I expect this.  I still have problems figuring out how 444 corresponds to 608x684. There is no round multiple that will get me from 444 to 415872. 

    How are these 444 values respresenting the images below the chart? They are attached in column order.

    Please Folks, any help would be great

    b&w b&w with noise B&W&noise with invert
    5 5 5
    4 4 4
    1 1 1
    0 0 0
    78 78 78
    203 203 203
    66 66 66
    77 77 77
    78 78 78
    203 203 203
    0 0 0
    0 0 0
    0 0 0
    0 0 0
    0 0 0
    0 0 0
    62 62 62
    0 0 0
    0 0 0
    0 0 0
    40 40 40
    0 0 0
    0 0 0
    0 0 0
    96 96 96
    2 2 2
    0 0 0
    0 0 0
    172 172 172
    2 2 2
    0 0 0
    0 0 0
    1 1 1
    0 0 0
    1 1 1
    0 0 0
    0 0 0
    0 0 0
    0 0 0
    0 0 0
    16 16 16
    203 203 203
    0 0 0
    0 0 0
    19 19 19
    11 11 11
    0 0 0
    0 0 0
    19 19 19
    11 11 11
    0 0 0
    0 0 0
    2 2 2
    0 0 0
    0 0 0
    0 0 0
    0 0 0
    0 0 0
    0 0 0
    0 0 0
    0 0 0
    0 0 0
    0 0 0
    255 255 255
    255 255 255
    255 255 255
    255 255 255
    255 255 255
    0 17 238
    0 171 84
    0 200 55
    0 84 171
    0 118 137
    0 36 219
    0 26 229
    0 80 175
    0 28 227
    0 24 231
    0 96 159
    0 3 252
    0 5 250
    0 161 94
    0 68 187
    0 50 205
    0 10 245
    0 14 241
    0 236 19
    0 2 253
    0 128 127
    0 73 182
    0 224 31
    0 38 217
    0 36 219
    0 134 121
    0 80 175
    0 169 86
    0 153 102
    0 17 238
    0 52 203
    0 209 46
    0 193 62
    0 16 239
    0 138 117
    0 66 189
    0 43 212
    0 198 57
    0 224 31
    0 17 238
    0 229 26
    0 20 235
    0 171 84
    0 51 204
    0 160 95
    0 48 207
    0 129 126
    0 103 152
    0 104 151
    0 85 170
    0 11 244
    0 176 79
    0 73 182
    0 119 136
    0 7 248
    0 84 171
    0 146 109
    0 30 225
    0 204 51
    0 38 217
    0 203 52
    0 103 152
    0 34 221
    0 48 207
    0 25 230
    0 77 178
    0 52 203
    0 4 251
    0 122 133
    0 25 230
    0 140 115
    0 129 126
    0 136 119
    0 48 207
    0 164 91
    0 112 143
    0 64 191
    0 62 193
    0 144 111
    0 82 173
    0 16 239
    0 7 248
    0 89 166
    0 232 23
    0 98 157
    0 86 169
    0 244 11
    0 104 151
    0 43 212
    0 145 110
    0 240 15
    0 113 142
    0 90 165
    0 68 187
    0 79 176
    0 232 23
    0 2 253
    0 208 47
    0 196 59
    0 49 206
    0 65 190
    0 17 238
    0 19 236
    0 200 55
    0 70 185
    0 43 212
    0 137 118
    0 64 191
    0 129 126
    0 193 62
    0 24 231
    0 84 171
    0 1 254
    0 8 247
    0 183 72
    0 196 59
    0 188 67
    0 30 225
    0 35 220
    0 180 75
    0 71 184
    0 36 219
    0 205 50
    0 60 195
    0 131 124
    0 41 214
    0 35 220
    0 205 50
    0 96 159
    0 190 65
    0 210 45
    0 198 57
    0 203 52
    0 154 101
    0 92 163
    0 114 141
    0 68 187
    0 3 252
    0 236 19
    0 164 91
    0 48 207
    0 90 165
    0 0 255
    0 91 164
    0 133 122
    0 1 254
    0 5 250
    0 75 180
    0 1 254
    0 1 254
    0 147 108
    0 12 243
    0 169 86
    0 18 237
    0 43 212
    0 239 16
    0 33 222
    0 103 152
    0 32 223
    0 9 246
    0 205 50
    0 215 40
    0 25 230
    0 33 222
    0 36 219
    0 132 123
    0 206 49
    0 227 28
    0 96 159
    0 192 63
    0 1 254
    0 67 188
    0 169 86
    0 112 143
    0 2 253
    0 79 176
    0 121 134
    0 184 71
    0 0 255
    0 56 199
    0 150 105
    0 163 92
    0 156 99
    0 188 67
    0 129 126
    0 15 240
    0 98 157
    0 112 143
    0 165 90
    0 194 61
    0 38 217
    0 40 215
    0 163 92
    0 16 239
    0 139 116
    0 96 159
    0 57 198
    0 86 169
    0 220 35
    0 1 254
    0 104 151
    0 100 155
    0 181 74
    0 54 201
    0 25 230
    0 62 193
    0 205 50
    0 126 129
    0 33 222
    0 186 69
    0 37 218
    0 51 204
    0 240 15
    0 200 55
    0 0 255
    0 224 31
    0 230 25
    0 142 113
    0 44 211
    0 72 183
    0 41 214
    0 98 157
    0 194 61
    0 210 45
    0 129 126
    0 4 251
    0 48 207
    0 29 226
    0 3 252
    0 131 124
    0 65 190
    0 34 221
    0 87 168
    0 64 191
    0 4 251
    0 80 175
    0 177 78
    0 73 182
    0 83 172
    0 224 31
    0 203 52
    0 20 235
    0 8 247
    0 43 212
    0 25 230
    0 192 63
    0 192 63
    0 138 117
    0 128 127
    0 145 110
    0 80 175
    0 54 201
    0 211 44
    0 153 102
    0 255 0
    0 82 173
    0 88 167
    0 22 233
    0 135 120
    0 196 59
    0 202 53
    0 16 239
    0 144 111
    0 150 105
    0 233 22
    0 112 143
    0 112 143
    0 19 236
    0 3 252
    0 9 246
    0 136 119
    0 212 43
    0 22 233
    0 12 243
    0 40 215
    0 0 255
    0 112 143
    0 78 177
    0 45 210
    0 84 171
    0 130 125
    0 6 249
    0 164 91
    0 148 107
    0 17 238
    0 25 230
    0 89 166
    0 206 49
    0 149 106
    0 101 154
    0 179 76
    0 33 222
    0 5 250
    0 165 90
    0 131 124
    0 150 105
    0 69 186
    0 87 168
    0 142 113
    0 31 224
    0 37 218
    0 202 53
    0 201 54
    0 4 251
    0 128 127
    0 37 218
    0 89 166
    0 79 176
    0 162 93
    0 18 237
    0 214 41
    0 136 119
    0 160 95
    0 5 250
    0 106 149
    0 5 250
    0 1 254
    0 165 90
    0 248 7
    0 46 209
    0 2 253
    0 110 145
    0 128 127
    0 0 255
    0 27 228
    0 11 244
    0 83 172
    0 54 201
    0 128 127
    0 179 76
    0 4 251
    0 1 254
    0 2 253
    0 195 60
    0 98 157
    0 91 164
    0 80 175
    0 55 200
    0 34 221
    0 162 93
    0 132 123
    0 20 235
    0 8 247
    0 16 239
    0 221 34
    0 101 154
    0 116 139
    0 103 152
    0 132 123
    0 244 11
    0 37 218
    0 142 113
    0 232 23
    0 230 25
    0 240 15
    0 61 194
    0 43 212
    0 77 178
    0 41 214
    0 80 175
    0 36 219
    0 83 172
    0 73 182
    0 26 229
    0 245 10
    0 78 177
    0 5 250
    0 0 255
    0 175 80
    0 209 46
    0 129 126
    0 3 252
    0 112 143
    0 153 102
    0 128 127
    0 84 171
    0 188 67
    0 96 159
    0 179 76
    0 31 224
    0 139 116
    0 158 97
    0 5 250
    0 224 31
    0 38 217
    0 60 195
    0 106 149
    0 69 186
    0 1 254
    0 206 49
    0 40 215
    0 104 151
    0 148 107
    0 129 126
    0 197 58
    0 112 143
    0 88 167
    0 96 159
    0 148 107
    0 108 147
    0 34 221
    0 198 57
    0 47 208
    0 8 247
    0 155 100
    0 133 122
    0 36 219
    0 15 240
    0 208 47
    0 152 103
    0 30 225
    0 167 88
    0 34 221
    0 131 124
    0 132 123
    0 46 209
    0 68 187
    0 19 236
    0 22 233
    0 131 124
    0 14 241
    0 212 43
    0 220 35
    0 29 226
    0 11 244
    0 115 140
    0 8 247
    0 144 111
    0 10 245
    0 206 49
    0 0 255
    0 132 123
    0 3 252
    0 142 113
    0 84 171
    0 148 107
    0 168 87
    0 137 118
    0 129 126
    0 96 159
    0 40 215
    0 55 200
    0 134 121
    0 134 121

  • Hello Arjun,

    Here are the answers to your queries -

    #1.

    As per DLP LightCrafter DM365 Command Interface Guide http://www.ti.com/lit/ug/dlpu007c/dlpu007c.pdf refer to two sections, Section #2, packet structure, and section 3.11 Pattern Definition (04 01) Table 14 and Table15. 

    #2.

    The read command response to Pattern Definition (04 01) actually returns the pattern data in the BMP file format. That is why you are seeing the BMP file header has the same data. Now in the payload first byte BYTE0 has the pattern-number between 0 to 95. The bytes following BYTE#0 until the last byte contains the data for the BMP file.

    In short - 

    6 - bytes ..... Packet Header

    7th - byte ..... Pattern number <0-95> 1st byte of the BMP file

    8th - byte ..... 1st byte of the BMP file  2nd byte of the BMP file

    ....

    ....

    (N-1)th - byte ..... last byte of the BMP file

    Nth - byte.....checksum byte

    #3.

    You can copy the contents of the BMP file from the response then save it as BMP file on the PC. Now you can open the saved file to see the contents. 

    #4.

    While sending the pattern data you must send the entire BMP file content.

    Regards,

    Sanjeev

  • Hi Sanjeev,

    Thanks for your response. Turns out that the image data, which I've figured out empirically, is 51984 elements in length. this is (608*684)/8. I'm guessing that this means that each element specifies 8 pixels worth of data along the row dimension. I know this is the row dimension because when I uploaded an image where the first pixel of every row was white I got a value of 128, spaced by 76 zeroes. 608/8 = 76 & 128dec = 1b0000000. So this makes sense. This is further confirmed when I make an image that is black except for a group of 32 pixels in the bottom left of the image that alternate between completely white and completely black. Here the values from the LCr are 170;170;170;170 where 170dec = 1b0101010. 

    #1 - looks like the manual says that the read response packet structure does not include the pattern number. I think that also makes sense given that I've only uploaded one pattern to the LCr and its read response at byte 7 is 66.  Is the manual incorrect? If so how does 66 translate to pattern 0?

    #2 - Ah, the BMP header - thanks for this info. That makes sense now.

    #3 I don't know how I'd do this but I'll google around to figure it out

    #4 I've been trying to do this by sending the read response packet payload back to the LCr. Still haven't had success with this. This should work right?

    thanks

    Arjun

  • Hi Arjun,

    Here are the responses.

    Since, the used image is of 1bpp (1bit-per-pixel) format, what you calculated is correct. Each byte occupies 8-pixels information.

    #1. It is a mistake, have updated the post, the response does NOT carry the PatternNumber information. The BMP file information starts with the BMP signature, in this case it is a two byte header, with ASCII names 'M' and 'B'. 'M' is put in the MSB byte and 'B' is for the LSB byte. So ASCII value of 'B' = 66.

    #3. Is it simple, just create a binary file with <name>.bmp. Now from the response packet, copy the binary data from 7th byte until the (last-1) byte, last byte is for check-sum.

    #4. You mean, you are sending, the BMP file read-back back to the LCr in the write pattern definition command packet? If so, sure,  it should work unless there is mistake in copying the response BMP file contents. 

    Regards,

    Sanjeev