Today 11:57
Forum: Proton Plus Compiler v3
Starter: Fred Philpott
Views: 2114
Replies: 17
+ Reply to Thread
Results 1 to 3 of 3

Thread: LCD toruble at 40 Mhz HSPLL 18f4331132 days old

  1. #1
    Junior Member Hornett's Avatar
    Join Date
    Apr 2015
    Posts
    22
    Thumbs Up
    Received: 3
    Given: 0
    Total Downloaded
    8.98 MB

    0 Not allowed!

    Default LCD toruble at 40 Mhz HSPLL 18f4331

    I am working on a project driving two DC Motors with PWM from feedback from hall encoders using 18f4331. Using hardware interrupt to read the encoder for one motor alone all works OK at all speeds with 20 Mhz. BUT when I add the second motor I loose the encoder count on both motors at high speed. So I have switched to 40 Mhz using 10Mhz crystal and config of OSC = HSPLL ;HS oscillator, PLL enabled (clock frequency = 4 x FOSC1). Seems that running the feedback drive profile I have is now working ok. BUT the LCD is a mess, it seems to display all the characters but in the wrong place. I have tried changing to 8 bit from 4 bit transmission the the 1602A LCD 2X16 and increasing the Baud rate but no luck, which makes debugging a bit tough!
    Anyone had this issue or could held suggest a solution?
    lcd mussed.jpg looks like this at 40 Mhz

    lcd ok.jpgShould look like this 20 Mhz

  2. #2
    Senior Member charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    941
    Thumbs Up
    Received: 28
    Given: 26
    Total Downloaded
    1,003.23 MB

    0 Not allowed!

    Default Re: LCD toruble at 40 Mhz HSPLL 18f4331

    Have a look in the manual at Declare LCD_CommandUS x and LCD_DataUS x. These force a delay to give the LCD time to catch up. But it may be something else, of course.

    Charlie

  3. #3
    Junior Member Hornett's Avatar
    Join Date
    Apr 2015
    Posts
    22
    Thumbs Up
    Received: 3
    Given: 0
    Total Downloaded
    8.98 MB

    0 Not allowed!

    Default Re: LCD toruble at 40 Mhz HSPLL 18f4331

    Sorted it! Just needed to adjust the LCD_DataUS to 100. Thanks Charlie
    Last edited by Hornett; 18th December 2016 at 10:27.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Help setting up 18f4331 to run at 40 Mhz
    By Hornett in forum Absolute Beginners Section
    Replies: 5
    Last Post: 16th December 2016, 07:22
  2. 18f4331 QEI function for two encoders
    By Hornett in forum Absolute Beginners Section
    Replies: 0
    Last Post: 28th November 2016, 06:04
  3. 18F4331 Bootloader
    By pic-ignorant in forum The Lounge
    Replies: 13
    Last Post: 21st September 2013, 23:53
  4. HSPLL Oscillator Problem on 18F2431
    By wastrix in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 15th July 2009, 00:45
  5. MCloader, from 10 MHz to 4 MHz
    By MadAl in forum Mecanique - IDE
    Replies: 7
    Last Post: 28th December 2008, 16:25

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts