3 * I/O Port defines / Main.
4 * Copyright (C) 2013-06-10 K.Ohta <whatisthis.sowhat ai gmail.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2,
10 * or (at your option) any later version.
11 * This library / program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this library; see the file COPYING. If not, write to the
18 * Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
21 * As a special exception, if you link this(includeed from sdcc) library
22 * with other files, some of which are compiled with SDCC,
23 * to produce an executable, this library does not by itself cause
24 * the resulting executable to be covered by the GNU General Public License.
25 * This exception does not however invalidate any other reasons why
26 * the executable file might be covered by the GNU General Public License.
37 #define _XTAL_FREQ 8000000
46 // If you use I2C-Type ACM1602, You should define, otherwise #undef.
55 #include "iodef_i2c.h"
60 * RE3: VPP (ICSP Programming Voltage) / MCLR, Dont use for I/O.
62 * PORTA/B/C USED basic.
69 * RA4 : AM LAMP('1' = On)
70 * RA5: FM LAMP('1) = On)
71 * RA6-RA7 : Used for CLOCK, connect to 8MHz resonator.
82 * RC0 : RF AMP SEL bit0
84 * RC2 : RF AMP SEL bit1
89 * In addition, usage of PARALLEL-LCD,You should use 40Pin(or greater) PIC.
97 * RD4-RD7: LCD DB4-DB7
100 * RE0: External Power AMP
101 * RE1: Power to Radio-Chip.
102 * RE2: ADC(IN) to measure battery
103 * RE3: VPP (ICSP Programming Voltage) / MCLR
106 #define TRIS_A_VAL 0b11000000
107 #define AN_A_VAL 0b00000000
109 #define TRIS_B_VAL 0b11111111 /* PORTB as INPUT.*/
110 #define AN_B_VAL 0b00000000
112 #define TRIS_C_VAL_O 0b10011000 /* FOR I2C-WRITE, RC7=INPUT */
113 #define TRIS_C_VAL_I 0b10011000 /* FOR I2C-WRITE, RC7=INPUT */
114 #define AN_C_VAL 0b00000000
116 #define TRIS_D_VAL 0b00000000 /* FOR OUTPUT, LCD(Optional) */
118 #define TRIS_D_RVAL 0b11110000 /* FOR INPUT*/
120 #define TRIS_D_RVAL 0b11111111 /* FOR INPUT*/
123 #define TRIS_E_VAL 0b00000100 /* FOR OUTPUT, ADC, PSP=OFF */
125 #define _BATT_ADC 0x07
126 #define _REF_ADC 0x10
127 #define _ADC_INITF ANS7
128 #define _ADCH_INITF 0x00
130 #include "iodef_amp.h"
134 #define _AM_STATLAMP LATAbits.LATA4
135 #define _FM_STATLAMP LATAbits.LATA5
136 #define _POW_STATLAMP LATDbits.LATD3
138 #include "iodef_key.h"
139 #include "iodef_lcd.h"