Sensor data, screen updates and 32 pin ROMs

A project log for 65uino

6502 based learning in a familiar form factor

anders-nielsenAnders Nielsen 04/22/2023 at 16:090 Comments

It's been a few days and I had a bit more fun with the #65uino 

I've published new code to Github, that now not only handles the SSD1306 display and includes a font, but also reads a BMP180 temperature and pressure sensor.

But "reads" is not the same as getting something intelligible out. The BMP180 raw sensor data needs to be run through an algorithm to compensate the data according to some calibration data in an onchip ROM, and even though it's not awfully complicated, it's more work than I'm willing to do in 6502 assembly right now.  It is, however, a very good way to check if my i2c routines work as intended, so that's what I've done - and the current code just updates the current 16 bit sensor data on the last line of the display on every loop tick. 

Screen updates

Of course I had to figure out how to set a cursor position first - the way most libraries for the displays of this sort work is they keep a framebuffer in RAM and just focus on sending that out as fast as possible - but with our 1MHz system clock and bitbanging i2c, that's no really reasonable. 

Instead the SSD has the two commands 0x21 and 0x22 to set the column and page start + end. It seems to be that's also the easiest way to reset the cursor position, so if you want the cursor on line 3, you set the start page to 3 and the end page to 2, which will also put the cursor at the start position. 

32 Pin ROMs

You might notice the two THT resistors I threw on the ROM here. What's going on is that I've been using an SST39sf010 Flash ROM instead of the w27c512 eeprom. The 39sf's are much faster to program(and if we weren't using them for this they actually have 128K of storage) but the problem is they're 32 pin instead of the 28 pins of the breakoff section or the "ideal" 24 pin EEPROM. 

Otherwise the pinout matches so all we need to do is put a jumper from the "NC" pin 30 to VCC on pin 32 of the 39sf, a pullup on the ~WE pin and a pulldown on the A16 pin. 

I was surprised to find there IC's available as second hand IC's for basically the same price(maybe even lower!) as the w27c512's - so that's good news. It's always nice when you have the option to buy new or used. 

It's good for this case when I have to program the ROM a lot, but I'd still recommend the smaller footprints so the pins don't stick out :)