Quick Intro to I2C
Along with USART and SPI, I2C is definitely the most common interface used by a microcontroller to communicate with peripherals. In order to implement an I2C bus all you need is two open-collector collector pins, one for the SCL (clock) line and one for the SDA (data) line. It has to be open-collector because there are times during the protocol when two devices drive the clock line at the same time which can lead to a short circuit if one device drives it high and one drives it low. This way, the bus lines are high by default due to the pull up resistors – if a device wants a line to go low, it just shorts it to ground via an internal transistor. There is no path from VCC to GND that does not contain a high-valued resistor.
Continue reading “The Atmel’s Universal Serial Interface (USI) sucks for I2C”
A geometric series is a series of numbers where each number in the series is equal to the previous number multiplied by a constant multiplication factor. For example: 2, 4, 6, 8, 16… is a geometric series with a constant multiplication factor of 2.
The sum to infinity of such a sequence, then, can be represented as:
Continue reading “An Intuitive Derivation/Proof of the Sum of an Infinite Geometric Series based on Zeno’s Paradox”
Something that has been annoying me for a while is that there is no way to download your WordPress.com stats from the website!
So I wrote a script in python to allow you to download all of your stats into a spreadsheet. Here is the guide.
Basically, you need to provide the script with an example XML Http Request (XHR) where the website is pulling stats data from the WordPress.com server. From this XHR, the script then reconstructs a new XHR to get all of the data.
Soft switching allows a single button to be used as both an input and a power button. An example of this is the LCR45 LCR meter from Peak Electonic Design which has two buttons – on/menu and enter/off. As you can tell from the names, both buttons operate to turn the device on/off and also trigger the menu and enter functions in the interface.
This could be achieved by using both buttons only as inputs to the processor (a PIC in this case) and never turning the chip off, simply putting it into low power mode and using the ‘on’ button to wake it from this sleep. But even the best low power mode uses more power than actually turning the device off and the battery would eventually drain. So how can we achieve a multipurpose button and still use no power when turned off? To answer this I reverse engineered the LCR45 and drew out the circuit which I will now explain.
Continue reading “Soft Switching – Reverse engineering the LCR45”
Yesterday, I had just got back from campus and was just enjoying a coffee before I got down to work when I got a message from a friend:
“…come and build stuff…”
There was an event on campus called “Make Cool ShMIT – again!”, where they provide a bunch of components and (more importantly) pizza, and you build something in teams for 2 hours. I decided that work could wait and hopped on the bus to campus.
Continue reading “Hackathon: PAL – Proximity Alert Locator”