Forum Rule: Always post complete source code & details to reproduce any issue!
Page 5 of 5 FirstFirst ... 3 4 5
Results 101 to 111 of 111

Thread: T4.0 Memory - trying to make sense of the different regions

  1. #101
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,571
    Quote Originally Posted by mjs513 View Post
    Its been so long now since I read the overtempt seq but I do remember that when a reset triggers the T4 sets a register value for overtemp and was wondering at the time if we could then use that to shut it down. Have to reread that RM again - argh!!! I think it was in SNVS section have to go back again so don't hold me to that.
    @mjs513 - I passed code you wrote recently that decoded the boot state/history registers already? Maybe you can find that?

  2. #102
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,588
    @defragster
    Been so long now have to go see where I could of put that. Was just looking at the manual - chap15(PMU) pg1234, chap13(pg1185). When panic temp is hit irq_64 should be triggered. So would one have to check to make sure its first been enabled. But have to do a bunch more reading again.

  3. #103
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,588
    @defragster - @Frank B
    Finally had a chance to do some work on the tempMon again. Yes, Frank, tempmon now resets when the panic temp is hit.

    So using some code I modified from @defragster's debug_tt and @Frank B's power button function for arm power down I updated my standalone temp monitor sketch (didn't want to play with core yet) so I have it so that when the T4 resets due to temperature it will shut down. Attaching the sketch if you want to play and test it.

    Let me know what you think.

    EDIT: Is there a way to get the LED to blink if we hit panic temp before shutdown? Trying to figure out a way to let user know t4 was shut down due to temp
    Attached Files Attached Files

  4. #104
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,163
    Quote Originally Posted by mjs513 View Post
    @defragster - @Frank B
    Finally had a chance to do some work on the tempMon again. Yes, Frank, tempmon now resets when the panic temp is hit.

    So using some code I modified from @defragster's debug_tt and @Frank B's power button function for arm power down I updated my standalone temp monitor sketch (didn't want to play with core yet) so I have it so that when the T4 resets due to temperature it will shut down. Attaching the sketch if you want to play and test it.

    Let me know what you think.

    EDIT: Is there a way to get the LED to blink if we hit panic temp before shutdown? Trying to figure out a way to let user know t4 was shut down due to temp
    That works, my Teensy shuts down!

    For the blink, wouldn't we use the "high" Temp Alarm? (Give the program time to shut down external hardware or do other things)


    Maybe like this?

    normal program flow ->
    high temp -> user code to do some things (here blink) -> user calls shutdown
    panic -> teensy reset&shutdown because user did nothing that helped to keep the temp low
    Last edited by Frank B; 01-27-2020 at 07:10 PM.

  5. #105
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,588
    Quote Originally Posted by Frank B View Post
    That works, my Teensy shuts down!

    For the blink, wouldn't we use the "high" Temp Alarm? (Give the program time to shut down external hardware or do other things)


    Maybe like this?

    normal program flow ->
    high temp -> user code to do some things (here blink) -> user calls shutdown
    panic -> teensy reset&shutdown because user did nothing that helped to keep the temp low
    Ok try this - probably could be simplier for high temp:
    Attached Files Attached Files

  6. #106
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,588
    @Frank B, @defragster, @tonton81
    here a slightly modified version that follows @Frank B's flowchart which is probably a better way to go:
    normal program flow ->
    high temp -> user code to do some things (here blink) -> user calls shutdown
    panic -> teensy reset&shutdown because user did nothing that helped to keep the temp low
    Attached Files Attached Files

  7. #107
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,163
    I tried this
    I added a Serial.print("alarm") to the High_low_temp isr.
    Huston .. we have a problem.. it gets called again and again. Because..yes.. sure, the high temp stays high.
    Maybe we need to disable the interrupt until "low" temp occurs? Then, Low-temp should be not much lower then high temp. Maybe 2 degrees?
    "Low temp then should re-enable high-temp.

    But that's just an idea. Maybe you know a better way?

    Or.. just leave it as it is, and provide a "wait for lower temp" which gets called at the end of the interrupt ? (Maybe something with "wfi" - this makes the cpu sleep until the next interrupt and helps to cool it down...)

  8. #108
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,588
    Just a quick note: I just tested something and once the interrupt bit is set its set. I can't seem to clear it. Going to do a work around tonight but tied up with other things right now.

  9. #109
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,571
    Persistent interrupt a pain - but makes sense - it could be polled in loop just as well then.

    When seen in either case - record first time and temp - drop CPU speed or other effort to drop the temp based on the system - turn on a fan or alert the user. Monitor the temp for cooling effect and decide what to do if it keeps rising or stays too high too long.

    If user gives a callback - can set interrupt or create a polling TempMonitorCheck() function that calls the callback or returns the state, and allows for interrupt disable. No good answer just need information and options to handle it?

  10. #110
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,588
    Have another issue now that I am trying to sort out. If both the Panic and High temp are not both in isr's the T4 resets before Panic temp is tripped unless i have a coding problem - think i am going to start over. But you know me i am a morning person (NY time) not a night owl\\

    EDIT: Not 100% true. PANIC ISR never fires. resets before interrupt is set. Have a workaround though Tomorrow morning
    Last edited by mjs513; 01-28-2020 at 12:44 AM.

  11. #111
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,588
    Morning
    Ok here is something that we can use for resetting at Panic Temp and high/low temp. The ISRs for Temp are interesting. Low temp is always fired, High temp fired when high temp is reached and always fires, panic never fires before reset occurs. Did test throttling at panic temp and it works, maybe we should use. High Temp lights up the pin13 LED and will turn off at low temp now. Unfortunately once I turn the ISR on it is always firing don't know what kind of performance hit this will be though so this is getting more complicated using high/low temp since there is only one IRQ for both. May have to revert to a user call function to check temps.

    Too bad there is no way to use the red LED for this but I believe Paul said we do not have access to it.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •