Serial reading of binary at 75 baud


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2008
    Posts
    4

    Default Serial reading of binary at 75 baud

    Hi,

    I wonder if anyone may be able to help...

    I am using an 18F1320 at 4Mhz and need to read serial binary code at 75 baud. I then need to convert the binary 'back' into Hex to output at a faster rate which is no problem. I can read at 75 baud using a 4MHz crystal by DECLARING it at 16MHz and using SERIN, but then have a problem with the input being in binary....

  2. #2
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by JasonMarsh View Post
    I am using an 18F1320 at 4Mhz and need to read serial binary code at 75 baud. I then need to convert the binary 'back' into Hex to output at a faster rate which is no problem. I can read at 75 baud using a 4MHz crystal by DECLARING it at 16MHz and using SERIN, but then have a problem with the input being in binary....
    Ok, so you're reading numbers in straight binary, as in, you get %01010101 or whatever, and you have to send that out as a 55, as in the hexadecimal representation of 01010101?
    If that's the case, it's all in the manual under the SERIN2 command.
    If not, well, try again...

  3. #3
    Join Date
    Feb 2008
    Posts
    4

    Default Serial reading of binary at 75 baud

    Thanks for the reply Skimask,

    Maybe I am missing something here, I cant find a SERIN2 command in the manual. Well, it is found on the back page as a protected word...

    You are right in what I have coming in is something like %01010011.


    As I understand thing, the following code would not be looking for BIN input, but ASCII? Which can then be represented as required....?

    Dim InDat as Byte
    Serin2 PORTB.4, 19697, [InDat]

    The results printed as HEX are not what I am expecting, I think 00 80 00 00 ???

  4. #4
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by JasonMarsh View Post
    Maybe I am missing something here, I cant find a SERIN2 command in the manual. Well, it is found on the back page as a protected word...

    You are right in what I have coming in is something like %01010011.

    As I understand thing, the following code would not be looking for BIN input, but ASCII? Which can then be represented as required....?

    Dim InDat as Byte
    Serin2 PORTB.4, 19697, [InDat]

    The results printed as HEX are not what I am expecting, I think 00 80 00 00 ???
    Does the front of the book have the word Proton on it anywhere?
    'cause if it does, you're in the wrong forum...

  5. #5
    Join Date
    Feb 2008
    Posts
    4

    Default Serial reading of binary at 75 baud

    Hi,

    I was starting to think the same! But yes....

    Proton Development Suite

    I am running Proton+ Basic compiler 3.1.0.9

  6. #6
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by JasonMarsh View Post
    Hi,

    I was starting to think the same! But yes....

    Proton Development Suite

    I am running Proton+ Basic compiler 3.1.0.9
    Well, if you look towards the top of your screen, you may see the words: MELabs PICBASIC Forums

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. help required regarding reading binary files
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th March 2008, 22:30
  3. 110 Baud Serial Communications - Possible?
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th January 2006, 04:49
  4. VB Binary Serial Help for someone
    By air1kdf in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th December 2005, 16:04
  5. Auto Baud Rate Detection
    By mytekcontrols in forum Serial
    Replies: 10
    Last Post: - 31st October 2005, 02:17

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