Maplin LCD, cont.

Maplin LCD with Battery IndicatorI eventually figured out how to get the OSD elements for the Maplin LCD to appear.

I tracked down which byte needed to be set by just iterating through all 80 bytes and writing 0xFF into DDRAM. Address 10 and 11. The second byte represents a down arrow and the battery indicator.

Next I tried to figure out which bits controls which indicator. After trying every combination I found no pattern to which ones were turned on. So I tried using a custom character using CG RAM, and found the bits that needed to be set.

The first byte in the first custom character, bit 5 represents the second to the last down arrow, bit 4 represents the third from last down arrow, bit 3 is the fourth from last down arrow, etc. To turn off set the byte to 0x00.

The first byte in the second custom character, bit 2 represents the biggest part of the battery indicator, bit 3 in the medium, bit 4 the smallest, and bit 5 is the last down arrow.

For the picture in this post, I have my custom bytes set as follows:

0x40: 00000000
0x48: 00000111

I seem to have broken my USB adapter, or my breadboard where the USB adapter was plugged in. I should have used a proper header to create it.

Maplin LCD

IMG_0239I few weeks ago I got an random LCD from a lucky dip bag in Maplin. There were no markings on the outer case identifying it, and when I took it apart all I could find was LCM015.

Very few google results turned up anything useful, most of them were others also trying to make one work. One of them had a link to a website that had a picture that looks very similar, though the site was in German. Luckily Chrome’s auto translate feature kicked in.

The site listed the purpose of each pin, and that to communicate with the LCD I would need to communicate using the I2C pins to set the values on the LCD’s HD44780 pins. The interface is a IC PCF8574, so after looking up the datasheet, I found that it has a maximum clock rate of 100KHz, would need to communicate in 4bit mode.

I didn’t have a PIC chip that supported I2C, so I used a PIC16F627, and wrote some code to do the I2C (which was more complicated than I though due to the fact it was in assembly). It didn’t work, infact the only way I could get any response was to a high signal on all but the ground pin.

Correct LCD PinsI decided the reason it didn’t work was because the pull-up resistors were insufficient, but even after disabling pull up resistors and using my own external ones, it still didn’t work. So I ordered a PIC24FJ64GB002 from Farnell, as well as an ARM11 and an OLED display to experiment with later.

I haven’t used a 24F before, and thought it worked the same as the 16F, but the I2C instead of outputting a high signal uses an open-drain pin system, so I needed to apply my own pull-up resistor again, my new oscilloscope was handy in identifying this problem though reading the datasheet would have been easier.

I much prefer the open drain since I can supply any voltage I want to the I2C pins they support 5V, but the chip is 2.5V. I chose to supply the 5V needed by USB, and the IC by the PicKit 3.

Still however, it was not working. Then it suddenly hit me, that the display only lit up when I supplied a high signal to the last pins. The german website had the pins backwards. I don’t know if it was the picture, or just another LCD, but after reversing it, it worked straight away.

You may notice there is another 8 pin chip in my circuit, that is an EEPROM I was using to experiment with saving and loading memory. I’ve uploaded a corrected pin layout. I’m sure the 16F probably would have worked now.

Now I have it working, I just need to figure out how to control the battery meter and the other OSD elements.

LCDs, I2C, HD44780 and Flux

Refillable Flux pen

Continuing on with my recent interest with electronics, I discovered something else I never knew. Flux. Its amazing stuff, I had no idea what it was, apart from that it was possibly somehow related to a Flux Capacitor.

It is basically a metal cleaner, removing oxides on the outside of metal, making solder so much easier. I also saw something where someone placed it on some tracks then after tinning their soldering iron, then just dragged it across and the solder attached itself to the tracks just fluxed.

I got a bunch of LCDs and 7-segment displays to play around in a lucky dip bag from Maplin. Probably not worth the money I spent, I’m sure one of them uses AC, and will have to play around a bit.

The biggest LCD that came with it in a metal case. After a bit of prying, I managed to open it up and found only one code that returned a google result, LCM015. No datasheet, from a helpful German site told me what the 5 pins were, and that they are for I2C using the IC PCF8574 on the LCD board. This is connected to the HD44780 type LCD for use in 4bit mode. I found a helpful simulator for HD44780 commands.

Mac Programmer Calculator

Although I wrote a program to run on a PIC16F627 to communicate through I2C and initialise the LCD, I have yet to get it working fully, one line is always filled with square, and the battery indicator is always present. I’m going to try to modify the memory directly and see if that changes anything.

The I2C is acknowledging receipt of the commands, and the signal outputs are correct in the MPLab simulator, so for the moment I’m assuming that this is what it looks like when initialised. Worse case scenario, I will just just transmit all 256 possible commands before taking it apart and manually send signals to the HD44780 interface through short circuiting.

I’ve decided what I want to make with it though, the Mac Programmer Calculator.