Page 1 of 1

TTL Jumpers

Posted: Sat Dec 27, 2008 10:49 am
by Link774
I have an LK204-25 Rev 2 and am trying to connect it to a Basic Stamp 2. The BS2 communicates at a maximum of 9600 baud and uses 0-5volts, so I think I need to modify the LK's jumpers to set it to 9600 baud and TTL, right?

I see there are 7 sets of jumpers:
3 for 232 (currently in)
2 for TTL
2 for I2C

The manual says I need to take the jumpers off the three 232 jumpers and put on the two TTL jumpers, right? But how is the speed set?

Also, is there an easier way to do this that doesn't involve soldering? I noticed that the baud could be set using commands, so could I hook it up to my computer and make these changes? I'm not so confident in my ability to solder such small pads.

Thanks!
Link774

Posted: Mon Dec 29, 2008 9:40 am
by Clark
Hi Links774,

First up, the bad news; you will have to solder. To move from regular RS232 levels to TTL, you have to bypass a converter on board, to do that we've set up those little resistors. Just remove all three from the RS232 side, and put 2 on the TTL pads, or just replace the 0 ohm resistors with solder blobs.

Next, some better news; the baud rate is indeed set through software, you should be able to find that pretty quickly in the manual. If you've got some programing experience, you can create a little program to send those commands, or even use hyperterminal with the alt + 4 digits cheat to get the values entered properly.

However, I'd recommend using our uProject software, testing out some basic communication, then moving over to the upload tab. In the other folder you'll find a raw data option, just drag that over to the command window. From there, enter one byte at a time by writing it in one of the boxes on the right and hitting that add button; it'll throw a '/' on either side of each byte. When finished with the entire command, just hit ok, then run.

If you do run into any trouble, just let me know.

Thanks,
~Troy

Posted: Mon Dec 29, 2008 12:51 pm
by Link774
Troy,

Thanks for the reply! I figured as much about the soldering...I borrowed an iron with a finer tip from a friend, so hopefully that will work.

Regarding changing the baud rate in uProject, why use the raw data command? Can't I just use the Set_Baudrate command?

So what I need to do is:
1) Hook the display up to my computer
2) Add that command to the Uploader
3) Execute the script
4) Remove the 3 RS232 jumpers
5) Put a solder blob spanning the 2 TTL jumpers

Once I have done this, I won't be able to hook the display up to my computer again, correct? What are the chances that the display will forget the baud settings and I'm going to have to switch the jumpers around again to reset it?

Thanks!
Link774

Posted: Mon Dec 29, 2008 2:47 pm
by Clark
Hi Link774,

No worries, good to hear you are set up for the soldering; just stick to a blob rather than resoldering those resistors and you should be alright.

As for uProject, it is rather old, we don't even have the source code for it any more, and though we try extremely hard to make everything compatible, we have changed the baud rate command values. As a result, the command sent is rather out dated and doesn't work for most units.

I like the raw data command because you can be absolutely sure of what you are sending, and it does any conversions you many need for you by providing three different ways to enter the values.

Your algorithm there looks correct, though I would recommend adding a 3b to the list; just check to make sure the baud is changed using uProject.

One more thing, I did also forget the remember command; the change will be negated when power is cycled, so you'll need to turn remember on and off. Its a simple command with a single parameter so I would suggest putting it in the raw data; a 254 147 1 before the baud change should work, then change the com settings to the new baud go back in and issue a 254 147 0.

For added security, you can check out the data lock available near the back of the manual. This can lock down things like baud rate so it is much harder to change them. Just through that in before turning remember off.

I think that should about cover it, if you have any more concerns, please just let me know.

Thanks,
~Troy

Posted: Mon Dec 29, 2008 5:37 pm
by Link774
Ok, that makes sense. Here is the script I ran that appears to have worked:

Line0=Raw /254//157//1/
Line1=Raw /254//57//103/
Line2=Raw /254//157//0/

I cut the power and was able to reconnect at 9600 baud and issue some of the uProject test commands without getting gibberish, so it seems to have worked.

I looked at the data lock thing in the manual and was confused by the the difference between the Data Lock command and the Set and Save Data Lock command. Do I need to issue both? I was thinking this would do the trick to set the Communication Speed lock (bit 3, so the value should be 8, right?):

Raw /254//202//245//160//8/

But then I read the Set and Save Data lock command and was unsure of whether the Data Lock command saved its settings. I tried both commands and now I don't seem to be able to change the baud rate, so I guess it worked. No error when I try to change it, it just doesn't change.


Link774

Posted: Tue Dec 30, 2008 9:11 am
by Clark
Hi Link774,

Good to hear that the baud rate change has worked out for you, seems like you've even got it locked in there as well.

Most of our commands have set functions which work until power is cycled, and save functions which are more permanent. If you can cycle the power, and still have the baud set to 9600, you've got it saved. The same goes for the data lock function, the set will lock only until power is cycled; if the lock is still set after a cycle, you've saved it.

Anyway, best of luck in your development, if you do run into any more trouble, just let me know.

Thanks,
~Troy

Posted: Thu Feb 19, 2009 12:56 pm
by Link774
Just thought I'd post a follow up now that my project is complete. I figured out a way to do it without soldering the TTL jumpers: I just used the serial output pin on the basic stamp, which is typically used for programming the unit.

The downside of this is that my development board doesn't make this pin accessible, since it is wired directly to the serial port that I hook my computer to. I could have kept disconnecting my computer while I was developing the program, but it was easier just to place a jumper cable resting directly on the the SEROUT pin and hooked up to my breadboard. It was a little fiddly, but on the plus side, no soldering tiny connections and potentially ruining my board!

In the final project, I don't need access to the serial port, so that wasn't a problem. Here are some pictures:

http://www.flickr.com/photos/link774/se ... 2294362096

The display was really easy to set up and use once I got the connections sorted out. I used the matrix keypad input feature of the display, so I didn't need to scan the switches in my BS2 program. Thanks again for your help!

-Link774

Posted: Thu Feb 19, 2009 3:04 pm
by Clark
Hi Link774,

I appreciate the post, and the link provided; your project looks great and I'm sure some of our other users will be inspired. Great to hear you found a solution to the protocol jumper problem to help the project go a little easier. We do have a development board coming that addresses problems for developers such as those jumpers, but it is a little way off and your suggestions will be very helpful in the meantime.

Thanks,
~Troy