PicBasic Pro and SEROUT hex problem


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2010
    Posts
    8

    Exclamation PicBasic Pro and SEROUT hex problem

    Hello

    Hope someone has a easy answer.. seems like there should be one...

    I am useing PicBasic Pro and Pic 16F886

    Useing SEROUT

    SEROUT2 PORTC.6, 84,[$80,$02E0,$01]

    I am trying to send out Hex 80, 2E0, 1

    The 80 and the 1 works fine.

    the $02E0 is being shorting to E0 and sent

    so instead of haveing a decimal equivenlent of 736 for $02e0
    I have 224 or $E0

    tried HEX $02E0
    tried IHEX $02E0
    tried HEX 02E0
    tried HEX 2EO

    All of the above generate errors

    Thanks for any help

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    mark30504, You are trying to send a combination that is bigger than a byte (0-255). Just send it as 2 individual bytes bytes like: SEROUT2 PORTC.6, 84,[$80,$02,$E0,$01]. Or you could if you have the decimal equivelents available send the string: SEROUT2 PORTC.6, 84,[HEX2 first byte variable,HEX4 second word variable,HEX2 third byte variable]

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Nov 2010
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Not Sure it worked

    Hello

    Thanks

    Useing our first example

    SEROUT2 PORTC.6, 84,[$80,$02,$E0,$00]

    it gave me no errors but it does not seem to have the serial output I need

    The device I am hooking the Pic to requires data formatted

    $80,$02e0, $00 where 80 is a command to store date, the memory location is 2e0 hex and the data is 0 in this case.

    When I brake up the 02e0, on serial channel receives 80,2,E0,0

    in dec it should look like 128,736,0

    it now looks like 128,2,224,0

    It may work but currently my receiveing device does not seem to be storeing the data correctly...

    Any other thoughs ? the comma , seems to be somewhat the problem, can put $04$E0 together without fault

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    mark30504 , It sounds like the device you are trying to send to requires ascii data, am I right? If so, just send the characters you want to send like so: SEROUT2 PORTC.6, 84,["80,2E0,00"]. If you notice I'm sending the comma's between the characters. Maybe if you could explain exactly what the device requires for the data stream... It is kind of hard to diagnose the and give a proper answer with the amount of data you have given.

    Dave Purola,

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