• AVR Freaks

SWR (software reset) on a PIC24FJ256GB206 device

Author
BobAGI
Super Member
  • Total Posts : 1715
  • Reward points : 0
  • Joined: 2011/03/09 00:04:35
  • Location: Texas and Sweden
  • Status: offline
2013/01/02 08:28:09 (permalink)
0

SWR (software reset) on a PIC24FJ256GB206 device

Does the PPS values survive a software reset?
I am wondering about how it actually works and I was not any wiser after reading the reset and PPS sections in the Family Datasheet.
So imagine I have an application that sets peripheral pins in a certain way (like one always does) including defining the UART1 connection to the pin and then later I jump to the boot loader by executing a software reset ( asm ("RESET")).
Will the boot loader have access to the same pin map as was set up by my application? So will the UART1 still be driving the same pin?
Or do I have to re-map all of the pins?
 

--
Bo B
Sweden & Texas
 
#1

2 Replies Related Threads

    MarkT
    Super Member
    • Total Posts : 650
    • Reward points : 0
    • Joined: 2008/12/10 14:18:25
    • Location: Australia
    • Status: offline
    Re:SWR (software reset) on a PIC24FJ256GB206 device 2013/01/03 00:39:48 (permalink)
    0
    From the RESET section of a PIC24FJ256DA datasheet: "Any active source of Reset will make the SYSRST signal active. Many registers associated with the CPU and peripherals are forced to a known Reset state."
    It looks from the PPS section like the RPINR register bits reset to 1's and the RPOR register bits reset to 0's.
    The implication is that they will be reset by a software reset.  Pretty easy to test in hardware though.

    non illegitimi carborundorum
    #2
    BobAGI
    Super Member
    • Total Posts : 1715
    • Reward points : 0
    • Joined: 2011/03/09 00:04:35
    • Location: Texas and Sweden
    • Status: offline
    Re:SWR (software reset) on a PIC24FJ256GB206 device 2013/01/03 01:29:00 (permalink)
    0
    Thanks, I was wondering about the "Many registers" statement, because it is so vague....
    Now I have come across another piece of code that also confuses me a bit:
    When the AN1157 boot loader activates the main application, it does so by jumping to it via the application reset vector in the jump table.
    But that surely will not change any registers as would a reset.
    So now my concern is if the application will really be properly initialized?
    Sure, it will run through all the coded initializations as well as the C subsystem startup, but can one be sure that it will behave the same as if it was not started from a boot loader?
     
    And follow-up to that would be that I could activate the boot loader from within my code using the same type of jump method the boot loader uses to activate the application. That would in fact mean that all hardware settings would be intact when the boot loader starts running this way as opposed to through a power on reset.
    But I have to prepare for the jump by at least disabling all interrupts first (I have a lot of these) because the ISR vector targets will soon be erased. The boot loader uses UART1 in a polled way, no interrupts used.
    Need to think through this again.

    --
    Bo B
    Sweden & Texas
     
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5