Can't reliably transfer over serial connection between two PICs


+ Reply to Thread
Results 1 to 30 of 30

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,154


    Did you find this post helpful? Yes | No

    Default Re: Can't reliably transfer over serial connection between two PICs

    Well, my use case is quite different.
    The receiver (1936) which runs MIBAM, does nothing besides BAMing and checking serial input, if anything is delivered.
    "Anything" is delivered in form of single byte, once per second, minute or hour.

    I'll try to verify the code without MIBAM and see whenever it causes the issues.

    And if I switch to hardware serial input, will it still work with MIBAM?

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,681


    Did you find this post helpful? Yes | No

    Default Re: Can't reliably transfer over serial connection between two PICs

    Well, my use case is quite different.

    Well, my use case is ̶q̶u̶i̶t̶e̶ ̶d̶i̶f̶f̶e̶r̶e̶n̶t̶.̶ exactly that. ie. bit-banged protocol that has its timing generated in software and is going to be unreliable when used with interrupts running
    Warning I'm not a teacher

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default Re: Can't reliably transfer over serial connection between two PICs

    Quote Originally Posted by CuriousOne View Post
    And if I switch to hardware serial input, will it still work with MIBAM?
    Yes it will work because it has a two byte buffer and does not rely on software to catch that incoming byte.

    @ Richard: I got it. Hope it is OK now. The spammer hit the road. I don't know why this was missed from all of thw mods...

    Ioannis

  4. #4
    Join Date
    Feb 2013
    Posts
    1,154


    Did you find this post helpful? Yes | No

    Default Re: Can't reliably transfer over serial connection between two PICs

    So I have 6 slave 1936 and 1 master K80.
    Now they are all connected via independent pins to K80, where serial transfer goes now
    And there is also one common pin, which connects them altogether (not used right now)
    So my idea is, to use that common pin as serial data pin, and use these independent pins as enable input for that particular MCU ?

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default Re: Can't reliably transfer over serial connection between two PICs

    Or use the open output feature and tie all together on one pin.

    Ioannis

  6. #6
    Join Date
    Feb 2013
    Posts
    1,154


    Did you find this post helpful? Yes | No

    Default Re: Can't reliably transfer over serial connection between two PICs

    Sorry I had a little time to check all suggestions, but if there's a timing issue, I have series of 16 APA102C leds connected to the same 1936, they are driven via SHIFTOUT and everything works properly. So if MIBAM is messing with SERIN2, it should mess with SHIFTOUT as well?

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: Can't reliably transfer over serial connection between two PICs

    just curious.... CuriousOne.......
    how are you looping program ???
    For timing critical and ser-in's, interrupts are best for not missing incoming stuff.
    So how did you set up your receiver routines?

  8. #8
    Join Date
    May 2013
    Location
    australia
    Posts
    2,681


    Did you find this post helpful? Yes | No

    Default Re: Can't reliably transfer over serial connection between two PICs

    I have series of 16 APA102C leds connected to the same 1936
    is that the same 1936 that
    The receiver (1936) which runs MIBAM, does nothing besides BAMing and checking serial input, if anything is delivered.
    "Anything" is delivered in form of single byte, once per second, minute or hour.
    So if MIBAM is messing with SERIN2, it should mess with SHIFTOUT as well?
    sort of, the timing will be screwed up but since the pic is master and clocking is synchronous it won't matter the apa102c's are slaved to the masters clock.
    pbp has shiftin and shiftout commands but they both act as master, there is no shiftin slave mode command.
    any bit-banged reception code you make would need to honour the synchronous nature of the protocol i.e. interrupts will be a problem

    there is a reason hardware peripherals exist.
    Last edited by richard; - 3rd October 2025 at 02:43.
    Warning I'm not a teacher

Similar Threads

  1. Csv file transfer directly into excel using vb for serial coms
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 20th May 2016, 09:43
  2. Usb to ttl modules - connection to pics at 3.3v
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 12th March 2015, 21:03
  3. Replies: 1
    Last Post: - 23rd December 2006, 11:38
  4. large file transfer petween pics
    By Ron Marcus in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd July 2005, 18:04
  5. Can serial transfer binary data?
    By TurboLS in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th March 2005, 09:27

Members who have read this thread : 12

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