I have developed an application that runs on a Microchip PIC microcontroller (PIC24HJ64GP502). This is actually a PIC24 (https://www.sparkfun.com/products/retired/9148) that I originally bought from Spark Fun and that no longer is commercially available. It contains a bootloader (Bully Bootloader) that allowed me to watch the real time change of variables (on my PC screen, via the USB connection between my PC and my PIC24) that were calculated by my application's algorithm.
Let me explain basically what my present PIC24 does: A 3.3 volt heart rate pulse detector (worn on my finger tip: http://pulsesensor.com/) feeds an analog signal to my PIC's ADC peripheral (AN0 pin). A 3.3 volt accelerometer (MMA8452Q: https://www.sparkfun.com/products/12756) connects to my PIC uC via the I2C peripheral (SDA and SCL pins). A 32 KHz crystal along with two 22 pF capacitors connects to the SOSCI and SOSCO pins of my PIC24 to provide a real time clock and calendar (needed for time and date stamping my logged data).
From my pulse sensor and accelerometer signals, my PIC24 (worn on my wrist while sleeping) determines when I experience REM sleep and sends pertinent data (heart rate and body motion events along with time and date) to my PC via the USB connection. This data (up to 4500 KB per night) is logged on my PC so that I can later evaluate it and attempt to improve my algorithm's ability to better detect REM episodes.
I would like to power a similar PIC24 with a battery (instead of through USB as I do presently so as to be able to sleep without USB connection to my PC). I am not sure how to do this; in other words, which pins (e.g., Vdd, AVdd) would need to be connected to positive side of battery voltage (through a voltage regulator, I suspect) and which pins (e.g., Vss, AVss) would need to be connected to negative side of battery voltage? Where might I find pertinent information as to how to do set up a PIC24 for battery power? I have only been working with microcontroller boards that are powered through their USB connection to my PC, and so I am very unsure as to how to do this.
Also, I would like to write my logged data to a micro SD card (instead of to my PC so as, again, to sleep without being connected to my PC). I have never written an application that uses an EEPROM or SD. Can anyone advise me as to which peripheral (e.g., SPI) to use and where I might find pertinent information on how to do this?
I would be interested in any books or technical literature that anyone can recommend that might go into detail on how to do such things.
Let me explain basically what my present PIC24 does: A 3.3 volt heart rate pulse detector (worn on my finger tip: http://pulsesensor.com/) feeds an analog signal to my PIC's ADC peripheral (AN0 pin). A 3.3 volt accelerometer (MMA8452Q: https://www.sparkfun.com/products/12756) connects to my PIC uC via the I2C peripheral (SDA and SCL pins). A 32 KHz crystal along with two 22 pF capacitors connects to the SOSCI and SOSCO pins of my PIC24 to provide a real time clock and calendar (needed for time and date stamping my logged data).
From my pulse sensor and accelerometer signals, my PIC24 (worn on my wrist while sleeping) determines when I experience REM sleep and sends pertinent data (heart rate and body motion events along with time and date) to my PC via the USB connection. This data (up to 4500 KB per night) is logged on my PC so that I can later evaluate it and attempt to improve my algorithm's ability to better detect REM episodes.
I would like to power a similar PIC24 with a battery (instead of through USB as I do presently so as to be able to sleep without USB connection to my PC). I am not sure how to do this; in other words, which pins (e.g., Vdd, AVdd) would need to be connected to positive side of battery voltage (through a voltage regulator, I suspect) and which pins (e.g., Vss, AVss) would need to be connected to negative side of battery voltage? Where might I find pertinent information as to how to do set up a PIC24 for battery power? I have only been working with microcontroller boards that are powered through their USB connection to my PC, and so I am very unsure as to how to do this.
Also, I would like to write my logged data to a micro SD card (instead of to my PC so as, again, to sleep without being connected to my PC). I have never written an application that uses an EEPROM or SD. Can anyone advise me as to which peripheral (e.g., SPI) to use and where I might find pertinent information on how to do this?
I would be interested in any books or technical literature that anyone can recommend that might go into detail on how to do such things.