Quick level shifter for XMEGA and 5V LCDs

Most alphanumeric LCDs work on 5V, with a minimum of 3.7V for Vin_high. This means that to connect an XMEGA working on 3.3V to such a LCD there needs to be a level shifter between the two.

UPDATE: Fixed a small bug in the schematic; updated resistor values. It will work now even with a maximum XMEGA clock, not just at low frequencies.

Continue reading “Quick level shifter for XMEGA and 5V LCDs”

XMEGA TWI master and MTCH6102

An alternative title for this article would be: “How to design a crappy touchpad and rip out your hair afterwards”

As I mentioned in my previous post I’m working on something that needs two XMEGAs to talk to each other over TWI. One of them will have a touchpad for human input and a HD44780 compatible 4×20 display. The reason I went this route is because when sourcing buttons to put on the front panel I quickly realized that it would be cheaper to use a capacitive touch solution. Enter the MTCH6102 part from Microchip.

Continue reading “XMEGA TWI master and MTCH6102”

XMEGA ADC and TWI with interrupts

My current project includes an XMEGA microcontroller, specifically an xmega32a4u. This part is supposed to contain the fixed ADC peripheral. The first versions of this part (xmega32a4) had some problems. You can read more about it here.

What I need is to have a TWI (compatible with I2C) interface between two XMEGAs. One will always be a slave and one will always be a master. The master will write a number of bytes to the slave asynchronously and will periodically read a number of bytes from the slave. Continue reading “XMEGA ADC and TWI with interrupts”