Login  Register

Re: IHU status message?

Posted by Karlis on May 18, 2016; 4:13pm
URL: http://bluesaab-forum.90.s1.nabble.com/IHU-status-message-tp177p370.html

Whenever IHU is switched away from CDC mode (back to Radio, Tape or OFF at all), it puts a frame with ID "0x3C0" on the bus. We handle that frame in the code and whenever we see it with the first byte being "0x14" we know the IHU is in "non-CDC" state. In this case we mark the BlueSaab module as "inactive" in the code and send the "disconnect" command to RN52 which tells RN52 to disconnect from the last known device and remain in "connectable/non-discoverable" state.

Now for the "S^" command part, it might get tricky. I have experimented and did some coding. It might be possible to send the module to sleep after "X" seconds of inactivity (not being connected to any device) and then wake it up on demand. This would be possible on v3.3 boards only though as they have a dedicated PWREN pin connected to ATMEGA328 which we can manipulate via code. On prior PCB versions I believe PWREN pin of RN52 is directly connected to 3.3V thus always staying high and we can't manipulate it via code.

Seth, am I right?
2001 9-5 SE V6; 2006 9-5 Wagon; iOS; BlueSaab version = "latest and greatest" :)