PORTC constants


Closed Thread
Results 1 to 3 of 3

Thread: PORTC constants

  1. #1
    Join Date
    Oct 2007
    Posts
    21

    Question PORTC constants

    How can I do a constant to control my LCD connected to PORTC.3
    I tried LCD CON PORTC.3 but it didn't work.

    For example
    How can I control my LCD by doing something like this
    SEROUT LCD,6, ["Hello World"]

    {where LCD is the constant representing PORTC.3}

    Instead of doing this
    SEROUT portc.3,6 ,["Hello World"]


    I am using a PIC16f616 with a serial 16x2 LCD display.

    The LCD cannot be connected to a PORT B pin because the PIC16f616 has no portB, so it must be portc.3

    Thank You

    ,Eric

  2. #2
    Join Date
    Oct 2007
    Posts
    21


    Did you find this post helpful? Yes | No

    Default Nevermind

    Nevermind ,
    After researching it in google more , i was able to find the SYMBOL command

    All is well

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi Eric,
    Dunno if CON works that way but VAR does.
    Code:
    TrisC = %11110111             ' portC.3 as Output all others as Inputs
    INCLUDE "Modedefs.bas"        ' must include if not using mode
    LCD VAR PortC.3
    
    start:
    SEROUT LCD,6,$FE,1 "Hello World"
    pause 1000
    
    main:
    do something
    goto main
    end
    JS

    I personally never use the mode command preferring to use T9600 or N9600, just my personal choice. - PBP manuel ver 2.47 page 137 says pin may be a constant or variable number 0 - 15 or a variable name like PortA.0
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. MY FIRST scrolling 8X8 LED
    By earltyso in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th August 2008, 16:23
  2. How do I configure the PIC16F737?
    By LinkMTech in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th November 2007, 23:05
  3. Changing from PORTC to PORTA Problems
    By Tissy in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 13th December 2005, 21:11
  4. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 5th May 2005, 23:29
  5. DS18B20s on 876 portc
    By anj in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 7th May 2004, 04:52

Members who have read this thread : 1

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