subtitle "" ;;; ********************************************************************* ;;; Library Name: ;;; Purpose: ;;; ;;; ;;; ;;; Revision: ;;; Date: ;;; Author: ;;; Copyright: ;;; Device: PIC16F873, PIC16F874, PIC16F876, PIC16F877. ;;; PIC16F873A, PIC16F874A, PIC16F876A, PIC16F877A. ;;; ********************************************************************* ;;; Special Directions: ;;; ;;; ********************************************************************* ;;; Revision History: ;;; ;;; ********************************************************************* ;;; Ideas for future work: ;;; ;;; ********************************************************************* ;;; ********************************************************************* ;;; NOTE: An error will be generated by the assembler if any labels ;;; defined as global in this file are the same as those in the main ;;; file (or other libraries). list ; Turn on list output. Note that device ; type needs to be specified to the ; assembler (on the command line, or through ; the MPLAB IDE). ;; Include register, bit, and other info specific to ;; the specified device. ifdef __16F873 #include messg "Assembling _lib.asm for PIC16F873." endif ifdef __16F874 #include messg "Assembling _lib.asm for PIC16F874." endif ifdef __16F876 #include messg "Assembling _lib.asm for PIC16F876." endif ifdef __16F877 #include messg "Assembling _lib.asm for PIC16F877." endif ifdef __16F873A #define A_Device #include messg "Assembling _lib.asm for PIC16F873A." endif ifdef __16F874A #define A_Device #include messg "Assembling _lib.asm for PIC16F874A." endif ifdef __16F876A #define A_Device #include messg "Assembling _lib.asm for PIC16F876A." endif ifdef __16F877A #define A_Device #include messg "Assembling _lib.asm for PIC16F877A." endif ;;; -------------------------------------------------------------------- ;;; Assembler Equates Section. Define assembly-time constants here ;;; using the EQU assembler directive. ;;; -------------------------------------------------------------------- ;;; --------------------------------------------------------------------- ;;; Variable Address Assignments. ;;; --------------------------------------------------------------------- UDATA ; Start of uninitialized data section. ; Reserve memory for variables using the ; "RES" directive here. Note that the ; linker will assign addresses. ; eg) ADcounter res 1 ; (reserves 1 byte for ADcounter). UDATA_OVR ; Uninitialized data overlay section. ; Upon occasion, temporary variables ; can be over-written by other temporary ; variables. These would appear here. ; BUT! If you ever intend on time-sliced ; or pre-emptive multitasking ; don't *ever* use this directive! ;; In order to use a variable for passing of parameters, ;; it needs to be declared as "global" so the label is ;; accessible outside this module. ;; All parameter-passing variables should be placed under ;; the UDATA section (not UDATA_OVR). ;; And, again, if you ever intend on multitasking (other than ;; the real-time loop), don't *ever* pass parameters in ;; variables. (That said, it is quite difficult to not do ;; this on the PIC16F87X microcontrollers -- in this case ;; you will need to save all globally defined variables ;; along with the CPU context in the interrupt service routine. ;; ;; If ADcounter, used as an example above, was used to pass ;; a parameter, then the following would "export" the variable ;; from this file: ;; global ADcounter ;;; -------------------------------------------------------------------- ;;; Macros. (File-specific) ;;; -------------------------------------------------------------------- ;;; -------------------------------------------------------------------- ;;; Subroutines. ;;; -------------------------------------------------------------------- CODE ; Start the code section. ;;; ******************************************************************** ;;; Subroutine Name: ;;; Description: ;;; Requires: ;;; Returns: ;;; Locations Affected: ;;; ******************************************************************** ;;; -------------------------------------------------------------------- ;;; Constant Data (if not placed along with the subroutines). ;;; -------------------------------------------------------------------- END