MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,622

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    Hi,
    The line
    Code:
    SERIN2 porta.1,84,10,comfail,[wait ("@"),STR t1pulse\6]
    Will recieve up to 6 bytes and store each byte in the t1pulse array. In this case it expects each value as one byte, not the ASCII representation of the value (for that you use the DEC modifier). If the sending device sends the "raw" value 128 you'll get 128 in t1pulse[0]. If it sends the value in ASCII you'll get 49 in t1pulse[0] because 49 is the ASCII code for '1'.

    I hope that makes sense.

    /Henrik.

  2. #2
    Join Date
    Jun 2011
    Posts
    24

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    I wrote the received values to to eeprom and read them and with 110,110,110,110,110,110 sent, it received 6E,AE,6E,EE,6E,EE. These are 110,174,110,238,110,238.

    The similarity is in the binary,
    Hex DEC bin
    6E 110 0110 1110
    AE 174 1010 1110
    EE 238 1110 1110

    the last 4 bits are all the same and the first 4 arent too different. I will try changing the sender type to unsigned instead of integer and see what changes.

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

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    I may miss the point but... why having a Sender code written in MikroBasic and a receiver in PicBasic?
    Steve

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

  4. #4
    Join Date
    Jun 2011
    Posts
    24

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    Because Mikrobasic has inverse trig functions that I need but doesn't have a good way to do a pulsout that I need so I'm using puslout in PICbasic to run servos and using mikrobasic on another chip to do calculations and sending them via serial to the servo controllers written in picbasic to do the puslout.

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    Hi Corbet, What are you controlling if I may ask? Reading accel's and gyro's? adjusting servo's based on the sensors?
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  6. #6
    Join Date
    Jun 2011
    Posts
    24

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    I have 18 servoes on a 3DOF hexapod robot. I have 3 pic16f84's running 6 servos each and a pic16f684 doing the calculations and sending the servo angles to the 84's The 84s are using PICBasic and the 684 is using Mikrobasic. My reasons are outlined in the above posts so I'm not gonna go into detail.
    I built the whole thing for under $200 servos (cheap servos) and all and I don't want to take the easy way out by buying all the electronics so I have a radioshack board all soldered up and before you start picking my board apart I'll tell you it worked just fine using SEROUT2 to SERIN2 so its not the board

    Its just the 2 compilers are not handling the information the same.

  7. #7
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    Oh that sounds awesome!! Sorry if I came off like I was gonna make any hardware suggestions. I was fishing hoping you were working on a balance project and wanted to pick your brain about what to do with the raw data.

    Btw, anyone could plug ready made stuff together, the true pride comes from building it yourself- as you are doing. Just my humble opinion.

    Love to see some pics if you care to share
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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