touchRead and Snooze library

Status
Not open for further replies.

2moto

New member
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.
 
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.
 
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!
 
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.
 
Status
Not open for further replies.
Back
Top