📄 dds.h
字号:
/*
* Header file for OH2NLT DDS Synthesizer board
* This file defines only board specific signals
* Other definitions from Microchip 1687x.h file
*
* Juha Niinikoski 28.03.2004
*
* SW3 added 19.04.2004
*/
#define PIC_CLK 16000000
/* Port A used for analog inputs */
#define PORTA_INIT 0b00000000
#ifdef __A_TYPE
#define TRISA_INIT 0b11111111 /* Porta = A/D inputs & digital inputs */
#else
#define TRISA_INIT 0b11111011 /* Porta = A/D inputs, RA2 = BL control */
#endif
#define ADCON0_INIT 0b11000001 /* RC osc, CH0 selected */
#ifdef __A_TYPE
#define ADCON1_INIT 0b10000100 /* right justified 3 AD ch, int. ref */
#else
#define ADCON1_INIT 0b10000101 /* right justified 2 AD ch, ext. ref, RA2 = BL */
#endif
#define BL RA2 /* back light control in 877 non A version */
#define SW3 RA5 /* Push button switches */
/* Port B signals */
#define PORTB_INIT 0b00000000 /* PORTB init data */
#define TRISB_INIT 0b01000111
#define P_EDGE RB0 /* Pulse wheel edge / IRQ input */
#define P_P1 RB1 /* Pulse wheel phase 1 */
#define P_P2 RB2 /* Pulse wheel phase 2 */
#define PW_PORT PORTB /* pulse wheel bit port */
#define PW_MASK (3<<1)
#define DDS_SER RB5 /* AD9850 DDS D7/SER */
#define LOOP_TEST RB3 // test
#define TX RB6 /* TX signal input. 0 = TX */
#define SIDEBAND RB7 /* Sideband select 0 = LSB, 1 = USB */
#define LSB 0
#define USB 1
/* Port C signals */
#define PORTC_INIT 0b00000000 /* PORTC init data */
#define TRISC_INIT 0b10000000
#define LCD_E RC3 /* LCD E signal */
#define LCD_RW RC4 /* LCD R/W signal */
#define LCD_RS RC5 /* LCD RS signal */
#define DDS_RESET RC2 /* AD9850 DDS Reset */
#define DDS_FQ_UD RC1 /* AD9850 DDS FQ_UD */
#define DDS_W_CLK RC0 /* AD9850 DDS W_CLK */
/* Port D signals */
/* Port D = LCD interface */
#define PORTD_INIT 0b00000000 /* PORTD init data */
#define TRISD_INIT 0b00000000
#define LCD_DATA PORTD /* LCD 8-bit data bus */
#define LCD_TRIS TRISD /* LCD data direction */
/* Port E signals */
/* Port E used for analog inputs */
#define PORTE_INIT 0b00000000 /* PORTE init data */
#define TRISE_INIT 0b00000011 /* !TRISE controls also PORTD mode */
#define SW1 RE1 /* Push button switches */
#define SW2 RE0
/* Voltage reference module (DAC) init */
#ifdef __A_TYPE /* if 877A with ref module */
#define CVRCON_INIT 0xC0 /* CVref ON, CVref on AN2 pin */
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -