Bug or something else


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2009
    Posts
    755

    Default Bug or something else

    I'm used same code on PIC18LF13K50, now i just copy/paste same code for PIC18LF2550
    But 1 byte is always zero.
    I tried like this
    Code:
                APN_Name var byte[20]
                APN_Pass var byte[20]
                APN_User var byte[20]
    
    
    serin2 PC_RX,Baud_Rate,500,PC_Data,[wait("DATA:"),day, month, yr, hour, minut, sek,str dat\4,_
           str sms_no\20,_
           str apn_name\20,str apn_user\20, str apn_pass\20,_.....
    But apn_name[0] always has the value 0.
    Then i tried this
    Code:
    serin2 PC_RX,Baud_Rate,500,PC_Data,[....       apn_name[0],apn_name[1],apn_name[2],apn_name[3],apn_name[4],apn_name[5],apn_name[6],apn_name[7],apn_name[8],apn_name[9],apn_name[10],apn_name[11],apn_name[12],apn_name[13],apn_name[14],apn_name[15],apn_name[16],apn_name[17],apn_name[18],apn_name[19],_
           str apn_user\20, str apn_pass\20,_...]
    Same result.
    Then i tried this
    Code:
    serin2 PC_RX,Baud_Rate,500,PC_Data,[.... apn_name[1],apn_name[2],apn_name[3],apn_name[4],apn_name[5],apn_name[6],apn_name[7],apn_name[8],apn_name[9],apn_name[10],apn_name[11],apn_name[12],apn_name[13],apn_name[14],apn_name[15],apn_name[16],apn_name[17],apn_name[18],apn_name[19],apn_name[0],_
           str apn_user\20, str apn_pass\20,_...
    Now it was expected that apn_name[1] is 0, but its value is now fine,
    but apn_name[0] is 0
    I tried to move position of apn_name[0], and its always 0
    I tried to change name of variable apn_name into apn,apn1,apn_1, but always same...
    And all data before and after apn_name[0] were received correctly.
    Does anybody have idea what is going on

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Bug or something else

    It reminds me something, not sure what but, can you try to replace the square bracket with parenthesis within the SERIN2 lines?

    something like
    Code:
    serin2 PC_RX,Baud_Rate,500,PC_Data,[....       apn_name(0),apn_name(1)......]
    EDIT: For testing purpose I would get rid of the Timeout...

    Damn I'm rusty
    Last edited by mister_e; - 7th February 2011 at 02:18.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Bug or something else

    I did, no matter where I put Apn_name(0),same result...
    I have defined some variables, only for testing, and everything is ok, but apn_name(0)
    EDIT:
    I really have no idea what's going on ...
    I tried this
    Code:
     serin2....[....i,apn_name(1)....]
    apn_name(0)=i
    And its working, but...
    speechless
    Last edited by pedja089; - 7th February 2011 at 02:48.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Bug or something else

    What's sending the data to your PIC? Can you sniff it with a Terminal software?

    What if you define your array at the top, then add the remaining vars bellow?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Bug or something else

    VB6.
    Of course, I first check whether VB6 send well.
    I shorted pin's 2 and 3 on the serial port, and put a piece of code that displays data from Rx in textbox.
    I have not changed anything in the vb6 code when I moved app_name[0].
    I just changed the position of the serin2.
    Now i will mowe to top of code...

  6. #6
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Bug or something else

    It does not matter where is the definition of variable, it is always the same.
    Now I changed the length of the array, and when I change the length of the array, the problem is moved from one array to another...
    So, this to me looks much like a bug...
    EDIT:
    Now I see that I wrote that I use 18LF2550.
    I wrote wrong, it's late so ...
    I moved from PIC18LF13K50 to 18LF14K50.
    18LF13K50 has 8K of memory, and that was a little to put an ftp and email client on it.
    So I switched to PIC18LF14K50 with a 16K memory, and I just copied and compiled code for it...
    Last edited by pedja089; - 7th February 2011 at 03:17.

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Bug or something else

    Problem solved then?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Bug or something else

    It isn't...
    If I put apn_name var byte[25], that problem moves to apn_user[0]....

  9. #9
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Bug or something else

    I tried a few things ...
    If I make array of variables with the name of AA, the problem is moved to it. And if I create a variable with a name such as VV, the problem remains the variable apn_name.
    I suppose the bug somewhere in the allocation of address variables.
    I notice that alphabetical order of names is important, when addresses are assigned to variables...

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