Newbie Question


Closed Thread
Results 1 to 15 of 15

Thread: Newbie Question

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Posts
    89


    Did you find this post helpful? Yes | No

    Default Thanks

    Thanks for the info but now I have other problems. While trying to compile the program in Microstudio using picbasic pro it gives me an error on this line:

    Serout portb.2, N9600, [254,1]

    I am trying to send this data out to the lcd which is serial. It gives me this error on every line with this command. I am using the code as before with the adjustments made. Here is a snipit of the top of the program, as I am sure this is the problem hopefully

    ' CONFIGURATION SETUP
    ' Oscillator: XT
    ' Watchdog Timer: OFF
    ' Power up Timer: OFF
    ' Master Clear Enable: Internal
    ' Brown Out Detect: OFF
    ' Code Protect: OFF
    ' Data EE Read Protect:OFF

    'lcd setup
    I con 254
    CLR con 1
    Line1 con 128
    line2 con 192
    line3 con 148
    line4 con 212

    DEFINE OSC 4


    'variables
    HzTimer VAR Word '1/2 second counter (2 Hz)
    HH VAR Byte ' Hours 1-12
    MM VAR ByTE ' Minutes 0-59
    SS VAR Byte ' Seconds 0-59
    X VAR Byte ' temp variable
    col VAR Bit ' colon 1=on, 0=0ff

    'initial conditions of controller
    PORTB.0 = 0 'PORTB.0 PIN LOW
    TRISB.O = 1 'PORTB.0 PIN input for button
    OPTION_REG=%00000111 'weak pullups on, TMRO prescale = ‘256
    HzTimer=$7A12 'for 1/2 Sec
    HH=0:MM=0:SS=0:col=0 'initial conditions
    Pause 1000 'settle Time for Serial LCD

    ' ************************************************** ************
    'SET INITIAL TIME WITH PUSH BUTTON (PART 1 of Program)

    Serout portb.2, N9600, [254,1] this and every other one like it give the same error "bad expression". What am I doing wrong? I am trying to compile the program. Thanks

  2. #2
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Boy I had to say this but...on page 137 of the manual it states:

    The Mode names (e.g. T2400) are defined in the file MODEDEFS.BAS. To use them, add the line:

    Include "modedefs.bas"

    to the top of the PICBASIC PRO™ program.

    Use your manual, its the Bible of PICBasic. I use mine so much that its falling apart. I also have the web version bookmarked.

  3. #3
    Join Date
    Feb 2006
    Posts
    89


    Did you find this post helpful? Yes | No

    Default Thanks

    I noticed that a little later. One more question and I will leave you alone maybe =). I am trying to send this to the lcd controller:

    SEROUT LCD,6,[I,LINE4,"FAN IS RUNNING"]

    I am pretty sure the part "FAN IS RUNNING" is the problem, I just don't know how to fix it. I need this to appear on the lcd. Is the proper syntax?

  4. #4
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Short answer is it depends on the protocol of the LCD. Take a look at the LCD's info.

  5. #5
    Join Date
    Feb 2006
    Posts
    89


    Did you find this post helpful? Yes | No

    Default thanks

    Thanks for the help.

Similar Threads

  1. Newbie 74hc595 question
    By manjero in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 22nd January 2008, 23:22
  2. newbie with serial com question...
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th December 2006, 06:34
  3. Newbie Question - Info Please
    By ehoskins in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd October 2006, 15:50
  4. Greetings from Newbie and a question
    By ChrisHelvey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 24th July 2006, 16:52
  5. Newbie question
    By senojlr in forum General
    Replies: 7
    Last Post: - 11th April 2006, 22:23

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