Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - DocDi

Pages: [1]
Character LCDs / NHD-0420D3Z-NSW-BBW-V3 initialization
« on: April 04, 2016, 06:41:18 AM »
Hi everybody,

I'm trying to connect the upper LCD to a raspberry pi. I now checked all data sheets and forums I found but there are still many questions open which are so basic that I'M not sure whether I understand anything ;-)

First is in the there seem to be registers accessed which belong to a PIC18* (ADCON1, ADCON2). With the help of the specs I tried to convert these to PIC16* registers. Is this correct?
Then I have a basic chicken/egg problem. The init sequence initializes I2C in the end. I2C is already hard coded by R1 on the PCB and I get ACK from the LCD at address 0x28 which is 0x50 shifted by one bit. I also do not get any write errors. Maybe I have the same 1.8k pullup issue others in this forum had with the raspberry but this is currently not my issue. Anyhow my question is more about fundamental coding:
If I have OSCCON |= 0x73 in the example, how do I transfer this? My assumption is I have to translate it to assembler code (bsf STATUS, RP0; movlw 0x73; iorwf OSCCON,1, bcf STATUS, RP0). From the PIC16 spec I get the binary instruction codes for MOVLW, etc and all register addresses. I think this is how it would work with a PIC programmer (translate this to HEX and burn it to the PIC). Do I have to transfer this command sequence via I2C to the PIC? If I2C is not initialized how should the PIC understand this? Do I have to write the binary instruction to a register (SSPBUF, PORTC) or is it simply start bit, 0x28, instruction byte, data byte(s)? The example code uses writing into SSPBUF after init with the send_package routines therefore I think the init must be sent differently. Sorry for these stupid questions but currently I'm totally confused and I do not want to give up... 

Pages: [1]