HAVING ISSUE WITH PROC USAGE project is high speed serial backpack


+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Junior Member
    Join Date
    Apr 2014
    Posts
    46
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    475.98 MB

    0 Not allowed!

    Unhappy HAVING ISSUE WITH PROC USAGE project is high speed serial backpack

    Code:
    IDE 2.0.3.3
    LOADER 1.0.0.6
    VERSION 3.7.2.5
    
    
    Var = "LINE 4"
    
    
    Proc SendDataByte(NNN As Byte)
       BusyWait()   
       WrCtl
       NLO = NNN & $0F                  ' asm
       NHI = NNN/16                       ' swap nibs not work
       LATA = NHI: WriteClk             ' load HI nibble A3-A0  
       LATA = NLO: WriteClk            ' load LO nibble A3-A0
    EndProc
    
    
    Proc DispStr(NNN As String * 20)
        Spos=0 
        Repeat  
          SendDataByte(NNN[Spos])         
          Inc Spos 
        Until Spos=Len(NNN)    
    EndProc
    
    
        SetCUR(0,4)           '' WORKS
        SendDataByte("4")  '' WORKS
        DispStr("LINE 4")     '' DOES NOT WORK  -- GIVES GARBAGE
    
    
        SetCUR(0,4)          '' WORKS
        SendDataByte("4")  '' WORKS
        DispStr(Ver)          '' WORKS
    Am I doing something wrong ???

    Is it legal to use : after Case x : do this instruction - gave very many var undefines

  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
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,396
    Thumbs Up
    Received: 48
    Given: 39
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: HAVING ISSUE WITH PROC USAGE project is high speed serial backpac

    Xtal

    What PIC are you using?

    Charlie

  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
    Member keytapper's Avatar
    Join Date
    Jun 2019
    Posts
    141
    Thumbs Up
    Received: 6
    Given: 3
    Total Downloaded
    329.46 MB

    0 Not allowed!

    Default Re: HAVING ISSUE WITH PROC USAGE project is high speed serial backpac

    I hardly believe that a procedure can call a subroutine. I suppose that procedures are compiled prior to know about the entire source. Then they'll be linked.

  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
    Join Date
    Apr 2014
    Posts
    46
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    475.98 MB

    0 Not allowed!

    Default Re: HAVING ISSUE WITH PROC USAGE project is high speed serial backpac

    I'm using 16F1827 and Windows 10
    I tried the following code with interesting results, It looks like the "LINE 4" was not passed via NNN
    Code:
    Proc DispStr(NNN As String * 20)
        Xvar = NNN             
        Spos=0 
        Repeat  
          SendDataByte(Xvar[Spos])         
          Inc Spos 
        Until Spos=Len(Xvar)    
    EndProc
    
    
     SetCUR(0,3)           '' WORKS
        Ver = "LINE 3"
        DispStr(Ver)          ' Line 3 was displayed 
    
    
        SetCUR(0,4)           ' WORKS
        DispStr("LINE 4")     ' Line 3 was displayed on Line 4

  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
    Join Date
    Apr 2014
    Posts
    46
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    475.98 MB

    0 Not allowed!

    Default Re: HAVING ISSUE WITH PROC USAGE project is high speed serial backpac

    The following workaround appears to be working.....

    Code:
    Dim Xvar As String * 20
    $define DisplayStr(strx) Xvar=strx : DispStr(Xvar)  ' works
    '$define DisplayStr(strx) : DispStr(strx)           ' no worky
    DisplayStr("Line4 ")

  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.

  11. #6
    Prolific Poster
    Join Date
    Mar 2012
    Posts
    2,308
    Thumbs Up
    Received: 80
    Given: 182
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: HAVING ISSUE WITH PROC USAGE project is high speed serial backpac

    BTW putting other problems aside, if you put Procs first you need to jump over them.
    George.

  12. 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. #7
    Senior Member
    Join Date
    May 2011
    Posts
    504
    Thumbs Up
    Received: 59
    Given: 0
    Total Downloaded
    408.14 MB

    0 Not allowed!

    Default Re: HAVING ISSUE WITH PROC USAGE project is high speed serial backpac

    if you put Procs first you need to jump over them
    I don't think that's the case anymore... the compiler rearranges the code and puts the procs at the end.

    Anyway, here's a simple version of that code that shows the issue. When you call DispStr() with a literal string instead of a variable ie DispStr("123"), the string data isn't copied from program memory the same way. It does a better job when compiled for an 18F vs a 16F but it still has issues.
    Code:
    device = 18F25K22
    'device=16F1827 
    
    Dim s As String
    
    Proc SendDataByte(b As Byte)
        PORTB = b
    EndProc
        
    Proc DispStr(ds As String * 20)
        Dim ix As Byte
    
        ix = 0
        While ds[ix] <> 0
            SendDataByte(ds[ix])
            ix = ix + 1
        Wend
    EndProc
    
    Output PORTB
    
    s = "ABC"
    ' this works
    ' copies null-terminated string s to ds and calls DispStr
    DispStr(s)
    
    ' 18F - copies three bytes to ds
    ' 16F - copies three bytes to ????, so you get whatever was previously in ds
    ' neither case null-terminates the string, so DispStr will fail
    DispStr("123")

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

  15. #8
    Prolific Poster
    Join Date
    Mar 2012
    Posts
    2,308
    Thumbs Up
    Received: 80
    Given: 182
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: HAVING ISSUE WITH PROC USAGE project is high speed serial backpac

    I don't think that's the case anymore... the compiler rearranges the code and puts the procs at the end.
    Yes I know but it's bad practice, pretty easy to forget the difference between procs and subs, who knows at some point in the future Les may change the way procs are compiled.

    It does a better job when compiled for an 18F vs a 16F but it still has issues
    Damn, I didn't even realize procs were supported on 16F.
    George.

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

  17. #9
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,513
    Thumbs Up
    Received: 318
    Given: 152
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: HAVING ISSUE WITH PROC USAGE project is high speed serial backpac

    I've located an issue with enhanced 14-bit core devices when a parameter is a string and the item passed to it is a character string.

    However, it was not an anomaly with my code, but an anomaly with the BCB C++ compiler I use. It was mis-reading an item in a Tlist that holds a variable's address when called, so I went through and through and through the code but could not find anything wrong with my coding, so I called the function twice and lo and behold, it then accesses the Tlist correctly on the second call !!!

    It happens with enhanced 14-bit core devices because there is also a calculation needs to be made to make RAM linear when used indirectly. Yet another badly created device from Microchip with fragmented RAM and a very silly implementation of making it linear, but with twists and turns everywhere! The PIC24 and dsPIC device have lovely linear RAM all the time, and so do the AVR devices, so why the hell didn't Microchip make their latest 8-bit devices with linear SRAM as well?

    Anyway..... I'm busy making an installer for version 3.5.2.7.

    Sorry for the anomaly, but sometimes it is not 100% my fault. LOL

    Procedures will always be created after the main code has compiled on pass 1, then added to the end of the code, so there is no need, and never will be, to jump over them.

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

  19. #10
    Junior Member
    Join Date
    Apr 2014
    Posts
    46
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    475.98 MB

    0 Not allowed!

    Default Re: HAVING ISSUE WITH PROC USAGE project is high speed serial backpac

    thx Top204 and others ;;;

    I tried using a colon on the same line as [ CASE > 5 : goto somewhere ]

    The compiler went crazy and said that many vars NotFound
    should putting the : goto somewhere work or is that a no no ???

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

  21. #11
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,396
    Thumbs Up
    Received: 48
    Given: 39
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: HAVING ISSUE WITH PROC USAGE project is high speed serial backpac

    The colon used to mean "end of statement", so you could put several statements on one line.
    I'm not sure if that still applies. This is OK:

    Case 5
    goto xyz

    Charlie
    Last edited by charliecoultas; 29th September 2019 at 13:33.

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

  23. #12
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,513
    Thumbs Up
    Received: 318
    Given: 152
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: HAVING ISSUE WITH PROC USAGE project is high speed serial backpac

    A colon is not supported after a Case. That is C syntax.

    The code used if the Case is true is held on the next lines.

    I'll add this to the compiler's manual.

  24. 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. HISPEED SERIAL BACKPACK Need help/Recommendations
    By xtal in forum Projects discussion
    Replies: 6
    Last Post: 17th October 2019, 22:24
  2. Serial LCD backpack DIY
    By yvesmazzon in forum Projects discussion
    Replies: 10
    Last Post: 1st December 2016, 23:12
  3. High Speed Data Logger
    By Sterling101 in forum SWright's Feedback Forum
    Replies: 7
    Last Post: 13th January 2008, 16:40
  4. Serial LCD Usage
    By Qkeyboard in forum Proton Plus Compiler v3
    Replies: 16
    Last Post: 4th January 2008, 17:44
  5. [SOLVED !] T6963 Graphic LCD serial backpack
    By J. Mark Wolf in forum Proton Plus Compiler v3
    Replies: 17
    Last Post: 27th February 2007, 03:21

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