Editing Serial Communications Library -- BoostC and 16F877A

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
=== Summary  ===
 
=== Summary  ===
 
This project has been replaced by [[Serial Communications (RS232) in BoostC]] which is designed to work with more chips, but this one should still work fine and may be simpler for the beginner.
 
  
 
*Name: Serial Communications Library -- BoostC and 16F877A
 
*Name: Serial Communications Library -- BoostC and 16F877A
*Purpose: A C library ( in source code form ) for serial communications ( RS232 ) together with a program demonstrating its use.  Code includes a simple command interperter and parsing for various number bases.
+
*Purpose: A C library ( in source code form ) for serial communications ( RS232 ) together with a program demonstrating its use.
*Status: This is near "final". Code works but still in refinement, see '''Download''' section below.
+
*Status: This is near "final". Code works but still in refinement, code available, email [[russ_hensel]]
*Technology: BoostC and PIC 16F877A -- should be fairly easily adapted to other chips
+
*Technology: BoostC and PIC 16F877A
 
*Author: [[russ_hensel]] ( where you can find an email address to reach me )
 
*Author: [[russ_hensel]] ( where you can find an email address to reach me )
 
*License: not fully determined, but open source and object code.
 
*License: not fully determined, but open source and object code.
Line 12: Line 10:
  
 
This is one of a series of articles on Microcontroller Serial Communications, rooted at this site here:  [[Microcontroller Serial Communications Articles]]
 
This is one of a series of articles on Microcontroller Serial Communications, rooted at this site here:  [[Microcontroller Serial Communications Articles]]
 
=== News  ===
 
 
* May '09 Now have a version for 16F877A and 18F2550, but beta, not quite ready for publication, email me if you need it.
 
* New version now at: [[Serial Communications (RS232) in BoostC]]
 
* August '09 Discovered error in code, at 20 meg hz fuse setting is still xt and some crystals may not run.  Should be hs for this clock rate.  The version on this page will no longer be updated however.
 
  
 
=== Features  ===
 
=== Features  ===
Line 45: Line 37:
 
|Transmit is blocking.
 
|Transmit is blocking.
 
|During a transmit no activities that are not interrupt driven occur.
 
|During a transmit no activities that are not interrupt driven occur.
 +
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
Line 53: Line 46:
 
|Command interface includes a stop command to halt long running operations.
 
|Command interface includes a stop command to halt long running operations.
 
|Character is !
 
|Character is !
 +
 +
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
Line 60: Line 55:
 
|-valign="top"
 
|-valign="top"
 
|Option to make single letter commands case insensitive.
 
|Option to make single letter commands case insensitive.
 +
 +
 +
 
|
 
|
 
<!-------------------------------->
 
<!-------------------------------->
Line 69: Line 67:
 
|Beware of negative numbers which may not be handled as you expect.
 
|Beware of negative numbers which may not be handled as you expect.
 
|The demo program deliberately causes overflow which may push signed number negative and make unsigned numbers roll over.
 
|The demo program deliberately causes overflow which may push signed number negative and make unsigned numbers roll over.
<!--------------------------------
+
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|
 
|
Line 114: Line 112:
 
=== Compiling the Program ===
 
=== Compiling the Program ===
  
The code for the library and the demo program is in one zip file ( called DemoSerial.zip, see Download below ). Unzip into a directory of its own.  Open the project file SerialDemo.__c and compile with the source boost C compiler.  The source files are SerialDemo.c SerialDemo.h.....
+
The code for the library and the demo program is in one zip file ( called .... ). Unzip into a directory of its own.  Open the project file SerialDemo.__c and compile with the source boost compiler.  The source files are SerialDemo.c SerialDemo.h.....
  
I am not sure if the program is small enough to compile with the free compiler, my compiler reports a size of 2392 bytes of ROM, which is probably not small enough.  There should enough demo code that can be deleted to get under the 2K limit.
+
I am not sure if the program is small enough to compile with the free compiler, my compiler reports a size of 1616 bytes of ROM, which may be small enough.
  
 
Before compiling make sure you change the target PIC to 16F877A.
 
Before compiling make sure you change the target PIC to 16F877A.
Line 210: Line 208:
 
=== Download ===
 
=== Download ===
  
Zip file here [http://home.comcast.net/~russ_hensel/OC/DemoSerial.zip DemoSerial.zip]  I may have more recent versions, email me if you want to check [[russ_hensel]]
+
Zip file here real soon.
  
 
=== Projects using this Library ===
 
=== Projects using this Library ===
  
*[[Stepper Motor Tester]]
+
 
 
*[[PIC based Stepper Motor Dancing Analog Clock]]
 
*[[PIC based Stepper Motor Dancing Analog Clock]]
*[[Experimenting with IR Remotes using a PIC running BoostC Project]]
+
*[[ Stepper Motor Tester]]
*[[Experimenting with Stepper Motors as Rotary Encoders using a PIC running BoostC Project]]
 
  
 
=== Comment, Questions, Contributions? ===
 
=== Comment, Questions, Contributions? ===
  
 
Email me [[russ_hensel]], or use the talk page for this topic.  All feedback is welcome, even bug reports or additions ( interrupt driven transmit perhaps ).
 
Email me [[russ_hensel]], or use the talk page for this topic.  All feedback is welcome, even bug reports or additions ( interrupt driven transmit perhaps ).
 
[[category:Serial Communications]][[category:Microcontroller]][[category:PIC]][[category:BoostC]]
 

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)