Author Topic: NHD-0420D3Z-NSW-BBW-V3 initialization  (Read 1884 times)

DocDi

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
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  http://www.newhavendisplay.com/app_notes/Serial_LCD.txt 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... 

ceb4

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: NHD-0420D3Z-NSW-BBW-V3 initialization
« Reply #1 on: May 02, 2016, 09:34:55 AM »
I am using a Raspberry Pi model 2 B with the NHD-0420D3Z-NSW-BBW-V3 on both I2C1 (3,5) and I2C0. I was getting high spikes on the SDA above the 3.3 levels the Pi wants to deal with. I put a P82B96 between the Pi and NHD and don't have a problem with levels (now at +5) or display operations. The NHD specifications call for 5 volt levels.

 

NHD‐C12864A1Z‐FS(RGB)‐FBW‐HT1 Initialization

Started by BMohlmanBoard Graphic LCDs

Replies: 5
Views: 3947
Last post January 13, 2016, 07:44:16 AM
by Paul_B
Working on NHD‐2.4‐240320SF‐CTXL#‐FTN1, have problem in initialization

Started by sli25Board TFTs

Replies: 6
Views: 3811
Last post June 04, 2015, 09:52:25 PM
by sli25
RS232 PIC CCS COMPILER COMANDS FOR NHD-0420D3Z-NSW-BBW-V3 ISSUE

Started by DavidVMBoard Character LCDs

Replies: 2
Views: 656
Last post May 30, 2017, 12:58:32 PM
by DavidVM
NHD-0420D3Z-NSW-BBW-V3 i2c display and Arduino missing characters

Started by 0miker0Board Character LCDs

Replies: 0
Views: 699
Last post July 06, 2017, 11:05:59 AM
by 0miker0
NHD-0420D3Z-NSW-BBW-V3 back-light flickers

Started by rickford66Board Character LCDs

Replies: 3
Views: 3466
Last post May 06, 2015, 08:34:09 AM
by fraryb