• AVR Freaks

Hot!Lab-04 exercise bug?

Author
danielsoy
New Member
  • Total Posts : 28
  • Reward points : 0
  • Joined: 2014/05/19 15:28:30
  • Location: 0
  • Status: offline
2019/04/20 09:43:34 (permalink)
0

Lab-04 exercise bug?

I have got a problem with LAB-04 exercises.
 
Where can i post ?
#1

16 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 17504
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/20 10:03:09 (permalink)
    0
    What is a LAB-04?
    #2
    danielsoy
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2014/05/19 15:28:30
    • Location: 0
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/20 13:04:50 (permalink)
    0
    http://microchipdeveloper.com/tls2101:lab4
     
    Its part of a series of C programming tutorials.
     
     
    #3
    danielsoy
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2014/05/19 15:28:30
    • Location: 0
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/20 13:07:29 (permalink)
    0
    After ejecution of line 100, proramm lost its track, and enters in an endless lopp,
    instead of jumping to the next line of code.
     
    #4
    danielsoy
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2014/05/19 15:28:30
    • Location: 0
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/20 13:11:07 (permalink)
    #5
    danielsoy
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2014/05/19 15:28:30
    • Location: 0
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/20 13:19:59 (permalink)
    0

    I cant upload my C files when i try with the full version:

    You don't have permission to access "http://www.microchip.com/forums/post.aspx?" on this server.
    Reference #18.469862be.1555791349.529957e
    #6
    Bob White
    Super Member
    • Total Posts : 256
    • Reward points : 0
    • Joined: 2010/11/06 19:52:38
    • Location: Denver, Colorado
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/20 14:33:57 (permalink)
    0
    Post your code using code tags.  [CODE] to start your code block (with CODE actually in lower case, i.e. "code") and [/CODE] to end the code block (again with code in lower case, "/code").  That works much better than posting links.  Any link away from this site is always suspicious to me as a possible link to malware.

    void main(void)

     
    #7
    du00000001
    Just Some Member
    • Total Posts : 2786
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/20 17:08:47 (permalink)
    0
    I can't see any mention of some floatvariableX in lab4.
    Could it be this is an "inentioß" of your own?  :(

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #8
    qhb
    Superb Member
    • Total Posts : 9998
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/21 04:21:55 (permalink)
    0
    du00000001
    I can't see any mention of some floatvariableX in lab4.

    Yes, it's there in the provided source code.

    What I don't see are any config bit settings.
    Could this be the simulator correctly simulating the Watch Dog timer activating?
     

    Nearly there...
    #9
    danielsoy
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2014/05/19 15:28:30
    • Location: 0
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/21 08:29:43 (permalink)
    0
    I am starting with C, so i cant say for sure.
     
    But changing the suspicious code line by:
     
    floatVariable2 *= floatVariable1;  // * instead of /
     
    The programm flows like it should.
     
    Looks like something related to the type of variable of the result...
    #10
    du00000001
    Just Some Member
    • Total Posts : 2786
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/21 08:58:07 (permalink)
    0
    @ danielsoy
     
    I'd suggest to provide your source code.
    I don't know the values of these floatVariableX, and a division might easily throw some exception/interrupt that you forgot to catch/service.
     
    PEBKAC
     

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #11
    danielsoy
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2014/05/19 15:28:30
    • Location: 0
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/21 08:59:46 (permalink)
    0
    float floatVariable5 = 10.00;
    float floatVariable6 = 100.00;
     
    Same thing with:
     
    floatVariable6 /= floatVariable5;   or   floatVariable5 /= floatVariable6;
    #12
    danielsoy
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2014/05/19 15:28:30
    • Location: 0
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/21 09:49:57 (permalink)
    0
    It looks like [<font]___divsf3, is not part of xc16 compiler functions set ....
     
    https://www.youtube.com/w...c&feature=youtu.be
    #13
    danielsoy
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2014/05/19 15:28:30
    • Location: 0
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/21 11:31:59 (permalink)
    0
    I will try to run the code, on a 64bits windows, n se how it goes....
    #14
    danielsoy
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2014/05/19 15:28:30
    • Location: 0
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/22 09:07:46 (permalink)
    0
    nothing changes running LAB-04 exercise, in win seven 64bits.
     
    c file attached.
     
    #15
    du00000001
    Just Some Member
    • Total Posts : 2786
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/22 09:31:07 (permalink)
    0
    "nothing changes" should be understood how exactly?

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #16
    danielsoy
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2014/05/19 15:28:30
    • Location: 0
    • Status: offline
    Re: Lab-04 exercise bug? 2019/04/22 16:20:30 (permalink)
    0
    That crashes after the same code line (division), when the compiler
    calls ___divsf3 function, as it can be seen in the disassembly listing.
    Already found the solution here:
    https://www.microchip.com...m920175.aspx?tree=true
    Doing: >Files > Project Properties >XC16 (Gobal Options)
    Unlock.
    Checking in: Fast Floating-point Math.
    Apply.
    OK.
    In MPLABx-ide v5.15.
    Thanks a lot to all 4 your help .
    #17
    Jump to:
    © 2019 APG vNext Commercial Version 4.5