01/02/2017 at 19:05 •
Firmware is written in Microchip Assembly and does not require any libraries. It can be compiled for two PIC microcontrollers: PIC12F629 and PIC12F675. If you compile for PIC12F675 the firmware will be 2 words larger because of additional registers that need to be initialized for this PIC.
You can compile the code for 50 or 60Hz mains frequency. There is a constant in the code that you need to un/comment for this:
;***** Mains frequency in Hz ***** ; if defined it uses lookup table for 50Hz, else it uses 60Hz lookup table #define FREQ50 1
To compile for F629, you need to include appropriate header files like this:
;***** Declaration and PIC config ***** PROCESSOR 12f629 #include "p12f629.inc"
The resulting code will occupy exactly 559 words (978,25). There is one additional word at the end of program memory which is programmed in the Microchip factory. If we count that in as well, the size of program is 980 bytes.
To compile for F675, you need to include appropriate header files like this:
;***** Declaration and PIC config ***** PROCESSOR 12f675 #include "p12f675.inc"
The resulting code will occupy exactly 561 words (981,75 bytes). If we add that OSCCAL from the end, the size of program is: 983,5 bytes.