• AVR Freaks

Hot!RB13 on dspic33EP32MC204 works correctly only when stepping in debug

Author
slavka013
Starting Member
  • Total Posts : 85
  • Reward points : 0
  • Joined: 2003/11/07 12:47:21
  • Status: offline
2019/08/29 10:57:43 (permalink)
0

RB13 on dspic33EP32MC204 works correctly only when stepping in debug

This is an update of an older board, not an initial bring up. It is using all of the pins with PWM, UART and other stuff working correctly.

Now I need to add one more control, and the only free remaining pin is RB13. Suddenly, it gives me trouble. I wan't to use the pin as  a digital output, but... The pin appears to be working correctly ONLY when the chip is being stepped through in debugger. As soon as I click RUN the pin goes to zero. When it is stopped again, either through a breakpoint, or via STOP button, it goes back to the correct value of logical 1.
 
Relevant registers as seen in debugger when stopped:

ANSELB = 0
LATB = A002
TRISB = 0x5385
CTMUCON1 = 0x4000

RPINR18 = 0x2C
All other RPINRxx = 0
 
JTAG disabled in config word. Anything else I might be missing?
 
post edited by slavka013 - 2019/08/29 10:58:56
#1

2 Replies Related Threads

    Antipodean
    Super Member
    • Total Posts : 1752
    • Reward points : 0
    • Joined: 2008/12/09 10:19:08
    • Location: Didcot, United Kingdom
    • Status: online
    Re: RB13 on dspic33EP32MC204 works correctly only when stepping in debug 2019/08/29 13:39:36 (permalink)
    0
    slavka013
    JTAG disabled in config word. Anything else I might be missing?

     
    Writing to PORT instead of LAT?
    Writing to the whole PORTB or LATB port somewhere else instead of masking off this bit?
     

    Do not use my alias in your message body when replying, your message will disappear ...

    Alan
    #2
    slavka013
    Starting Member
    • Total Posts : 85
    • Reward points : 0
    • Joined: 2003/11/07 12:47:21
    • Status: offline
    Re: RB13 on dspic33EP32MC204 works correctly only when stepping in debug 2019/08/29 13:59:57 (permalink)
    4.5 (2)
    False alarm, somehow the PWM2 was enabled taking control of the pin.
     
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5