Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: touchRead and Snooze library

  1. #1
    Junior Member
    Join Date
    Dec 2018
    Posts
    4

    touchRead and Snooze library

    I'm using Colin Duffy's Snooze library on a Teensy 3.2 and it works very well. However, I need to change the touch sensitivity via the CURRENT, NSCAN, and PRESCALE parameters (as per advice from this forum) in the teensyduino touch.c file. I can get a set of values that give me the desired touch sensitivity and range. Strangely, changing these values in any significant way seems to not wake-up the processor anymore. From my intrinsic testing, it seems that as soon as the touchRead values are above 1600, it no longer works. Any ideas/advice would be gratefully received? Many thanks.

  2. #2
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    978
    You can play around with those parameters in Touch.cpp under "HAS_KINETIS_TSI" section. Those settings where similar to what Teensyduino has at the time I wrote it. I can take a look at this but not till after the holidays.

  3. #3
    Junior Member
    Join Date
    Dec 2018
    Posts
    4
    Thank for replying. Yes, that's what I've done, and it seems to break the sleep function. I've spent a good day on trying to figure out why but no luck so far.
    Any help you can provide even after the holidays would be greatly appreciated.
    Happy holidays!

  4. #4
    Junior Member
    Join Date
    Dec 2018
    Posts
    4
    As my development project nears the first release, I've not been able to make progress on this issue, despite a fair bit of debugging. I'm as clueless as before, I'm afraid. I must point out, though, that this library works really well in all other respects and I was able to bring the hibernation current down to 72 uA which includes the Teensy 3.2 and my PCB that it sits on.

    Although not directly related to this issue, I was chasing a strange problem where the hibernation current was 72 uA at first but after the SD card was accessed for the first time after coming out of sleep, the sleep current thereafter went up to 480uA. Removing the SD card prevented this rise in current, so was pretty sure it was related to the SD card. The SD card sits on my PCB and has a VCC high side MOSFET switch to turn it off during sleep. After a bunch of debugging, I was reading through the Samsung SD card specification and it mentioned the importance of making sure the SPI lines were low before turning the VCC on or off. Otherwise, the SD card would get into an "unknown" state. I then manually set the SS, MOSI, MISO, and CK lines to low using digitalWrite, plus a 50 msec delay, before turning on VCC via the MOSFET. This fixed the issue and hibernation current was back down to 72uA. Somehow, this "unknown" state prevent the MOSFET switch from fully turning off and kept some current being supplied to the SD card.

    Maybe this will help others, hopefully.

Posting Permissions

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