I/O Control for Building Controller

Project Description

The project required the redesign of firmware for the company’s Echelon Lonworks-based building controller which is used to control heating, cooling, and ventilation systems for multiple zones, in addition to various ancillary devices in a commercial building. This portion of the system operated erratically and would not meet the product requirement specifications. It included 8[12] analog inputs [and it’s associated dual-slope A/D converter] which were then filtered by software; several digital inputs that required debouncing with 2 different filters, and several digital outputs that could operate in either discrete, pulse width modulation or “float” mode. The A/D converter required a start of convert (SOC) pulse that is accurate to 1 microprocessor cycle, even though hardware interrupt latency could be far beyond this. Other system issues were also involved, including the creation of an accurate hardware interrupt for the system, and an RTOS/RTC timer that was not an exact multiple of the crystal frequency. Various areas of development were involved.

The project required the development, creation, and testing of new low-level assembly code and ‘C’ routines to implement this functionality. A novel algorithm and inter-process communications were employed to cause the hardware interrupts from the timer [which ran at differing divisor counts such that the aggregate value was exactly 1mS] to call the A/D function that controlled the SOC pulse at exactly the same time [with ±0 CPU cycles of variation]. If the interrupt latency was dynamically determined to be too long [based on the timer count] then the results of the A/D process were discarded and reacquired. This produced a perfectly accurate real time clock and ±½ count accuracy of the device’s A/D over a 2-day period.

Assembly and ‘C’ code was developed using Borland ‘C’, Keil ‘C’ and Keil Assembler for the 8051/251. Development and initial testing were done in a DOS environment, then the code was ported and deployed on their target hardware, which was 8051 based. Final testing, which required no rework for the target system, was completed on the target system using Nohau emulator tools and the company’s custom WindowsÒ configuration tool, as required.

Skills Required

  • Proficiency in the ‘C’ language.
  • Intimate knowledge of 8051 architecture and assembly language.
  • Reentrant and context switching techniques.
  • Real Time Operating System experience.
  • Knowledge of environmental controls.
  • System architecture knowledge.
  • Echelon Lonworks knowledge.
  • Knowledge of Nohau emulator tools.
  • Knowledge of test equipment.

Services Used

  • Design, coding, and debugging of Keil ‘C’ and assembly applications.
  • Creation of Product Acceptance and System Integration Test Plans.
  • Documenting of software and test procedures.

Project Size
2 Months effort at the customers site.

Customer
Major manufacturer of environmental controls.