MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Posts
    1,073

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    IIRC, Mikrobasic has 8 bit signed & unsigned short integers as well as longs. Unsigned should work.

  2. #2
    Join Date
    Jun 2011
    Posts
    24

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    I've had a couple people on here tell me I should write an article about my project and I will once I get some of the major issues worked out and I will include pictures and I'll be sure to put a link on here to it.
    I switched the type to byte but it just seems like they aren't syncing properly. In picbasic does the SERIN2 expect a start and stop bit after every 8 bits or does it expect a start bit then the 48 data bits and then a stop bit? Because MIKROBASIC sends a byte at a time so it sends start and stop bits after every bit.

  3. #3
    Join Date
    Jun 2011
    Posts
    24

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    Oops I meant after every byte in the last sentence.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    All packets will include a start bit, 8 data bits, and the stop bit. You might have better luck if you increase (or get rid of) the timeout period.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    Prolly just adding noise here, But how does the "sender" know the "receiver" is ready and able to receive?
    -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
    Dec 2005
    Posts
    1,073

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    If mikrobasic allows, you might try increasing the time between bytes.

  7. #7
    Join Date
    Jun 2011
    Posts
    24

    Default Re: MIKROBASIC Soft_Uart to PICBASIC SEIRIN2?

    Ok we made some progress. I added a 500us pause between bytes and its getting the values now.
    But now only the first chip is getting the serial. The 3 slave chips are on seperate lines. The first chip is getting values but the second 2 aren't getting any. My transmit code is below

    Code:
    sub procedure Send()
        porta.0 = 1
        
        portc.2 = 1
        error1 = Soft_UART_Init(PORTC,1, 5, 9600, 0)
        delay_ms(3)
        soft_uart_write("@")
        for i = 0 to 5
            soft_uart_write(Coxa[i])
            delay_us(500)
        next i
        portc.2 = 0
        
        portc.1 = 1
        error1 = Soft_UART_Init(PORTC,2, 4, 9600, 0)
        delay_ms(3)
        soft_uart_write("@")
        for i = 0 to 5
            soft_uart_write(Thigh[i])
            delay_us(500)
        next i
        portc.1 = 0
        portc.0 = 1
        error1 = Soft_UART_Init(PORTC,0, 3, 9600, 0)
        delay_ms(3)
        soft_uart_write("@")
        for i = 0 to 5
            soft_uart_write(Tibia[i])
            delay_us(500)
        next i
        portc.0 = 0
        
        porta.0 = 0
        return
    end sub

    my receiver waits for the @ symbol so that is why its sent first.

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