Pic Firmware Description
Wattmeter source code remarks
General Description
The PIC microcontroller program is written in assembler using the Parallax-like macro (included in the package). The program structure is quite simple because it is based on a endless loop, that invoke the “sample” routine. Before to enter into the endless loop the program execute the “lemcalib” routine. The aim of this routine is the LEM LTS 25 NP start up calibration. Because of this necessity, at the power on the wattmeter have to be leaved unconnected. The lemcalib routine is about 5 second long.
The sample routine execute first the analog 2 input sampling to establish the current position of the “mode” switch. Depending on the selected mode the firmware performs 256 blocks of 64 sampling (for averaging purpose) of An1(current), An0 (volt), or both channels (watt).
Interrupt handler
In the wattmeter assembler is present an interrupt handler but it is unused in this version.
Remote Control
In the current version the PC serial interface is set but not used. The firmware and the hardware are ready to host the remote control and monitor operations, as well as the boot loader features.
Comments ::
© 2004 Seven-Segments
All content on this website
(including text, photographs, resource files, and any other original works),
unless otherwise noted, is licensed under a
Creative Commons License