Let's Make Robots!

Help with Picaxe and serial LCD

Ok Picaxe Basic Gurus... I think I need some code snippits...

My new serial enabled LCD just arrived and I can't seem to get it up and running. I am using what I think is the standard picaxe basic commands but I am only getting white blocks, x's and some other random symbols. To be honest, I am confused with a lot of the serial commands in general, the whole ASCII thing and anything written as 0x7C or 0x14 or whatever.

Here is the display.

Here is the PDF

For instance, I first need to change the baud rate. The instructions tell me to send 124 followed by "<control>k" . Now it seems the picaxe standard is 2400 baud. What is the actual command? Do I send the "change baud" command at 2400 baud when the display is at a default of 9600? and then the command number is 124 and also 0x7C so what do I do?

In my mind (and to show I have no idea what I am doing) here are all the options I can see:

serout 7,N2400, (124, "<control>K")

-or-

serout 7,N2400,(124)

pause 5

serout 7,N2400,("<control>K")

-or-

serout 7,N2400,($7c, "<control>k")

I could go on and on with my guessing but nothing is working.

In general, I assume my major problem is with the baud rate, I hope and assume that after I get that fixed I should be able to return to the standard serout 7,N2400,("Hello") sorta commands.

Would anyone be so kind as to give me a crash course on what you think I should know?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Here's the same list sorted by result, so you can look up easily what to send in order to get a desired result. Note how the important numbers are there now: 124 (control character), 1 (clear display) and 107 (k or set speed to 2400 baud).

Alas, a few important ones are missing: 254 (control character) and everything you need to place the cursor at a specific position (basically everything from 128 and up is missing).

128 = ...               --mangles-into-->         0 = ...
192 = ...               --mangles-into-->         0 = ...
224 = ...               --mangles-into-->         0 = ...
240 = ...               --mangles-into-->         0 = ...
248 = ...               --mangles-into-->         0 = ...
252 = ...               --mangles-into-->         0 = ...
254 = ...               --mangles-into-->         0 = ...
255 = ...               --mangles-into-->         0 = ...
 64 =   @               --mangles-into-->         1 = ...
160 = ...               --mangles-into-->         1 = ...
208 = ...               --mangles-into-->         1 = ...
232 = ...               --mangles-into-->         1 = ...
244 = ...               --mangles-into-->         1 = ...
250 = ...               --mangles-into-->         1 = ...
253 = ...               --mangles-into-->         1 = ...
 96 =   `               --mangles-into-->         2 = ...
176 = ...               --mangles-into-->         2 = ...
216 = ...               --mangles-into-->         2 = ...
236 = ...               --mangles-into-->         2 = ...
246 = ...               --mangles-into-->         2 = ...
251 = ...               --mangles-into-->         2 = ...
 32 = ...               --mangles-into-->         3 = ...
144 = ...               --mangles-into-->         3 = ...
200 = ...               --mangles-into-->         3 = ...
228 = ...               --mangles-into-->         3 = ...
242 = ...               --mangles-into-->         3 = ...
249 = ...               --mangles-into-->         3 = ...
112 =   p               --mangles-into-->         4 = ...
184 = ...               --mangles-into-->         4 = ...
220 = ...               --mangles-into-->         4 = ...
238 = ...               --mangles-into-->         4 = ...
247 = ...               --mangles-into-->         4 = ...
 80 =   P               --mangles-into-->         5 = ...
168 = ...               --mangles-into-->         5 = ...
212 = ...               --mangles-into-->         5 = ...
234 = ...               --mangles-into-->         5 = ...
245 = ...               --mangles-into-->         5 = ...
 48 =   0               --mangles-into-->         6 = ...
152 = ...               --mangles-into-->         6 = ...
204 = ...               --mangles-into-->         6 = ...
230 = ...               --mangles-into-->         6 = ...
243 = ...               --mangles-into-->         6 = ...
 16 = ...               --mangles-into-->         7 = ...
136 = ...               --mangles-into-->         7 = ...
196 = ...               --mangles-into-->         7 = ...
226 = ...               --mangles-into-->         7 = ...
241 = ...               --mangles-into-->         7 = ...
120 =   x               --mangles-into-->         8 = ...
188 = ...               --mangles-into-->         8 = ...
222 = ...               --mangles-into-->         8 = ...
239 = ...               --mangles-into-->         8 = ...
104 =   h               --mangles-into-->         9 = ...
180 = ...               --mangles-into-->         9 = ...
218 = ...               --mangles-into-->         9 = ...
237 = ...               --mangles-into-->         9 = ...
 88 =   X               --mangles-into-->        10 = ...
172 = ...               --mangles-into-->        10 = ...
214 = ...               --mangles-into-->        10 = ...
235 = ...               --mangles-into-->        10 = ...
 72 =   H               --mangles-into-->        11 = ...
164 = ...               --mangles-into-->        11 = ...
210 = ...               --mangles-into-->        11 = ...
233 = ...               --mangles-into-->        11 = ...
 56 =   8               --mangles-into-->        12 = ...
156 = ...               --mangles-into-->        12 = ...
206 = ...               --mangles-into-->        12 = ...
231 = ...               --mangles-into-->        12 = ...
 40 =   (               --mangles-into-->        13 = ...
148 = ...               --mangles-into-->        13 = ...
202 = ...               --mangles-into-->        13 = ...
229 = ...               --mangles-into-->        13 = ...
 24 = ...               --mangles-into-->        14 = ...
140 = ...               --mangles-into-->        14 = ...
198 = ...               --mangles-into-->        14 = ...
227 = ...               --mangles-into-->        14 = ...
  8 = ...               --mangles-into-->        15 = ...
132 = ...               --mangles-into-->        15 = ...
194 = ...               --mangles-into-->        15 = ...
225 = ...               --mangles-into-->        15 = ...
124 =   |               --mangles-into-->        16 = ...
190 = ...               --mangles-into-->        16 = ...
223 = ...               --mangles-into-->        16 = ...
116 =   t               --mangles-into-->        17 = ...
186 = ...               --mangles-into-->        17 = ...
221 = ...               --mangles-into-->        17 = ...
108 =   l               --mangles-into-->        18 = ...
182 = ...               --mangles-into-->        18 = ...
219 = ...               --mangles-into-->        18 = ...
100 =   d               --mangles-into-->        19 = ...
178 = ...               --mangles-into-->        19 = ...
217 = ...               --mangles-into-->        19 = ...
 92 =   \               --mangles-into-->        20 = ...
174 = ...               --mangles-into-->        20 = ...
215 = ...               --mangles-into-->        20 = ...
 84 =   T               --mangles-into-->        21 = ...
170 = ...               --mangles-into-->        21 = ...
213 = ...               --mangles-into-->        21 = ...
 76 =   L               --mangles-into-->        22 = ...
166 = ...               --mangles-into-->        22 = ...
211 = ...               --mangles-into-->        22 = ...
 68 =   D               --mangles-into-->        23 = ...
162 = ...               --mangles-into-->        23 = ...
209 = ...               --mangles-into-->        23 = ...
 60 =   <               --mangles-into-->        24 = ...
158 = ...               --mangles-into-->        24 = ...
207 = ...               --mangles-into-->        24 = ...
 52 =   4               --mangles-into-->        25 = ...
154 = ...               --mangles-into-->        25 = ...
205 = ...               --mangles-into-->        25 = ...
 44 =   ,               --mangles-into-->        26 = ...
150 = ...               --mangles-into-->        26 = ...
203 = ...               --mangles-into-->        26 = ...
 36 =   $               --mangles-into-->        27 = ...
146 = ...               --mangles-into-->        27 = ...
201 = ...               --mangles-into-->        27 = ...
 28 = ...               --mangles-into-->        28 = ...
142 = ...               --mangles-into-->        28 = ...
199 = ...               --mangles-into-->        28 = ...
 20 = ...               --mangles-into-->        29 = ...
138 = ...               --mangles-into-->        29 = ...
197 = ...               --mangles-into-->        29 = ...
 12 = ...               --mangles-into-->        30 = ...
134 = ...               --mangles-into-->        30 = ...
195 = ...               --mangles-into-->        30 = ...
  4 = ...               --mangles-into-->        31 = ...
130 = ...               --mangles-into-->        31 = ...
193 = ...               --mangles-into-->        31 = ...
126 =   ~               --mangles-into-->        32 = ...
191 = ...               --mangles-into-->        32 = ...
122 =   z               --mangles-into-->        33 =   !
189 = ...               --mangles-into-->        33 =   !
118 =   v               --mangles-into-->        34 =   "
187 = ...               --mangles-into-->        34 =   "
114 =   r               --mangles-into-->        35 =   #
185 = ...               --mangles-into-->        35 =   #
110 =   n               --mangles-into-->        36 =   $
183 = ...               --mangles-into-->        36 =   $
106 =   j               --mangles-into-->        37 =   %
181 = ...               --mangles-into-->        37 =   %
102 =   f               --mangles-into-->        38 =   &
179 = ...               --mangles-into-->        38 =   &
 98 =   b               --mangles-into-->        39 =   '
177 = ...               --mangles-into-->        39 =   '
 94 =   ^               --mangles-into-->        40 =   (
175 = ...               --mangles-into-->        40 =   (
 90 =   Z               --mangles-into-->        41 =   )
173 = ...               --mangles-into-->        41 =   )
 86 =   V               --mangles-into-->        42 =   *
171 = ...               --mangles-into-->        42 =   *
 82 =   R               --mangles-into-->        43 =   +
169 = ...               --mangles-into-->        43 =   +
 78 =   N               --mangles-into-->        44 =   ,
167 = ...               --mangles-into-->        44 =   ,
 74 =   J               --mangles-into-->        45 =   -
165 = ...               --mangles-into-->        45 =   -
 70 =   F               --mangles-into-->        46 =   .
163 = ...               --mangles-into-->        46 =   .
 66 =   B               --mangles-into-->        47 =   /
161 = ...               --mangles-into-->        47 =   /
 62 =   >               --mangles-into-->        48 =   0
159 = ...               --mangles-into-->        48 =   0
 58 =   :               --mangles-into-->        49 =   1
157 = ...               --mangles-into-->        49 =   1
 54 =   6               --mangles-into-->        50 =   2
155 = ...               --mangles-into-->        50 =   2
 50 =   2               --mangles-into-->        51 =   3
153 = ...               --mangles-into-->        51 =   3
 46 =   .               --mangles-into-->        52 =   4
151 = ...               --mangles-into-->        52 =   4
 42 =   *               --mangles-into-->        53 =   5
149 = ...               --mangles-into-->        53 =   5
 38 =   &               --mangles-into-->        54 =   6
147 = ...               --mangles-into-->        54 =   6
 34 =   "               --mangles-into-->        55 =   7
145 = ...               --mangles-into-->        55 =   7
 30 = ...               --mangles-into-->        56 =   8
143 = ...               --mangles-into-->        56 =   8
 26 = ...               --mangles-into-->        57 =   9
141 = ...               --mangles-into-->        57 =   9
 22 = ...               --mangles-into-->        58 =   :
139 = ...               --mangles-into-->        58 =   :
 18 = ...               --mangles-into-->        59 =   ;
137 = ...               --mangles-into-->        59 =   ;
 14 = ...               --mangles-into-->        60 =   <
135 = ...               --mangles-into-->        60 =   <
 10 = ...               --mangles-into-->        61 =   =
133 = ...               --mangles-into-->        61 =   =
  6 = ...               --mangles-into-->        62 =   >
131 = ...               --mangles-into-->        62 =   >
  2 = ...               --mangles-into-->        63 =   ?
129 = ...               --mangles-into-->        63 =   ?
127 = ...               --mangles-into-->        64 =   @
125 =   }               --mangles-into-->        65 =   A
123 =   {               --mangles-into-->        66 =   B
121 =   y               --mangles-into-->        67 =   C
119 =   w               --mangles-into-->        68 =   D
117 =   u               --mangles-into-->        69 =   E
115 =   s               --mangles-into-->        70 =   F
113 =   q               --mangles-into-->        71 =   G
111 =   o               --mangles-into-->        72 =   H
109 =   m               --mangles-into-->        73 =   I
107 =   k               --mangles-into-->        74 =   J
105 =   i               --mangles-into-->        75 =   K
103 =   g               --mangles-into-->        76 =   L
101 =   e               --mangles-into-->        77 =   M
 99 =   c               --mangles-into-->        78 =   N
 97 =   a               --mangles-into-->        79 =   O
 95 =   _               --mangles-into-->        80 =   P
 93 =   ]               --mangles-into-->        81 =   Q
 91 =   [               --mangles-into-->        82 =   R
 89 =   Y               --mangles-into-->        83 =   S
 87 =   W               --mangles-into-->        84 =   T
 85 =   U               --mangles-into-->        85 =   U
 83 =   S               --mangles-into-->        86 =   V
 81 =   Q               --mangles-into-->        87 =   W
 79 =   O               --mangles-into-->        88 =   X
 77 =   M               --mangles-into-->        89 =   Y
 75 =   K               --mangles-into-->        90 =   Z
 73 =   I               --mangles-into-->        91 =   [
 71 =   G               --mangles-into-->        92 =   \
 69 =   E               --mangles-into-->        93 =   ]
 67 =   C               --mangles-into-->        94 =   ^
 65 =   A               --mangles-into-->        95 =   _
 63 =   ?               --mangles-into-->        96 =   `
 61 =   =               --mangles-into-->        97 =   a
 59 =   ;               --mangles-into-->        98 =   b
 57 =   9               --mangles-into-->        99 =   c
 55 =   7               --mangles-into-->       100 =   d
 53 =   5               --mangles-into-->       101 =   e
 51 =   3               --mangles-into-->       102 =   f
 49 =   1               --mangles-into-->       103 =   g
 47 =   /               --mangles-into-->       104 =   h
 45 =   -               --mangles-into-->       105 =   i
 43 =   +               --mangles-into-->       106 =   j
 41 =   )               --mangles-into-->       107 =   k
 39 =   '               --mangles-into-->       108 =   l
 37 =   %               --mangles-into-->       109 =   m
 35 =   #               --mangles-into-->       110 =   n
 33 =   !               --mangles-into-->       111 =   o
 31 = ...               --mangles-into-->       112 =   p
 29 = ...               --mangles-into-->       113 =   q
 27 = ...               --mangles-into-->       114 =   r
 25 = ...               --mangles-into-->       115 =   s
 23 = ...               --mangles-into-->       116 =   t
 21 = ...               --mangles-into-->       117 =   u
 19 = ...               --mangles-into-->       118 =   v
 17 = ...               --mangles-into-->       119 =   w
 15 = ...               --mangles-into-->       120 =   x
 13 = ...               --mangles-into-->       121 =   y
 11 = ...               --mangles-into-->       122 =   z
  9 = ...               --mangles-into-->       123 =   {
  7 = ...               --mangles-into-->       124 =   |
  5 = ...               --mangles-into-->       125 =   }
  3 = ...               --mangles-into-->       126 =   ~
  1 = ...               --mangles-into-->       127 = ...
 

#!/usr/bin/perl -w

foreach my $b (1 .. 255 ) {
   my $d = $b ;
   # print the decimal and associated character (if it's printable)
   if ($d > 32 && $d < 127) {
      $c = chr $d ;
   } else {
      $c = "..." ;
   }
   printf "%3i = %3s    ", $d, $c ;

   # invert
   $d = ~ $d ;
   # the result is 32 bit, we only need 8
   $d = $d & 255 ;

   # shift until we hit a start bit
   while (($d & 1)) {
      $d = $d >> 1 ;
      $d = $d & 255 ;
   }

   # shift the alleged start bit out as well
   $d = $d >> 1 ;

   # now what is left counts as a character
   if ($d > 32 && $d < 127) {
      $c = chr $d ;
   } else {
      $c = "..." ;
   }
   printf "     --mangles-into-->       %3i = %3s       ", $d, $c ;

   print "\n" ;
}

Chris, please reconsider returning the piece of junk to Sparkfun (or selling it on e-bay). Maybe in the next few months or so some wise (ass) people come along in search of info on this component. LMR is getting more and more google attention every week. Just make sure the google users find this node when searching for "serlcd picaxe".

Some day some person might come along, see our problem and our efforts and come up with an even smarter idea. one that works.

Hey clever person, if you're reading this: please post your smart idea here!

try this code...
------------------------------------------------- 
'Spark fun serial LCD test
'
pause 1000

setfreq m8


'pause 1000

'serout 7,T9600_8,(0x7c, 150) 'Sets backlight full on (128-157
'74% on
'pause 1000

pause 200
serout 7,T9600_8,(254, $01) 'Clear Screen

main:

pause 200
serout 7,T9600_8,(254, 128) 'Sets line 1 position 1

pause 200
serout 7,T9600_8,("hello Chris.")
' 1234567890123456


goto main
x-nay on the agging-fray ug-bay in the irmware-fay!