Serial Software vs Hardware


Today 09:34
Forum: Proton 24
Starter: GAMBOA
Views: 0
Replies: 1
Yesterday 22:45
Forum: The Lounge
Starter: Tim
Views: 0
Replies: 19
Yesterday 22:13
Forum: PICKit Plus
Starter: evan
Views: 0
Replies: 5
Yesterday 18:19
Forum: Proton 24
Starter: craig
Views: 0
Replies: 10
+ Reply to Thread
Results 1 to 5 of 5

Thread: Serial Software vs Hardware232 days old

  1. #1
    Junior Member Rox's Avatar
    Join Date
    Sep 2014
    Posts
    13
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    6.81 MB

    0 Not allowed!

    Default Serial Software vs Hardware

    Hi, can someone have a look, I have software and hardware serial on the same for..next loop, the software serial is for debugging. The issue is on the hardware serial there's extra zeroes, i can't find where its coming from.

    The srout returns the data's: 1 5 0 1 255 0 , which is correct with length 6 bytes.
    The hrsout returns : 1 0 5 0 0 0 1 0 255 0 0 0


    Code:
    TX_Recieve:                                         ' use only for payload with ack
         spi_array[0] = R_RX_PAYLOAD                    ' Read Rx payload command
         NRF_CSN = 0
         If mbBuffer[2] = 5 Then
            nrf_ptr = bLength  
         EndIf                                  
         GoSub SPI_NRF
         NRF_CSN = 1
         RsOut "Len:",Dec bLength,13
          For i = 1 To bLength                  'Copy spi buffer to modbus buffer
               mbBuffer[i] = spi_array[i]
               HRSOut mbBuffer[i]
               RsOut Dec mbBuffer[i]," "
               
           Next 
         Return
    Thanks in advance.

    Complier Version: 3616

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,614
    Thumbs Up
    Received: 69
    Given: 91
    Total Downloaded
    1.17 GB

    0 Not allowed!

    Default Re: Serial Software vs Hardware

    You don't say what array type mbuffer is. I suspect if you use the Dec modifier before the Hrsout you will get the same results
    Tim

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Junior Member Rox's Avatar
    Join Date
    Sep 2014
    Posts
    13
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    6.81 MB

    0 Not allowed!

    Default Re: Serial Software vs Hardware

    Thanks Tim, Im using a terminal for Hrsout where i can set the Dec Modifier on the terminal itself.. will try Hrsout with Dec modifier this evening.



    Rox

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Junior Member Rox's Avatar
    Join Date
    Sep 2014
    Posts
    13
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    6.81 MB

    0 Not allowed!

    Default Re: Serial Software vs Hardware

    Tim! you are right its sending an ascii, if I put dec modifier on Hrsout they're the same result in ascii.. i will need to convert it to Integer, or else the Modbus Master (UI/HMI) will interpret the reply as error... I still dont know how, i will research, I tried the Val command but failed.

    Rox

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Junior Member Rox's Avatar
    Join Date
    Sep 2014
    Posts
    13
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    6.81 MB

    0 Not allowed!

    Default Re: Serial Software vs Hardware

    Solved!

    the extra zeroes are Null terminations, below strips the extra zeroes.

    For i = 1 To bLength
    bTemp = spi_array[i]
    HRSOut bTemp
    next

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Analogue PIR - Hardware and Software
    By rpm26 in forum Proton Plus Compiler v3
    Replies: 6
    Last Post: 27th January 2015, 09:33
  2. Difference between hardware and software USART
    By Zain in forum Serial / Ethernet
    Replies: 2
    Last Post: 14th June 2013, 16:02
  3. Hardware and Software Interrupts
    By ~ Sy ~ in forum The Lounge
    Replies: 4
    Last Post: 13th August 2009, 08:16
  4. [SOLVED !] hardware/software uart problem
    By richardy in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 22nd July 2007, 23:28
  5. SPI Software / Hardware
    By dmTulsa in forum Proton Plus Compiler v3
    Replies: 10
    Last Post: 27th October 2006, 21:50

Members who have read this thread since 15th March 2019, 02:08 : 1

Actions :  (Set Date)  (Clear Date)

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