PicBasicPro with PICDem2 Plus


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    DelBoy's Avatar
    DelBoy Guest

    Unhappy PicBasicPro with PICDem2 Plus

    Is there anyone able to guide me (the poor novice) through a problem i have using PicBasic Pro and the LCD Display on a PICDEM 2 PLUS development board.
    I am just trying to display a simple message, like "hello."
    I think i have correctly DEFINEd all of the various port values that correspond to the way the display is connected to the p18F452. The data bits are RD0-RD3 and the control bits RA1-RA3.
    If there are any other components in the program, ie. then these work as expected. I have tried many combinations of writing this short program, but the screen still remains blank. The display works fine when programmed using MPLAB assembly code.
    I'd be most grateful for any assistance.
    Thanks
    I've attached the code for anyone who may be interested.
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Make friends with Datasheets...

    Since you've defined Digital Outputs for your LCD across PortA, try setting ADCON1=$07 at the start of your program... and come back and say if it worked...

    See Datasheet 17.2 ADCON1 register, then look down at the table setting the PCGF3-PCGF0 bits) to see why. By default this register powers up as all zero's (see Table 4.2 Register File Summary for the POR [Power On Reset] values).

    Later on, when you want to play with Analogue Inputs, revisit the PCFG bits of ADCON1 and configure appropriately... (eg you'll probably want to set RA0 as Analogue and the others Digital).

    Tip: It's always a good idea to also define the TRIS Registers (TRISA, TRISB, TRISC etc) at the start of your program, whether you're using a particular pin or not. Pins used for LCD can be defined as Outputs. Get in the habit of doing this, as in these early simple stages you can omit them and things might still work, but later they'll bite you if you forget about them and you'll spend countless hours trying to figure why your programs don't work as expected.

  3. #3
    DelBoy's Avatar
    DelBoy Guest


    Did you find this post helpful? Yes | No

    Default

    Melanie,

    Adding ADCON1=$07 has worked, just one small problem though... the text is upside down.
    Many Thanks

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Rotate the LCD, Monitor, Datasheet, back of envelope, etc by 180 degrees clockwise to fix the problem. Rotate anticlockwise if you are in the southern hemishpere (ie South of London). A large crate of beer has been known to solve the problem temporarily. Note, that rotating the PIC in it's socket by 180 degrees usually does not produce the desired result.

  5. #5
    DelBoy's Avatar
    DelBoy Guest


    Did you find this post helpful? Yes | No

    Default Sorted

    Hi again,

    This must have been one of my many glitches, cos it's all sorted out. I can actually read the text, even without the introduction of the crate of beer. Many Thanks

    However, i'm sure i'll be seeking your valuable assistance again. I promise not to pester you too much.

    Delboy

Similar Threads

  1. PIC-LCD3310 Pin Outs for PicBasic(pro)
    By douglas.mauro in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th March 2009, 07:17
  2. Proton+ and PicBasicpro
    By Rob Martin in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 9th November 2007, 07:58
  3. mikrobasic to picbasicpro
    By nicolasronan in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th September 2006, 22:34
  4. 3x4 keypad picbasicpro
    By gkahraman82 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th May 2006, 21:49
  5. PID control with Picbasicpro
    By swordman in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th August 2004, 14:37

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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