[SOLVED !] 2 serin pins altering variables randomly


Closed Thread
Results 1 to 13 of 13

Thread: 2 serin pins altering variables randomly5050 days old

  1. #1
    AlanR
    Guest AlanR's Avatar

    0 Not allowed!

    Default 2 serin pins altering variables randomly

    Hi All
    I have been trying for the first time to communicate using serin to an 18f452
    from another 18f452 using serout and also a 16f628 using serout.

    On the 18f452 i use a different serin pin for each serial input.
    Communication is only one way.(remote pics to main 18f452)

    The remote 18f452 and the remote 16f628 are definately communicating ok
    to the main 18f452 passing correct data.
    I just keep retransmitting the data from the remotes every 20ms,the main 18f452 checks its 2 serin pins when ever it requires data.
    I am finding that some variables that are not connected to the comms are being altered randomly on the main 18f452 whenever more than 1 serin command is used in the main pics code.

    My question is can i just connect an output of 1 pic direct to the input of another for serial comms or should i (fit a resistor or diode in series/does the pin need to be pulled low or high or none).

    Could it be a hardware issue or compiler anomaly that occurs only when more than 1 serin connection is used.

    Cheers
    Alan

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.

  • #2
    pverburg
    Guest pverburg's Avatar

    0 Not allowed!

    Default

    Alan,

    Are You using one hardware and one software serial port/pins ?

    I don't think you can have 2 software ones.

    Paul V.

  • 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
    AlanR
    Guest AlanR's Avatar

    0 Not allowed!

    Default

    Hi Paul
    Yes I am using 2 software serin port pins
    I was under the impression that I could use 2, or maybe 1 rsin and 1 serin on the main pic.
    It seems very close to working as both serin values are the values i was expecting but at times seem to influence each other and also alter other display variables.

    Les
    Can you confirm that I can use 2 or more serin software port pins on a single pic please as If I cannot I must quickly set about redesigning my PCB board
    to reflect this
    Customer is pushing me for completion.

    Thanks
    Alan

  • 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.

  • #4
    Member Eriond's Avatar
    Join Date
    Sep 2005
    Posts
    115
    Thumbs Up
    Received: 0
    Given: 5
    Total Downloaded
    640.30 MB

    0 Not allowed!

    Post

    Well, I'm no expert, but according to your own findings there seems to be an issue with two soft serial ports. And as you said, the customer is pushing you... So even if it's a solveable compiler issue, it will take les some time to first find it, then fix it and finally test it.
    My suggestion is that you already now start looking for an alternative. If you haven't used the hardware accelerated serial port (HSER, Pins 25 & 26) for other things, it might be option...

    Good luck ,
    Eriond

  • 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
    pverburg
    Guest pverburg's Avatar

    0 Not allowed!

    Default

    Alan,

    Im almost sure it cant be done this has come up before.
    change on to the hardware port and you will be fine !

    Paul V.

  • 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.

  • #6
    AlanR
    Guest AlanR's Avatar

    0 Not allowed!

    Question Les Please clarify on serin

    Hi
    When I said the customer was pushing I meant it.
    The unit is now at the CV show in Birmingham.
    Couldn't resolve it in such a short time so I had to leave a serin commented out.
    Customer is fine about it not having the extra function for now.
    The extra 18F452 was purely extra inputs that were sent to the main pic serially.
    The rest of the unit functions perfect without the extra serin command.

    Looking at my PCB circuit again as luck would have it pins 25 & 26 are free on both 18F452s so I will try that setup out before remaking the proto PCB.

    Still I would like a definite answer on multiple serin commands.
    As I see it serin pin and serout pin is set at runtime rather than declared and fixed at compile tiime like rsin rsout, so I guessed that as you set the pin every time you issue the commmand that you could use multiple pins,?

    If serin commands can be multiple pins ,the problem still exists somewhere.
    (I'm still not ruling out an error somewhere in my code even though I've scanned through it many times,)


    Les or Tim or anyone can you clarify please.

    Cheers
    Alan

  • 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
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,478
    Thumbs Up
    Received: 313
    Given: 146
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default

    After making some tests using multiple SERIN and SEROUT commands within the same program, each using a different pin, I must conclude that there are NO obvious problems.

    If you're receiving into arrays you may be experiencing overspill which will effect adjacent variables. Or you may be experiencing frame errors on the receiver, which again, will cause problems, as an incorrect (seemingly random) value will be received.

    Without a snippet of code that definately shows a problem, I must go on my own findings based upon code examination and code tests.

  • 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.

  • #8
    pverburg
    Guest pverburg's Avatar

    0 Not allowed!

    Default

    Sorry Les, Allan,

    I was under the impresion you could not have more then on set of soft rs232 maybe this was something with differend speed declares ???

    I will go and hide now

    Paul V.

  • 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
    Member Eriond's Avatar
    Join Date
    Sep 2005
    Posts
    115
    Thumbs Up
    Received: 0
    Given: 5
    Total Downloaded
    640.30 MB

    0 Not allowed!

    Default

    Looking at the speed in which Les verified this issue, and my assumptions being proved all wrong, I'll go see if there's some rock I can hide beneath for a while....

    /Eriond

  • 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.

  • #10
    AlanR
    Guest AlanR's Avatar

    0 Not allowed!

    Smile

    Les
    Many thanks for your checks and confirmation.
    I will spend more time checking my code and see if I can spot the problem.

    If I can't find any problems after rechecking I will post you my code if I may.
    It is rather a large amount of code and I wouldn't want to put you through checking it out without myself being more thorough first.

    Eriond & Paul
    Don't feel bad your assistance is always welcomed and by not getting involved in this thread you may have been left with the same assumptions, so we have all benefited.
    Except maybe for Les who has to hold our hand and guide us mere mortals

    Thanks again
    Alan

  • 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.

  • #11
    AlanR
    Guest AlanR's Avatar

    0 Not allowed!

    Thumbs up

    Hi all

    Just letting you know that I seem to have sorted my multiple serin problem.
    I've included full config setup in my code and also upgraded my Epic programmer software to the latest version.

    Since doing this all seems ok.
    Wasted hours checking my code trying to find an error.
    Thanks for your assistance it is always appreciated

    Cheers
    Alan

  • 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.

  • #12
    AlanR
    Guest AlanR's Avatar

    0 Not allowed!

    Default

    Hi Les

    This problem has occured again.
    I've reduced it down somewhat in my code and now it doesn't appear to be related to 2 serin at all as i've removed all serin commands.

    The problem does not appear in compiler version 3.2.4.5 .
    When I recently upgraded the the compiler to 3.2.5.0 it reappeared again.

    It seems to be a problem with the counter command.
    The code below works fine on 3.2.4.5 and not on 3.2.5.0

    It shows a count value even though no pulses are appearing on the pin
    Something seems to corrupt the count value.

    At the moment I'm having to stick with 3.2.4.5 to use the counter.

    Please help

    Regards
    Alan

  • 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.

  • #13
    AlanR
    Guest AlanR's Avatar

    0 Not allowed!

    Default

    Sorry forgot to attach the code
    Alan


    Device 18F452 'also error on 18f252

    Declare XTAL 20 'USING 20MHZ XTAL

    CONFIG_START
    OSC = HS ; Oscillator Selection HS
    OSCS = OFF ; Osc. Switch Enable Disabled
    PWRT = On ; Power-up Timer Enabled
    BOR = On ; Brown-out Reset Disabled
    BORV = 27 ; Brown-out Voltage 2.5V
    WDT = OFF ; Watchdog Timer Disabled
    WDTPS = 128 ; Watchdog Postscaler 1:128
    CCP2MUX = Off ; CCP2 MUX Enable(RC1) off=rb3
    STVR = OFF ; Stack Overflow Reset Disabled
    LVP = OFF ; Low Voltage ICSP Disabled
    Debug = OFF ; Background Debugger Enable Disabled
    CP0 = OFF ; Code Protection Block 0 Disabled
    CP1 = OFF ; Code Protection Block 1 Disabled
    CP2 = OFF ; Code Protection Block 2 Disabled
    CP3 = OFF ; Code Protection Block 3 Disabled
    CPB = OFF ; Boot Block Code Protection Disabled
    CPD = OFF ; Data EEPROM Code Protection Disabled
    WRT0 = OFF ; Write Protection Block 0 Disabled
    WRT1 = OFF ; Write Protection Block 1Disabled
    WRT2 = OFF ; Write Protection Block 2 Disabled
    WRT3 = OFF ; Write Protection Block 3 Disabled
    WRTB = OFF ; Boot Block Write Protection Disabled
    WRTC = OFF ; Configuration Register Write Protection Disabled
    WRTD = OFF ; Data EEPROM Write Protection Disabled
    EBTR0 = OFF ; Table Read Protection Block 0 Disabled
    EBTR1 = OFF ; Table Read Protection Block 1 Disabled
    EBTR2 = OFF ; Table Read Protection Block 2 Disabled
    EBTR3 = OFF ; Table Read Protection Block 3 Disabled
    EBTRB = OFF ; Boot Block Table Read Protection Disabled
    CONFIG_END

    ALL_DIGITAL TRUE
    TRISC = %11111111
    Dim countotal As Word
    countotal = 0

    Dim countil As Word
    countil = 0

    MAIN: DelayMS 3000
    Cls
    While 1 = 1
    countil = Counter PORTC.6,1000
    countotal = countotal + countil
    Print At 1,1,@countotal
    Print At 2,1,@countil
    DelayMS 2000
    countotal = 0
    countil = 0
    Wend
    GoTo MAIN

    End

  • 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. [SOLVED !] Question about aliasing port and port pins with variables or constant
      By tunde in forum Proton Plus Compiler v3
      Replies: 4
      Last Post: 2nd May 2016, 15:10
    2. [SOLVED !] SerIn messes up the variables
      By Latex in forum Proton Plus Compiler v3
      Replies: 0
      Last Post: 8th May 2015, 19:13
    3. Need to generate 1 or 2 or 4 or 8 randomly
      By J. Mark Wolf in forum Proton Plus Compiler v3
      Replies: 5
      Last Post: 18th March 2011, 22:59
    4. Aliasing variables to elements of other variables
      By Yeawooz in forum Wish List / Product Feedback
      Replies: 7
      Last Post: 3rd April 2007, 10:35
    5. SERIN help
      By chuckieboy in forum Proton Plus Compiler v3
      Replies: 2
      Last Post: 23rd January 2005, 21:23

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts