Microchip and the HI-TECH Compiler - by Robbie
I came to the conclusion in February 2012 that the statements that I made about the HI-TECH compiler in 2008 were wrong. With a little research and knowledge I was able to understand the compiler. I now offer my knowledge to the community as I tinker with HI-TECH in the MPLAB X IDE. All of this is free! All you have to buy is your favorite programmer and Microchip microcontroller. I use the Pickit 2 and a PIC16F690 for these experiments. In the beginning, only the board that came with the Pickit will be used, but schematics will be provided as needed since I understand that the hardware included with the Pickit does vary. (I assume that the reader has a basic knowlege of C.)
Register Descriptions [datasheet page number] - These are also defined in the HI-TECH header files
- ADCON0 - A/D config register [99]
- ADCON1 - A/D config register [100]
- ADRESH - A/D result high register byte [97]
- ADRESL - A/D result low register byte [97]
- ANSEL - A low is digital in, high is analog [98]
- ANSELH - Same as ANSEL [98]
- EEADR - EEPROM address [108]
- EECON1 - EEPROM control register [109]
- EECON2 - EEPROM special register [110]
- EEDAT - EEPROM data [108]
- INCON - Interrupt control [28]
- IOCA - Interrupt on Change enable port A [51]
- IOCB - Interrupt on Change enable port B [60]
- IRCFx - Set the internal oscillator frequency [37]
- PIE1 - Peripheral Interrupt Enable [29]
- PIE2 - Peripheral Interrupt Enable [30]
- PIR1 - Peripheral Interrupt Request Register [31]
- PIR2 - Peripheral Interrupt Request Register [32]
- PORTx - Used to set the state (hi/low) of the PORT (or read the state) [49]
- T1CON - Timer 1 control register [77]
- TMR1H - Used to read or set the timer 1 counter high register [75]
- TMR1L - Same as TMR1H, but for the low register [75]
- TRISx - Used to set the direction (I/O) of a PORT [49]
- WDTCON - Watchdog timer control [189]
Preprocessor Descriptions [HI-TECH manual page number]
- #define _XTAL_FREQ 4000000 - Used to define the osc frequency in hertz for __delay() [168]
- __CONFIG() - Parameters are in the device header files. [52]
Built in functions/macros [HI-TECH manual page number]
- CLRWDT(); //HI-TECH function to clear watch dog timer (aka. kick the dog) [179]
- __delay_us(), __delay_ms() - These are delay macros. Use them with _XTAL_FREQ [168]
- void interrupt name_int() - Not a "built in" function, but this is how you define an interrupt in HI-TECH [86]