Hi All,
Well, I'm at my wits end, so I thought I'd ask the experts. I'm attempting to use an Adafruit 4-digit display that uses an I2C IC, specifically the Holtek HT16K33. I haven't located any PICAXE code for this, but I've poured through the datasheet and attempted to reverse engineer the Arduino code written for it. Unfortunately, that is a painful experience.
I've come up with what I think is close below, but no dice. I can't get the display to show anything.
Looking at page 32 of the datasheet, I think I'm starting things off right, but I'm not sure. The big question is whether I'm sending the actual data correctly. According to page 32, the bottom flowchart shows sending an address setting (I assume this is taken care of by the 0 right after the writei2c command signifying the address should be 0) followed by RAM data (not sure if I need to send one or two bytes) and finished with a display on command. Of course, maybe I'm sending the initialization commands wrong as well.
Also attached is a reversed engineered schematic since I couldn't find one online.
Any suggestions greatly appreciated. Will post final code if ever I figure this bugger out.
Well, I'm at my wits end, so I thought I'd ask the experts. I'm attempting to use an Adafruit 4-digit display that uses an I2C IC, specifically the Holtek HT16K33. I haven't located any PICAXE code for this, but I've poured through the datasheet and attempted to reverse engineer the Arduino code written for it. Unfortunately, that is a painful experience.
I've come up with what I think is close below, but no dice. I can't get the display to show anything.
Code:
#picaxe 20m2 ' Define PICAXE 20M2
#no_data ' Ignore EEPROM data - loads program faster
Initialize: ' Initial pins and set up variables
LET dirsB = %11111111 ' Make all B pins outputs
LET dirsC = %00000011 ' Make pins C.0 & C.1 outputs; rest as inputs
LET pinsB = %00000000 ' Turn off all outputs on port B
LET pinsC = %00000000 ' Turn off all outputs on port C
PAUSE 2000
Main: ' Main Routine
i2cslave %11100000, i2cfast, i2cbyte ' Set slave address to DS1307
writei2c 0, (%00100001) ' Turn on clock
writei2c 0, (%10100000) ' Set all rows as outputs
writei2c 0, (%11101111) ' Set brightness to maximum
writei2c 0, (%10000000) ' Disable blinking and turn off display
writei2c 0,($FF,%10000001) ' Set all rows high for column 1 (digit 1) followed by turn display on command - expect to see 8 on first digit of display
PAUSE 1000 ' Wait one second
END
Looking at page 32 of the datasheet, I think I'm starting things off right, but I'm not sure. The big question is whether I'm sending the actual data correctly. According to page 32, the bottom flowchart shows sending an address setting (I assume this is taken care of by the 0 right after the writei2c command signifying the address should be 0) followed by RAM data (not sure if I need to send one or two bytes) and finished with a display on command. Of course, maybe I'm sending the initialization commands wrong as well.
Also attached is a reversed engineered schematic since I couldn't find one online.
Any suggestions greatly appreciated. Will post final code if ever I figure this bugger out.