please dont rip this site

Simple Commands

     A demonstration program for the 16F873A containing a Simple Commands decoder and example routines to enter and print single and multi-byte data values in HEX, change command bits, and control program execution from a serial port. Runs in the background and no interrupts are used to free the interrupt routine for user tasks. Command decoder and print routines are loaded in page 1 memory to free page 0 memory for the user's program. Data is sent directly to memory, but an example of a buffered load is shown. Nested menus are demonstrated for easy expansion of the command set as the project grows. Using the Simple Commands demonstration program as a starting point for program development and selecting and customizing the routines you need for your application, adding serial port commands and data entry to your PIC program is easy!

     The code was developed for the 16F873A, but can be adapted to most PIC's with a UART. Commands are similar to Motorola style @@Xnxx commands where @@ is command start, X capital letter is the command, n small letter (optional) is a sub command, and xx (optional) are HEX data characters. For Simple Commands each data entry command is for a defined number of characters, no end of line or parity is used, and no error testing is performed on the data to simplify the code.

     To allow for usage of bank 1 registers, the program relies on the high 16 registers in bank 0 having common addresses in all other banks in the 16F873A and the interrupt stack is stored there. The interrupt service routine stores W before changing to bank 0 to store STATUS, PCLATH, FSR, and executing the user interrupt code. If the high 16 registers are not common in all banks in the PIC used, don't use bank 1 registers in the background routines without disabling interrupts first as the background routine could be interrupted in either bank and W may not get saved properly.

 

     For small programs with limited commands the command decoder and print routines can be loaded in page 0 memory. For an example of using Simple Commands in page 0 memory to change or print a single variable, see the Simple Time Interval Counter with RS-232 Output.

   

Code:


file: /Techref/member/RHM-SSS-SC4/Scmds.htm, 26KB, , updated: 2008/3/14 00:41, local time: 2024/11/23 08:07, owner: RHM-SSS-SC4,
TOP NEW HELP FIND: 
18.217.207.112:LOG IN

 ©2024 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! / MAKE!

<A HREF="http://techref.massmind.org/techref/member/RHM-SSS-SC4/Scmds.htm"> Simple Commands – A demonstration program for the 16F873A containing a simple command decoder and example routines to enter and print single and multi-byte data values in HEX, change command bits, and control program execution from a serial port. Using the Simple Commands demonstration program as a starting point for program development and selecting and customizing the routines you need for your application, adding serial port commands and data entry to your PIC program is easy!</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 a nice message (short messages are blocked as spam) 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?