⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 evkit.inc

📁 Validate Subsystem Compatibility - Source Code
💻 INC
字号:
;*
;** EvKit II include file
;**
;*  09/27/01 LDJ updated
;*

#define TRUE  1
#define FALSE 0

;// serial port
#define RTS     PORTC,0 ;// o
#define CTS     PORTC,5 ;// i
#define TX_232  PORTC,6 ;// o
#define RX_232  PORTC,7 ;// i

;// LCD display
#define DB4     PORTD,0 ;//i/o
#define DB5     PORTD,1 ;//i/o
#define DB6     PORTD,2 ;//i/o
#define DB7     PORTD,3 ;//i/o
#define RW      PORTD,4 ;// o select RD or Write
#define RS      PORTD,5 ;// o select register
#define LCD_E   PORTD,6 ;// o chip select

;// programming Socket 
#define LED     PORTD,7 ;// o switch on the yellow LED
#define VDD     PORTD,7 ;// o set socket VDD pin to 5V

;// encoder programming
#define S0      PORTB,0 ;// o clock
#define S1      PORTB,1 ;// o
#define S2      PORTB,2 ;// o
#define S3      PORTB,3 ;// o
#define DATA    PORTA,5 ;// i/o data

;// Step up circuit
#define VPPON   PORTA,4 ;// o apply voltage 
#define STEPOUT PORTC,2 ;// o PWM output pin
#define VPPRST  PORTB,5 ;// o clears Vpp/ reset part
#define STEPIN  PORTA,0 ;// i analog input

;// HCS512 programming
#define DAT512  PORTA,2 ;// i/o
#define CLK512  PORTA,1 ;// i/o
#define MCL512  PORTB,4 ;// i MCLR line

;// HCS515/HCS500 programming
#define DAT515  PORTE,2 ;// i/o
#define CLK515  PORTA,3 ;// i/o

;// transponder interface
#define PWM_COIL PORTC,1 ;// o 125kHz carrier
#define COIL_IN  PORTE,1 ;// i reading transponder
#define COIL_ON  PORTB,0 ;// o activate resonant circuit 

;// radio receiver
#define RFIN    PORTE,0  ;// i radio input

;// i2c interface
#define SCL     PORTC,3  ;// o Serial Clock
#define SDA     PORTC,4  ;// i/o Serial Data
;#define TRIS_SDA TRISC4

;// keypad interface
#define BOOT    PORTB,4 ;// i BOOT button
#define ROW0    PORTB,0  ;// o rows
#define ROW1    PORTB,1  ;// o
#define ROW2    PORTB,2  ;// o
#define ROW3    PORTB,3  ;// o
#define COL0    PORTB,4  ;// i columns
#define COL1    PORTB,5  ;// i
#define COL2    PORTB,6  ;// i
#define COL3    PORTB,7  ;// i


;// init masks
;// clock/data lines to decoders are default to float at init
#define DEFPA   b'11101111'; // x x DATA VPPON CLK515 DAT512 CLK512 STEPIN
#define DEFPB   b'11010000'; // COL3 COL2 VPPRST COL0 S3 S2 S1 S0/COIL_ON
#define DEFPC   b'10110110'; // RX_232 TX_232 CTS SDA SCL STEPOUT PWM_COIL RTS
;// STEPOUT defaults to input until used (external pull down) 
#define DEFPD   b'00000000'; // LED E RS RW DB7..DB4
#define DEFPE   b'11101111'; // x x x !PSP x DAT515 COIL_IN RFIN

#include <p16f877.inc>

; debugging macro, outputs 1 literal digit on LCD connector 
DEBUG   MACRO   LIT
        movlw   LIT & 0x0f
        iorwf   PORTD,F
        nop
        nop
        movlw   0xf0
        andwf   PORTD,F
        ENDM

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -