please dont rip this site

Basic Communications Program


by Malcom Kemp
April 3, 2000

This program was written to facilitate the development of a communications program for the PIC microcontroller. The overriding criteria were to be able to deliver precise 8-bit values to the PIC over the RS-232 Tx line, and to receive and display precise 8-bit values from the PIC over the Rx line. This program was developed from a program that Adam Davis made available through the PICLIST (PIC microcontroller discussion list).

The USART on the PC can be explicitly controlled through the “Settings” menu selection. When any of the Port, Speed, Data Bits, Parity, or Stop Bits selections are changed, the port is disconnected, the change made, and then the port is reconnected, if it was open to start. There is a small chance that data may be lost in this transition. It is expected that the port will be set to the proper operating parameters before the port is connected.

The “View” menu selection will set the display of the output string and the response string to either an escaped ASCII, or to a hex display. The hex display is a two character hex representation of each byte separated by a space. The ASCII display displays printable characters, but will escape non-printable characters with a “\” character as follows:

\b backspace, hex byte 0x08
\t tab, hex byte 0x09
\n new line (line feed), hex byte 0x0A
\r return, hex byte 0x0D
\xHH any unprintable hex character 0xHH
\\ backslash character \

The output string can be edited at any time, just follow the rules of the display. For the hex display, the hex characters must be space delimited. The field will be read, edited and rewritten when you leave the field. Be sure what is written back is what you intended.

The “send” button will transmit the output string out the RS-232 transmit of the selected port.

The “clear” buttons can be used to clear the contents of the output string or the response string at any time.

Although there is a limited space for display of the output string and the response string, they can actually be very long. The cursor is left at the right end of the string, but you can use the “home”, “end” and arrow keys to view portions of the string that may be hidden.

The file BasicCommSource.ZIP has the source files, the .exe file, and the readme.txt file.

If you find any errors in the program, please let me know, and I will attempt to fix the bug.

Also:

Questions:

Magdas Emilian Catalin Says: " This code is cool. Thank you very much! " +

Comments:


file: /techref/piclist/basiccomm/index.htm, 5KB, , updated: 2009/11/20 12:25, local time: 2010/3/16 21:33,
TOP NEW HELP FIND: 
38.107.191.114:LOG IN
©2010 PLEASE DON'T RIP! DO: LINK / DIGG! / MAKE!

 ©2010 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it!
<A HREF="http://piclist.com/techref/piclist/basiccomm/index.htm"> Basic Comm</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 
Stepper motors CAN be smooth!
And stepper controllers can be strong and cheap. Roman Black's Linistep stepper controller kits:
o 18th microstep
o Linear smoothing
  o Open source
o Full kit $25!
 
miSim DE is an excellent, portable and powerful IDE for developing PIC applications.
The only consistant, simple to use yet powerful development environment. It simulates real-world devices via virtual component "plugins" (LED,LCD,key,motor,TV,etc) in real time, has a syntax highlighting editor, macro assembler and disassembler. Regular updates and third-party plugins keep this software ahead of any other PIC IDE.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .