PIC Assembly Library
This library offers macros and code in assembly with built in portability and optimizations for the midrange PIC microcontrollers. The goal is to put the power of assembly in the hands of the programmer, with as much flexibility among various PIC16XXXX microcontrollers and with some repetative tasks optimized at compile time. Generally, these libraries make extensive use of conditional compiling, macros, and other features of MPASM.
A collection of macros that provide manipulations of eight bit variables and literals. Examples, ADDLF, SUBFF, ROTL, VSHIFTR, etc.
Memory Banking Macros
A macro to replace the banksel command. It keeps up with the current bank and minimizes bsf and bcf commands.
Continuous Delay, Delay Routines, and Delay Macros
Code and data register optimized delay routines. Delay.inc includes delay routines for delays of 4 cycles or more and a continuous delay by WREG of 14 or more. Delayh.inc includes a DELAY macro that delays for any number of cycles. DELAY uses the delay routines if they're available.
Routines to read from and write to the EEPROM memory. These routines use conditional compiling to be general and operate on different microcontrollers. Tested on a PIC16F84A and PIC16F877A and should provide compatability with a PIC16F84, PIC16F84A, PIC16F87X, and PIC16F87XA. Routines to verify or write to EEPROM only if different to come in version 1.1.
I2C Slave Routines
Polling and bitbanged implementation of the I2C protocol as a slave device.
Multiply and Divide Routines and Macros
A multiply routine yielding a two byte product of two registers. A divide routine yielding a single byte quotient of a two byte dividend and single byte divisor. Also, a register multiply by literal yielding an single byte product and a register multiply yielding a two byte product. Both literal multiply routines produce optimized code size and execution speed.
Bitbanged Serial Port Routines
Includes routines to transmit and recieve serial data. Software implemented using bitbang, recieve routine can be configured as interrupt driven. Baudrate, polarity, and parity options can be specified in the main program. Supports no, even, odd, and sticky parity. And tested at baudrates upto 56 kbps on a PIC16F84A running at 4 MHz. Support for higher baud rates to be added in version 1.1 at a later time.