Can defines be changed with port input?


Closed Thread
Results 1 to 13 of 13

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Defining Question

    Quote Originally Posted by mister_e
    AND you could also skip all DEFINEs, just write to the according register... as the PICMultiCalc .
    Thank You mister_e,
    so many subtel little turns and twists to learn. Can you answer this?
    If I define
    Code:
    DEFINE LCD_LINES 2
    and send
    Code:
    serout PortB.4,T9600,[254,128,"9600 baud line 1~"] '128 so as not to add space
    pause 100
    serout PortB.4,T9600,[254,192,"9600 baud line 2~"] 
    pause 100
    serout PortB.4,T9600,[254,148,"9600 baud line 3~"] 
    pause 100
    serout PortB.4,T9600,[254,212,"9600 baud line 4~"]
    pause 100
    It still displays all 4 lines as if define was set to 4?
    JS

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default



    The LCDOUT defines don't alter the SERIN/SEROUT... it's two different things.

    If you want to use the internal USART RCSTA/TXSTA/SPBRG you have to use HSEROUT/HSERIN AND the dedicated I/O.

    If you want to use your favourite I/O and don't want to mess your time in calcs, use SEROUT/SEROUT2. these allow to change the baudrate on the fly without too much effort, fat free and allow to use almost every PIC i/o.

    And if you want to configure your Serial LCD... i don't know how as you never said wich one you're using

    But for sure LCD_LINES is not the solution.
    Last edited by mister_e; - 24th November 2006 at 03:47.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Smile LCDOUT, not serout, herserout

    Quote Originally Posted by mister_e


    The LCDOUT defines don't alter the SERIN/SEROUT... it's two different things.
    Yes , that I knew already
    Quote Originally Posted by mister_e
    If you want to use the internal USART RCSTA/TXSTA/SPBRG you have to use HSEROUT/HSERIN AND the dedicated I/O.
    This I am already doing and now understand how to shift baud rates . . easy
    Quote Originally Posted by mister_e
    If you want to use your favourite I/O and don't want to mess your time in calcs, use SEROUT/SEROUT2. these allow to change the baudrate on the fly without too much effort, fat free and allow to use almost every PIC i/o.
    No need, serial backpack works great, tweaking to add features.
    Quote Originally Posted by mister_e
    And if you want to configure your Serial LCD... i don't know how as you never said which one you're using

    But for sure LCD_LINES is not the solution.
    My real question was, or is : in the <h4>LCDOUT DEFINES</h4> if LCD_LINES 2 has no apparant effect to limit the LCD from displaying more, why is it even used?

  4. #4
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S.
    <h4>LCDOUT DEFINES</h4> if LCD_LINES 2 has no apparant effect to limit the LCD from displaying more, why is it even used?
    In the example code you gave you are sending to a Serial LCD display using SEROUT

    LCDOUT DEFINES are exactly what the name suggests...definitions for the LCDOUT command which you are not using!!!

    Likewise HSER_ defines are for HSEROUT and will have no effect on any SEROUT commands.
    Keith

    www.diyha.co.uk
    www.kat5.tv

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


    Did you find this post helpful? Yes | No

    Default Sorry you are confused

    Quote Originally Posted by keithdoxey
    In the example code you gave you are sending to a Serial LCD display using SEROUT

    LCDOUT DEFINES are exactly what the name suggests...definitions for the LCDOUT command which you are not using!!!

    Likewise HSER_ defines are for HSEROUT and will have no effect on any SEROUT commands.
    I have code for a serial to parallel backpack adapter, so yes i send serial commands to the adapter pic. It in turn outputs parallel LCDOUT commands and it works quite well. The code is designed to accept lcdout formatting commands to position each line on the lcd. It stores hserin data in a variable and then outputs into a standard LCD via LCDOUT. NOW in the lcd Defines which affect the PARALLEL LCD configured as a 4 bit display I have installed the following:
    DEFINE LCD_LINES 2. the display seems unaffected when hooked up to a 4 line display, as it continues to correctly display 4 lines of data sent to it. SO THE QUESTION REMAINS, what good is the lines DEFINE if it doesn't limit the output to 2 lines?
    JS

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink With PbP You may also have to do something from your own ...

    Quote Originally Posted by Joe S.
    DEFINE LCD_LINES 2. the display seems unaffected when hooked up to a 4 line display, as it continues to correctly display 4 lines of data sent to it. SO THE QUESTION REMAINS, what good is the lines DEFINE if it doesn't limit the output to 2 lines?
    JS
    Hi,Joe

    Those defines are written for most common types of displays ...

    If using exotic displays ...you also have to verify their commands are those PbP sends when configurating the display ...

    Mhhhh, now, If you DO NOT send data one after the other , but specify WHERE you want it to be written ...

    Only 2 lines will be used ...

    But YOU MUST Tell PbP you USE a 4 LINES Display ... PbP can't think you only WANT 2 lines ... no DEFINE for unwanted lines !!!

    CQFD

    Alain.
    Last edited by Acetronics2; - 24th November 2006 at 14:42.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Question Continuing Saga

    Quote Originally Posted by Acetronics
    Hi,Joe

    Mhhhh, now, If you DO NOT send data one after the other , but specify WHERE you want it to be written ...

    Only 2 lines will be used ...

    But YOU MUST Tell PbP you USE a 4 LINES Display ... PbP can't think you only WANT 2 lines ... no DEFINE for unwanted lines !!!

    CQFD

    Alain.
    HI Alain,
    The thing is, if you check post #6, I am sending the data in a manner so as to tell PBP where to write each line, I would expect the software to delimit the display to the addresses available only to a 2 line display if it is defined as a 2 line, even with a 4 line display connected, but it displays all 4 lines. Now if I install a 2 line display, and send 4 lines of data as written in post 6, only the lines written for line 1 and line 2 will display. I would have expected the PIC to truncate the third and fourth lines when set to 2 lines, even when connected to a 4 line display. It appears that is not so. So I still have the question, what effect does DEFINE LCD_LINES have on the LCDOUT command?
    Regards
    JS

Similar Threads

  1. Matrix Keypad routine
    By mister_e in forum Code Examples
    Replies: 134
    Last Post: - 18th September 2022, 20:30
  2. Input and Output on same Port
    By Frozen001 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th November 2008, 18:46
  3. Accessing Portion of Input Port
    By Frozen001 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 24th October 2008, 16:33
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. Timing input pulses and re-outputting them
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th February 2007, 01:50

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