Sometimes, the most difficult part when dealing with I2C is to differentiate the communication direction: which signal is sent to which device. Hence, this simple trick should be useful.
November 14, 2009
August 16, 2009
LPC1766 Not So Reliable UART0 Loopback
Let’s continue the last post with the real interrupt based program: UART0 interrupt-based loopback. The program example will echoing anything that is sent to the serial port, but since it’s not checking whether the TX FIFO is empty or not during the loopback, some data may be lost if you sent a file (or sending a lot of data).
The whole application can be downloaded here.
August 14, 2009
Cortex-M3 Interrupt/Exception Control
Cortex-M3 has NVIC (Nested Vector Interrupt Controller), a kind of peripheral, to support up to 255 interrupts.
Other than that, it also has WIC (Wakeup Interrupt Controller), which similar to NVIC, but it doesn’t need any clock to run. Hence it can be used to detect any interrupt during sleep mode without burning energy (no need to have any clock running on system at all).
Since WIC is only available on rev2 Cortex-M3 (currently only LPC17xx that have it), this post will only discuss the NVIC control. (more…)