View Full Version : User Configuration Interface in PBP

- 5th February 2004, 14:30

Has anyone ever had the need to build a simple "configuration interface" to their PBP program? I have the need to build a simple configuration interface that allows the user to change some of the parameters used in calculations, ie. alarm setpoints, etc. using the WRITE or WRITECODE command. The interface will be used infrequently, usually only once or twice to set up the device and test. I'm thinking about a simple RS232 terminal type app that the user will just connect to via their favorite terminal app and a serial cable.

Any experiences with this type of interface? I can see it being a little tricky to break into the "setup routine" by having to Serin a pin constantly for data or maybe an interrupt on one of the other rs232 signal lines?

Opinions and suggestions welcome.

Darrel Taylor
- 7th February 2004, 08:00
I've had that need on just about everything I've done. The easiest way to service the request is to use the USART, when you get an interrupt, transfer to the receive routine, verify that the request was valid, and make the change in EEPROM. Then, send a response to let the user know it was succesfull, and it's done.

This requires a known sequence of bytes being sent by the computer. Not gonna happen with hyperterminal. A small setup program written in Vbasic, Delphi, C or whatever is the easiest way to do it.

If you want to use hyperterminal to do it. You'll have to essentialy write a Server routine on the PIC. This can take up a lot of code space, and a lot of your time as well. Since hyperterminal let's you input anything you want, idiot proofing the routine is the biggest part of it.

With your own setup program, there's just a few edit boxes that the user can enter numbers in, then when they hit send, the exact sequence of commands is sent to the PIC. Verifying that the numbers were correct is much esier to do on the PC. It can also add header bytes, so the PIC can more easily verify that the command is valid.

Best regards,