Close

100% Utilization?

A project log for Well well

Monitoring the monitor that monitors the well

darrin-bDarrin B 11/03/2023 at 19:570 Comments

This project is putting nearly everything on the Z8's die to use. Nearly all of the RAM and Flash ROM are being used. Both timers are busy, as are the UART and SPI ports. All of the I/O pins have something to do. Because I installed a Z8F022 device, the ADC and its' input multiplexer is idle. For now the Watch-Dog timer is also idle, but I intend to put it to work soon. Finally there is the I2C controller, it was idle until yesterday. 

I have been wanting to benchmark several aspects of the firmware, but was unable to due to the lack of an available timing source. Or, so I thought. Eventually, I recalled that one or another of the serial communication devices could be used as a simple timer somehow. I reread the fine manual to find that all (UART, SPI, I2C) of the serial devices could be used in this way. The I2C hardware is now the benchmark timer!

Using the timer mode of the I2C port as an event counter exposed a mis-handling of one of the interrupts. Correcting the interrupt's behavior freed up enough CPU cycles that it is time to beta test!!

Discussions