Confused on an IF...THEN decimal # check


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    Thanks for your input Joe. If I remember correctly, I tried so many different ways, but to no avail. Although, Dave's solution worked flawlessly so far! Hey guys, without me starting a new thread, I've got 1 more question. This "Master Board" PIC is actually going to be sending serial out to "Daughter" boards with their own PICs. A quick snippet of my code goes like so:

    ...
    case 2
    serout portB.1,n9600,[UpdPinLvl] 'CAT5 JACK 1, PIN 2
    GOTO Start
    ...

    Is this (basically) the correct syntax if the signal does not route through a MAX232? BTW: UpdPinLvl is a 8 bit integer. OK, so 2 questions: Correctness of syntax aside, what is roughly the max distance between Master and Daughter I could expect with driving it TTL?

    Any thoughts would be great!
    C

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


    Did you find this post helpful? Yes | No

    Default

    It's a byte. That's not ok for 1-256?
    No it's not. A byte is OK for 0-255.

    A byte has 256 states... ZERO is one of them.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kevlar129bp View Post
    ...
    case 2
    serout portB.1,n9600,[UpdPinLvl] 'CAT5 JACK 1, PIN 2
    GOTO Start
    ...

    Is this (basically) the correct syntax if the signal does not route through a MAX232? BTW: UpdPinLvl is a 8 bit integer. OK, so 2 questions: Correctness of syntax aside, what is roughly the max distance between Master and Daughter I could expect with driving it TTL?
    It the variable is a number you may want to consider this from the manual
    A numeric value preceded by a pound sign ( # ) will send the
    ASCII representation of its decimal value. For example, if W0 =
    123, then #W0 (or #123) will send “1", “2", ”3".
    Distance... Depending on the cable, connections, and the amount of noise in the environment, 30 to 50 feet is about the max distance you can expect. Could get a little more, maybe less.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108


    Did you find this post helpful? Yes | No

    Thumbs up

    Thanks guys,
    I think I'll just mess with the daughter board when I have more time...the master board was my main focus, and it's good so far. As for the cabling, I'm an Audio-Video-Security installer, so cat5 is a natural fit for me. This is what I've got so far...so we'll just have to road-test the max limits.
    [IMG]<table style="width:auto;"><tr><td><a href="http://picasaweb.google.com/lh/photo/nK_RiB5vTk6ukG3L5lkzJg"><img src="http://lh6.ggpht.com/_B18XeDRTquI/SUPWW2AHgDI/AAAAAAAAACA/xrDpzvtT7Ik/s144/MOTHERBOARD.jpg" /></a></td></tr><tr><td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/kevlar129bp/SerialControl">Serial Control</a></td></tr></table>[/IMG]

Similar Threads

  1. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  2. Help for decimal conversion
    By eva in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th March 2007, 18:20
  3. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  4. 16bit variable and degrees conversion
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 2nd May 2005, 17:27
  5. Convert a word variable to decimal
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th December 2004, 20:02

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