Some time ago I bought several big, beautiful, single character LCDs. These things are 1.5" tall and just scream, "Look at me I'm cool!" I ordered up some backer-boards, populated them with PCF8574 port expanders and my gorgeous new chips, bread boarded several and had this really nice display all working. Oh, it was a thing of beauty! Then, the economy took a turn, job... etcetera.
Long story short(er)... Life is good again and my attention has returned.
I wrote a short, simple program because, well... I just wanted to see them work you know? I can't be the only one here that gets a little "goosebumpy" when intellect, dexterity, and technology all come together.
Alas... no joy.
I mean, technically, it works. Either digit works perfectly alone - in either position, but no amount of wishing will inspire the second address to respond. I am clearly missing something, but no amount of searching the forum, the internet, or the manual reveals an answer. I feel as though there needs to be something between the two writes - a stop, start, reset, a well enunciated "abracadabra"... something. I2CSTOP causes an error and no amount of pause resolves the issue. I've tried using a variable as the address, reversing the 2 statements... I don't know what else to try.
Please take a look and explain what I'm missing?
Code:
#CONFIG
__config _CONFIG1, _INTRC_IO & _WDT_OFF & _PWRTE_OFF & _MCLR_ON & _BODEN_OFF & _LVP_OFF & _CPD_OFF & _WRT_PROTECT_OFF & _DEBUG_OFF
__config _CONFIG2, _FCMEN_OFF & _IESO_OFF
#ENDCONFIG
OSCCON = %01110000 'SET OSC OPTIONS
DEFINE OSC 8
ANSEL = %00000011 'SET ANALOG TO DIGITAL
TRISA = %00000000 'SET PORTS OUTPUT
TRISB = %00000000
DEFINE DEBUG_REG PORTB 'SERIAL OUT
DEFINE DEBUG_BIT 5
DEFINE DEBUG_BAUD 2400
DEFINE DEBUG_MODE 0
SDA VAR PORTB.1
SCL VAR PORTB.4
OUTP VAR BYTE
LP VAR BYTE
mainloop:
FOR LP=0 TO 9
READ LP, OUTP
I2CWRITE SDA, SCL, $7C, OUTP 'WRITE 1's
I2CWRITE SDA, SCL, $70, OUTP 'WRITE 10's
PAUSE 250
NEXT LP
Goto mainloop 'VIRTUAL END
DATA 63, 6, 91, 79, 102, 109, 124, 7, 127, 103 'DEFINE DIGITS 0 - 9
End
I'm running it on a 16F88, internal 8M crystal, PBPX 3.0.4.4 and MCS 5.0.0.0
Bookmarks