Announcement

Collapse
No announcement yet.

No LCDOUT drive

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • No LCDOUT drive

    I can't get the LCDOUT command to drive the HD44780 display with any of the following 40 pin chips: 16F1779, 16F18875, 18F47k42, 16f19176. I can get a 18F4620 to run the code in the same exact hardware /software setup. Since the 4620 doesn't have the PPS module I suspected they were setup in a way to make the command fault. I tried turning off all of them using the PMD registers.(no change) All chips are setup to run the internal oscillator using the default configs and I can change the output freq. by altering the osccon freq. registers or the define OSC. I have a blink routine that runs first (ok on all chips), then the LCDOUT routine.(no change on the display except for the 4620 which runs perfect). Using PBP3.1.2.4, MeProg 4.66, MPLABX 5.35 If a register file is not correct I have missed it. Has anyone encountered any thing similar to this and what was the cause?

  • #2
    I have NEVER had an LCD display that I couldn't operate with any of the PIC processors yet. My current project has an 18F47K40 processor running an 40 x 4 line display. Just leave the PPS registers as default to PIN mode.
    Dave Purola,
    N8NTA
    EN82fn

    Comment


    • #3
      Dave , "when you say leave the PPS registers as default to PIN mode" are you saying leave them in the POR reset state or unaltered? If so this is how I am programming now with the same results. I can change the pause period between displaying line one and two and although nothing changes on the display the time change is accounted for in program time. Totally makes no sense, I can't get anywhere with this.

      Comment


      • #4
        without your code and preferably schematic too, its all just idle speculation

        Comment


        • #5
          '************************* 16F19176 ****************************************
          '
          '************************* Configuration Files ******************************
          '
          ' Using Default Configs
          '
          '********************************* I/O ****************************************
          '
          TRISA = %00000
          TRISB = %00000000
          TRISC = %00000000
          TRISD = %00000000
          TRISE = %00000000
          ADCON0 = %00000000
          ADCON1 = %00001111
          ANSELA = %00000000
          OSCFRQ = %00000110
          ODCONA = %00000000
          CCP1CON = %00000000
          CCP2CON = %00000000
          '******************************* Defines **************************************
          define OSC 32
          '
          define LCD_DREG PORTC
          DEFINE LCD_DBIT 0
          DEFINE LCD_RSREG PORTD
          DEFINE LCD_RSBIT 1
          DEFINE LCD_EREG PORTD
          DEFINE LCD_EBIT 0
          DEFINE LCD_LINES 2
          DEFINE LCD_BITS 4
          DEFINE LCD_COMMANDUS 1500
          DEFINE LCD_DATAUS 44
          '
          '****************************** Variables *************************************
          LEDgrn var PORTB.1
          LEDyel var PORTB.2
          LEDred var PORTB.3
          Count1 var byte
          '****************************** Initilization *********************************
          '
          '****************************** Main Program **********************************
          Main:
          LEDtest:
          for Count1 = 1 to 3
          high LEDgrn
          pause 200
          low LEDgrn
          pause 200
          high LEDyel
          pause 200
          low LEDyel
          pause 200
          high LEDred
          pause 200
          low LEDred
          pause 200
          next Count1
          pause 1000
          LCDtest:
          LCDOUT $FE,1
          LCDOUT $FE,2
          LCDOUT " Test LCD "
          pause 1000
          lcdout $FE,$C0
          lcdout " Test LCD "
          pause 1000
          lcdout $FE,1
          pause 500
          goto Main
          end
          '******************************* End of Program *******************************
          '
          '****************************** 18F4620 ****************************************
          '
          '**************************** CONFIGURATION FILES *****************************
          '
          'Config files changed from default to enable internal oscillator
          'Default state was HS oscillator
          '
          #config
          CONFIG OSC = INTIO67 ;Internal osc. block, port function on RA6 and RA7
          CONFIG FCMEN = OFF ; Fail-Safe Clock Monitor disabled
          CONFIG IESO = OFF ; Oscillator Switchover mode disabled
          CONFIG PWRT = OFF ; PWRT disabled
          CONFIG BOREN = OFF ; BOR enabled in hardware only (SBOREN is disabled)
          CONFIG BORV = 3 ; Minimum setting
          CONFIG WDT = OFF ; WDT enabled
          CONFIG WDTPS = 32768 ; 1:32768
          CONFIG CCP2MX = PORTC ; CCP2 input/output is multiplexed with RC1
          CONFIG PBADEN = OFF ; PORTB<4:0> are configured as digital I/O on Reset
          CONFIG LPT1OSC = OFF ; Timer1 configured for higher power operation
          CONFIG MCLRE = ON ; MCLR pin enabled; RE3 input pin disabled
          CONFIG STVREN = OFF ; Stack full/underflow will cause Reset
          CONFIG LVP = OFF ; Single-Supply ICSP disabled
          CONFIG XINST = OFF ; Extended instructions/Indexed Address mode disabled
          CONFIG DEBUG = OFF ; RB6 and RB7 configured as general purpose I/O pins
          CONFIG CP0 = OFF ; Block 0 (000800-003FFFh) not code-protected
          CONFIG CP1 = OFF ; Block 1 (004000-007FFFh) not code-protected
          CONFIG CP2 = OFF ; Block 2 (008000-00BFFFh) not code-protected
          CONFIG CP3 = OFF ; Block 3 (00C000-00FFFFh) not code-protected
          CONFIG CPB = OFF ; Boot block (000000-0007FFh) not code-protected
          CONFIG CPD = OFF ; Data EEPROM not code-protected
          CONFIG WRT0 = OFF ; Block 0 (000800-003FFFh) not write-protected
          CONFIG WRT1 = OFF ; Block 1 (004000-007FFFh) not write-protected
          CONFIG WRT2 = OFF ; Block 2 (008000-00BFFFh) not write-protected
          CONFIG WRT3 = OFF ; Block 3 (00C000-00FFFFh) not write-protected
          CONFIG WRTC = OFF ; Config regs (300000-3000FFh) not write-protected
          CONFIG WRTB = OFF ; Boot Block (000000-0007FFh) not write-protected
          CONFIG WRTD = OFF ; Data EEPROM not write-protected
          CONFIG EBTR0 = OFF ; Block 0 (000800-003FFFh) not protected
          CONFIG EBTR1 = OFF ; Block 1 (004000-007FFFh) not protected
          CONFIG EBTR2 = OFF ; Block 2 (008000-00BFFFh) not protected
          CONFIG EBTR3 = OFF ; Block 3 (00C000-00FFFFh) not protected
          CONFIG EBTRB = OFF ; Boot Block (000000-0007FFh) not protected
          #ENDCONFIG
          '******************************** I/O *****************************************
          TRISA = %00000000
          TRISB = %00000000
          TRISC = %00000000
          TRISD = %00000000
          TRISE = %00000000
          OSCCON = %01100000'internal osc runs at 4Mhz (internal osc selected by configs)
          CMCON = %00000111
          CCP1CON = %00000000
          CCP2CON = %00000000
          ADCON2 = %00000000
          ADCON1 = %00000000
          ADCON0 = %00000000
          INTCON = %00000000
          '******************************** Defines *************************************
          DEFINE OSC 4
          '
          define LCD_DREG PORTC
          DEFINE LCD_DBIT 0
          DEFINE LCD_RSREG PORTD
          DEFINE LCD_RSBIT 1
          DEFINE LCD_EREG PORTD
          DEFINE LCD_EBIT 0
          DEFINE LCD_LINES 2
          DEFINE LCD_BITS 4
          DEFINE LCD_COMMANDUS 1500
          DEFINE LCD_DATAUS 44
          '****************************** Variables *************************************
          LEDyel var PORTB.1
          LEDgrn var PORTB.2
          LEDred var PORTB.3
          Count1 var byte
          '****************************** Initilization *********************************
          '
          '****************************** Main Program **********************************
          Main:
          for Count1 = 1 to 3
          high LEDyel
          pause 200
          low LEDyel
          pause 200
          high LEDgrn
          pause 200
          low LEDgrn
          pause 200
          high LEDred
          pause 200
          low LEDred
          pause 200
          next Count1
          pause 1000
          LCDtest:
          LCDOUT $FE, 1
          LCDOUT $FE, 2
          LCDOUT " Test LCD "
          pause 1000
          lcdout $FE,$C0
          lcdout " Test LCD "
          pause 1000
          lcdout $FE, 1
          pause 500
          goto Main
          end
          '**************************** End of Program **********************************
          '
          'Having trouble getting the schematic to post.
          'DB4-RC0
          DB5-RC1
          DB6-RC2
          DB7-RC3
          E-RD0
          RS-RD1
          RW-Vss

          Comment


          • #6
            the first thing i notice is that you have left portd pins as analog the lcd won't like that
            and cmcon=7 , the chip has no cmcon reg its cm1con0/1 and cm2con0/1 and setting any of them like that does not do what you think it will
            on a 16f19176
            Code:
            TRISA = %00000000
            TRISB = %00000000
            TRISC = %00000000
            TRISD = %00000000
            TRISE = %00000000
            OSCCON = %01100000'internal osc runs at 4Mhz (internal osc selected by configs)
            CMCON = %00000111   ???? what why????
            
            these serve no purpose
            CCP1CON = %00000000
            CCP2CON = %00000000
            ADCON2 = %00000000
            ADCON1 = %00000000
            ADCON0 = %00000000
            INTCON = %00000000

            Comment


            • #7
              I tried this:
              CM1CON0 = %00000000
              DAC1CON0 = %00000000
              ZCDCON = %00000000

              This is the POR state, the 7th bit when zero turns off that peripheral.
              This made no change, still no LCDOUT
              Will you post code for any of the chips, except the 46, If the difference is config or file setup so be it. Changing control registers hasn't helped so far.

              Comment


              • #8
                none of which will address the fact that you have not set portd pins to digital mode

                ANSELD=0

                Comment


                • #9
                  Bingo, pumped this into the others and we are flying, First of all, Richard, thanks for the help. I can't and won't make excuses from my end, other I am crawling back into my hole and hope to be out on Ground Hog Day. Cheers OTL

                  Comment

                  Working...
                  X