B@tto 51 Posted May 10, 2016 Share Posted May 10, 2016 Hi, I have a project of data logger based on F5510 and I want it sleeping when USB is not connected. My question is pretty simple : if I use USBSerial library, do I have a special thing to do it (except play with sleep() commands of course)? First I thought that I would have to play with begin() and end() to activate/deactivate USB peripheral to go low power, but after all, if VBUS is not present, USB can't work ? In the end it would just consist in a flag I would add in the library, but if I can do it without any modification it would be a good thing ... Regards EDIT : another precision in my demand : I want to be in sleep mode when USB is not connected (a lithium battery supply the module when usb is not connected). What's the best way ? A simple if(!(USBCNF&USB_EN)) sleep(500) ? EDIT 2 : so I made some tests, using USBCNF&USB_EN is a good logic test but I found another problem : it does not work if I use sleepSeconds() (sleep() is OK). Any idea ? I looked into USBSerial lib + wiring.c but I did not find anything that could cause that. Quote Link to post Share on other sites
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.