My Pic32 Home

Hello everyone I have tried to put together a Site about the PIC32 & the associated contest.
I am trying to put most of my content here so that people can directly view what ever they require.
For More recent updates visit my Blog:

Thanks for your Support.

VSCP Startup Projects:

1. VSCP - Kosh 

PIC32MX3XX-PinFunction Picture helps in IO Selection:

I was among the The Top 8 in this Contest but had to drop out since I didn't secure a Visa to go US.
But Thanks to  Microchip I was Honored with a Certificate at Microchip India GDC.

LATHI – Intelligent Helper for The Aged and old people

Click Here to Enlarge

Vision Statement

This project is a helping device intend to be used by the Old & Aged people. The primary features of this device are listed below:

  1. Direction Finding & Audio-Visual indication of Fixed Map Location:
    This would help the aged people when they forget their way and want to come back to home. This device would give then a relative distance from the home and also a beep which would get intensified as they near the house.
  2. Medicine Reminder and Scheduler – up to 25 Medicines:
    Many times the aged people would forget to take medicines. And also sometimes forget to keep a stock of the medicines before they finish. So this device would be able to remind, schedule and track the Medicine delivery.
  3. Panic Button: Life Saver
    In certain health situations the aged people may not be able to speak or move. This device will have a touch sensitive switch and an Accelerometer to detect any such situation and send data to near and dears on their mobile & start an audio alert with voice to inform the passersby to help them.
  4. Programmable Infrared Remote:(FUTURE)
    It might be a difficult task for the aged people to again and again getup to fetch remotes for different applications such as TV, House Lighting, DVD etc. So this device would be able to help them in this. The device would be able to record the IR remote signals and map to the key pad or a small menu in the Display.
  5. Display:  OLED Color Display
    The device will have a sufficiently big display of 8cm x 6cm to write bigger fonts since the aged people have hard time reading the Text in smaller fonts. This will also help to keep the power consumption low. To help the reading there will be a ambient light sensitive back ground lighting of the display.
  6. Power Consumption: Ultra long Life
    This device would be acting as a life saver device so it requires being ultra reliable. Hence this puts extreme constrains on the device power consumption. Also for reliability some backup battery is needed. The design would contain dual battery function. The basic battery would be 2 AA sized cells and the backup battery would be CR2032. This insures that the device critical functions keep running even if the main battery runs out.

This project is inspired from a real life incident that occurred with my Grandfather in late 1989 when I was a kid. All these are the requirements that I felt necessary since the time I realized them from my own Grandfather. Today I have a chance to revive and make a better situation for others. So that the things that happened to my Grandfather doesn’t repeat with someone else.

Block Diagram:


This project is intents to satisfy in the closest of the details as explain in the Vision Statement. There might be small imperfections which can be taken as a future scope of development. Keeping this in mind we progress to the design blocks which are required to complete the basic Framework for the foundation of our concept. To have an ease of design and clarity of purpose the basic blocks can be divided into a set of stimuli and responses (Input and Outputs). Listed are the major interface blocks:


  • Buttons

    These would serve as the primary input method  from the user. There would be a set of functions that require to be controlled using these interfaces. Listed are various points where the following would be used:
    • Reset Primary Control: Used to reset the System to initial State in case some wrong configuration has occurred. This would be fail safe switch kept to erase all data and return system to the First position as a New unit
      Net Qty.: 1
    • User Button: This would be used as an alternative in case the Touch screen buttons are not being used.
      Net Qty.: 4
    • Panic Button: This would help the user to inform in case of emergencies. Also there would be a similar button on the screen.
      Net Qty.: 1
  • Touch Screen

    This would be a direct touch sensitive interface for the User. This would be helpful when the user is not having enough strength to press the Buttons. It would be place directly on to the display so that the Button text can be altered easily.
  • Accelerometer

    This is a critical part of the system since it would be used in multiple ways to render many functions. Listed are a few of its uses:
    • Free Fall detection: This would help to protect the device itself and the other sensitive parts. The device would also make sure that the free fall is not the user having a medical condition and falling down on the ground.
    • Detection for direction of Motion of the body of user: This would be helpful to get the statistics for the daily walking and the direction of the movement to plot a trace path.
  • IR Receiver(Future)

    It would serve to record the IR signals and play them back so that the required button press can be imitated
  • GPS Receiver

    This would help to know the location of the device precisely so that the Zero or Home point setting and the location of the User can be determined. It would also be helpful to get the co-ordinates of the user in case of the Panic Situation. So that the nearest hospital can attend to.


  • TFT Screen

    This is the Primary output to the User with rich interface to be easy to use. It basically consists of a TFT Screen and a Touch Panel which is used for input. Since the button can be drawn on the Screen it makes easy for the User to identify the options and use them.

  • Speaker

    The System contains a Speaker with an amplifier which helps to generate Speech and serve a emergency vocal alarm in case the user is unable to speak or move.
  • GSM Gateway

    This would be used in the system to send out SMS to the Hospital and the Family members in case of emergency.
  • IR LED (Future)

    This would be used to play back the coded sequences for various IR Switches that are recorded.


  • microSD Card

    The main storage for the System would be used for multiple purposes. Listed are a few of the uses for this project:
    • Store Medicine information and the related schedules
    • Store the Audio Playback for the System
    • Store calibration and reference data for the Accelerometer
    • Store IR codes for future use
    • Graphic Data for the System display unit
    • GPS location and tracking for Home seek function

Hardware Block for the System:

The above figure shows the concept for the connection between the PIC32 and the Peripherals.

Software Block Diagram:

This would be the typical Software Architecture of the System so that it is able to deliver to the maximum performance.


List are the Activities that I have done till now or are to be done on LATHI.


 Task List (Activities to be Done):

1. Solder Speaker Driver make addon Board - Done
2. Add support for playback from SD card + DMA based Playback - Done
3. Solder LCD wires - Done
4. Make LCD attachment for the IO to PIC32 - Done

5. Config IR Transmitter using OC - Done
6. Config IR Receiver using IC channel - Done
7. Put up more schematics - Done Finished All the Schematics & BOM
8. Solder ADS7846 and interface it to PIC32 - Done
9. Accelerometer Interfacing - Integration with new Board - Done
10. Voice playback Codec Interfacing- Done
11. SD-Card Interfacing - Done

12. Power Controller - Design board mount - Test & Deploy - Done
13. Make Debug IO Working - done
14. Make IR RX working with Higher Samples - done

15. Decide on the Storage Format for the IR Samples ARRAY - Future
16. Make IR Rx Format Playable on the IR TX Module - Future

17. GSM Modem API for SMS, INIT and MISSED-CALL - done
18. Interpert GPS Data and Enlist the Paramters for Configuration - done
19. Enhance Audio quality and Adapt MCHP Audio lib - Done using normal PWM.
20. Port Graphics Driver for HX8347 in MCHP Graphics Lib - Done
21. LCD Touch Screen Functionality with ADS7846 - Not working
22. Try LCD Touch Screen Functionality with PIC32 ADC - Touch Screen Damaged
23. New LCD Driver ILI9325 porting for FreeRTOS- in Progress
24. GSM Interface for FreeRTOS - done
25. Accelerometer computation in FreeRTOS -done
26. IR LED & IR TX in FreeRTOS - Future
27. GPS data send in SMS during Emergency - done
28. Time Function in Menu under FreeRTOS - done
29. Port Microchip FS driver for FreeRTOS - done
30. Optimize the Power Consumption by the Sysmon Tasks - Future
31. Revise PCB for new Power controller circuit - Not Required
32. Watchdog Safety analysis for FreeRTOS code
33. Integrate the Microchip's File System Driver into Main Code - done
34. Complete Documentation and final Release into Source Forge - In Progress

Progress Reports:


Today I finished the first beta release into the Source Forge website. Not keeping up well for this whole week. Now SMS and GPS have been fully optimized. Also the Final Intergration of the Microchip's File System Driver is complete. Now is the documentation part and soon I will upload the nightly build of the package into the project area.


Found that old board can be optimized to get maximum performance. So I would not be intgrating the new Power Board. It seams that it was really nice by still dont require it. So I can bring back the BOM costs. So I am happy to say that now it come to a total of $302.1 again. Also polishing the software helped to get some nice features. Now the GPS updates are blazingly fast and also the UI menu. The optimization in Task time allocation helped me. Now the main thing of integrating the Microchip's File System Driver into the the project to enhance the overall functionality.


The Schematics have been uploaded. I have also attached the menu pictures. Next step was to put the project in Sourceforge so that too I have done. I will release the updated software with the proposed exahaustive documentation soon.


The BOM has been updated for the additional components that were added as part of the current modifications. Now the BOM comes arount $308.93 slightly more costlier due to byforcation of the power distrbution system. Hope that I would be able to add the schematics by tonight.


The code is now taking shape but I am still having issues with the deadlock situations in the OS. I have posted for help in many of the forums on the same. I have also decided to use the Watchdog as a safety feature such that the things dont hang unnecessarily. Today I got my first prize pack and it was dream come true for me. I got the most powerful logic analyser. It would help me speedup my diagnosis of the system's operation.


Today I was able to successfully port and compile the Microchip File System Library v1.2.1 into the FreeRTOS v5.1.0. Now I am able to write to file and read files at a much faster pace than earlier. Hope that this would boost my Medicine Functions.
My Thanks to Microchip
for providing with such a nice well documented and Robust file system Library.
My new code is also documented using the Doxgen so I have better looking docs now. Have a look at my code docs at my website link.


Couldnt believe that I have been selected for Phase 4!!

A Big Thanks to the  


  techinsights, Digi-Key .

Thanks to Every one for their constant support and Encouragement!!


I have been able to make the Date & Time settings working in my code. Now the user can change the Date Information, Time and the Time Format. I have tested all the Features and they are working bug free. I have recently started again with the Microchip FS driver porting. Hope to make some progress and post it. Well the code is avalible for viewing at my website.
Here is the Link to the Code.


I have converted the whole code of the project to HTML and published on my site. The Time functions have been upgraded. I am now able to display Week Day , Month and have 12/24 hour format selection for the clock.


I have taken picures of the Menus and put them into a PDF file. Hope that this can give an idea for the various fuctions. Till now I have not made much progress on the File System Port but I consentrating more on the Time Functions of the code. So that I have the Full software for LATHI operation before I make further optimizations.


I have made the GPS data to be put into the SMS before sending. The PANIC functionality has been upgraded. Thecode is posted on my site. The Video that I had uploaded for this phase was not clear because of which my Menues are not visible. I will try to take snaps of the screen and post a slide show.


Today I made an attempt to make the new Microchip File System Driver work. Now the Static code is working. I have put it up on my website. Here is the link. Have a look. I would be making it to work with FreeRTOS and try to make the functions Re-entrance safe. I dont have a good interface for the Micro SD that I am using. Since there are know Card Detect and Write Protect Pins. Hope that when I get my new SD card socket I would be able to have the full functionality.


I have been able to make most of the functions working my project. Only remaining functions are recomputing the GPS data to be sent in the SMS. I hope that can be left for the next phase. Also the IR driver is working fine but I require to check integration with FreeRTOS. Hope that I will be able to put up the video soon.


I have been able to uploaed the Latest Schematics and the BOM along with the Hardware Block diagram. Still I am having problems in posting in the Forums, I am not sure what is wrong. Hope that things will be up and running soon. The net cost of the BOM comes to $302.1 since i have added some capacitors and protection components.


GPS functionality has been achieved. I am able to get the GPS data and the fix on the satallite. But unable to make the Home position as fixed since I still have some bugs to be fixed in my file system module. I have uploaded my code in the code section. Hope that I would be able to make the distance calculation algorithm working. I am still facing troubles since there are Stack overflows in the code and the OS hangs. But since in this phase we would require to complete the software part to 90% so I hope that would be fine. 


Now the playback of audio from SD card is working with menu action under FreeRTOS. Hope to post an video update soon. The Frequency Switching is also working so there should not be much of a problem now for the power save implementation but a lot to do before that.


Its been a very long time since my last update. This delay was caused due to many reasons like my HDD crash , LCD damage and loss of Schematics and PCB data. Infact my whole software was dead. I have been able to recreate the schematics after lot of effort. And also been able to make the Software working with FreeRTOS.


Fortunately I was able to get a new touch screen for the display. I will update as soon as I get it working.


I was struggling for a few days to implement the LCD Driver and upgrade functionality for the Touch screen. But now I found the ADS7846 chip was damaged and my LCD's Touch screen was also damaged. So I have to move to a new LCD to make sure that I still have the touch scrren functionality. This might delay my progess alot but have to do it since it is one of the nessary functionality. Since it might be helpful so I have posted the driver for the HX8347 in the LCD Display thread.


Today I was able to make the LCD function using PutPixel and GetPixel functions. This is the fist step to making the Driver package integrate into the Microchip's Graphics lib. Have a look at my code.


Now my GSM module is fully functional. This is the Link to my Code.
Here is the link to the video.


Today I was able to make my SMS work from the software. There was a bug in the initialization of my GSM modem. Now it can send SMS and also give Missed Calls. I would be posting the API soon.


A BIG Thanks to Microchip for Giving me such an Opportunity.

And a Happy and Prosperous Deepawali to All !!


The Infrared Reception Module software is now operational. I have posted the Code on my website. I was able to successfully use the Input Capture module and interface the IR Receiver.


The Debug Communication IO code is working. This would help me to develop software modules independently. I would also be able control the occurrence of the event for the particular software so that I don't have to do it in the actual Hardware.
Well now that everything has frozen I am still waiting for the D-Day when the results would be announced. This is one exam that I am allowed to take only once so the anxiety is growing.

Best of Luck to All!!


Now that the Design Freeze has commenced I wish for your support.
Please rate and vote my project.
Also let me know any flaws that you find or any additional features that can be implemented to make my design better


Hi Everyone,

I am back from my vacation. I will try to post some better pictures showing the parts of my project today.

Picture of my Project

In all I have exprerienced lots of excitement and thrill in this contest. I find that so many creative Ideas get their seed thought this type of contests. Well the videos that are loaded by many of the contestants are Awsome and I congratulate them all. I am getting lots of new ideas to enhance my project further with the help of all the projects out here. I have to wait till the Phase II results.

Best of luck to all the contestants,

Please let me know your views on my project - any suggestion and ideas .


And a Big thanks to 






Completed all the stuff required for Phase II. I was in a hurry since I had to go to my native on the occasion of the Auspicious Durga Puja festival and would be coming back by 13th Oct. So I have published the new Video , Code and the Picture so that you can rate my design. I have not concentrated much on the Software side since I wanted to make the hardware alright(That's partly the reason why I don't have a jazzy demo). Next I would be working to make the Driver for the LCD and the Touch screen since its my first requirements considering I dont have any spare RS232 for debug. Also I would require to followup and get the final PCB so that I can do a more reliable hardware. However it is working fine already.
I have also reduced my BOM costs owing to change in the GPS to DeLorme and some minor reductions. So my final cost stays at $292.7 .

Till then Please Vote my Design and rate its


I have uploaded the new Design with the GPS changed since I did't Receive my Parallax GPS I had to change it to RGPMS002 module and also added the SMA connector and the Antenna to the BOM just in case I require it. The Schematics have been updated with these changes. But the best part is I have managed to reduce $2 out of my BOM .
Now it totals up to $318.76.


I have been able to make the Power supply section work. I am now able to fully control what parts of my circuit are ON at a time. This was very essential considering the requirement to save battery in the Deep sleep mode. Here is a picture of the board (Without the Save Battery CR2032):

Power Controller

I have not opened my schematics since I wish to verify all fully before I post it out. I also had some trouble with the Mosfet IRF9530 since the footprint in the Eagle print was not correct. But now I have fixed that too. Just hope to start the GSM - Modem interfacing soon. I had some troubles with the board holding so I had to put rubber bands as you can see.


I have been able to finish my Full Schematics , Hardware Block Diagram , Software Block Diagram and the Final BOM so that I can concentrate more on riging up the stuff. These are posted on my project page. I will now go ahead with the full scale assembly of the board so that I can start on the Software development next. But there is still one thing that worries me is that I dont have my GPS unit yet so I am still at a gentle balence. At present I have hidden my schematics since I am still riging up the things but I will unlock it soon.
The Good part is the I am able to have the net cost of the project at $322.81


I have been able to make the LCD Interface. You can view the Video .
I will solder the ADS7846 Touch screen controller and post my next update soon.


I didnt make much of a progress since many of the things that I had procured havent reached me yet. But I never left hope. I started with a bit challenging part of Soldering the LCD. In process of waiting for the Op-Amps that I ordered for the Sound generation. Also I was able to make a base schematics. This was my attempt to break-ice on the documentation part. You can have a look at my project section. Here is a picture of my LCD with the Wires:

Soldered LCD

Hope that soon I would be able to finish up the rigup before I do the driver for it. I just pray to GOD that I get the other parts soon.


Today I received the Programming 32bit Microcontrollers in C book. I just can't wait to sweep throuh it. I would be a greate performance booster for me. And hope that I can post my updates faster. Thanks to Elisevier for the in time delivery.


I am now able to playback some sound from the PIC32. I didn't have much help from the Audio codec provided by Microchip but I was able to manage some thing without it. I have uploaded the Video in the project and the code in my Code Section. Next I would be upgrading this system by making it using proper Active 2nd or 4th order filter before it is fed to the LM386 power amplifier for the Speaker. Also the present demo runs the playback from the chip flash. So I have change this and make sure that it is able to play from the SD Card. Also the Play back is presently taking a lot of CPU so I plan to use the DMA and get things smooth and less resource hungry.


Today I was able to makeup the Accelerometer Interface and loaded a demo which can vary the LEDs based on X-Axis acceleration. I have uploaded a video for the this and the code in my Code Section. I am a little worried since my ordered parts have not arrived yet and that can put me off my schedule.


Good Day today!! I was able to solve the SD card issue and its now running from the Microchip's Driver. I am assured that at least my circuit didnt go in vain. There was one
thing that I learned from all this -

    Trust Microchip, they will get you through.

Well the Accelerometer is already interfaced I am just waiting to config my ADC and Aquire data. Lets see if my target app - Accelerometic LED is done Thanks to the generous community in this site for helping me out. Check out the Updated Code in my Project's
Software Section.


I am presently trying to interface the Micro SD card and facing a lot of trouble.
The Initilialization procedure is not working. I have uploaded a video as an update.
Please help me out with this.


This time I have been able to achive a lot of flexibility. The ADC value from multiple channels is uesd to control the light intensity of LED 0 by varing the Output Compare OC1 duty Cycle.
We can also see these values through the Serial Port. I had a small CP2012 baord which works at 3.3v - Ideal for this app. I just fitted it to one of the proto-board and was able to get data on UART. Here is the Video of the same. I will upload the Code in the code section after my formating and documentation is done.


I was able to configure the Change Notice Interrupts.The demo code has been uploaded to my Code Section along with the video in Youtube.


My First program on the PIC32 now executing.
This is the remake of the Microchip's demo code but it gave me insight of how to use the Plib functions.
I uploaded a video for the program's execution alog with the code.

As the things progress I would post more of the items.

Thanks to PIC32 for giving me an Highly anticipated & exciting opportunity,

Best of Luck,


Back to My Home Page