Saturday, May 26, 2012

Computing 16 bit CRC-CCITT

I've been working to a make a computer client-application in order to communicate with a Phillips IntelliVue Patient Monitor device. The patient monitor device uses well established protocol called Data-Export-Protocol for the communication. I'm trying to implement the protocol over COM port and unlike UDP/TCP sockets COM port libraries do not have any well defined standards. For a long time, I was stuck on calculation of CRC checksum for transmissions of the data from and to a Philips Patient Monitor. It took quite bit of searching on Google to find the solution for it. Phillips Data Export Programming manual was not particularly useful as they did not have much information regarding the algorithm to calculate the CRC. 

I'm posting a link for the C code that I'm using in my library to calculate the CRC checksum. So far, It works fine for me. For details about the algorithm, please refer to the article that I found over Dr. Dobb's journal (second link below) and also one paper written by Bob Felice (third link below). 
If you are working on a similar project and it might be interesting to chat. I've setup the project on Github. Feel free to contribute if you have worked on it before or you are expert in this field. Leave your comments below.

Sunday, May 29, 2011

Installing Ubuntu 11.04 on Thinkpad T-500

Hi everyone. This summer I've been working as student  research-assistant at Health Informatics Research Lab in UOIT (University of Oshawa Inst. of Technology), Oshawa. I'm working on a new programming language called SPADE (Stream Processing Declarative Engine) which requires me to work on Linux, as the language compiles on red-hat Linux only. To get used to the Linux environment, I installed Debian based Ubuntu on my personal laptop (Thinkpad T-500). It is a very powerful OS and definitely big competitor for Windows and MAC. It took lot of googling and researching to install the Ubuntu to support all the addons of the Thinkpad. So here is my guide [PDF or DOCX version] to help you guys in installing Ubuntu 11.04 on Thinkpad T-500.

If you need more help with installing the Ubuntu on Thinkpad then the links below will be useful -

Sunday, May 22, 2011

Using in-build Accelerometer in Lenovo Thinkpad

Hi everyone. I'm posting a project on my blog after quite some time. With starting of the second year in the university, I got busy with the studies and school related projects which slowed me down a bit. Anyways, I've started building projects again and I might post more projects this summers.

My university has issued me Lenovo ThinkPad T500 , it is definitely a very powerful machine but a feature which attracts me most is its APS (Active Protection System). It prevents hard-drive from external shocks or sudden change in motion. It uses in-build accelerometer which tracts the movement of laptop in real-time. That is nice, but it would be more nicer if we could somehow be able to capture the accelerometer data using some coding. Fortunately, I find this great article written by Sigfrid3141 on Codeproject website. Make sure you read his article.

After some coding I was able to get the average roll and pitch of the accelerometer inside my Think Pad. Basically, roll is relative rotation of laptop on its x axis and pitch is relative rotation of laptop on its y axis. I've made this picture, it not too good, but it will give you an idea about roll and pitch. You can find more useful stuff through Google.

I used real-time roll ad pitch of laptop and compared it with the resting roll and pitch to control a random game car racing game on the mini clip. It was quite simple not much coding once you are able to get the roll and pitch data from the accelerometer. You can check the video below to see my application in action.


I hope you find it interesting. The possibilities of this are endless may be shake you laptop to change song, scroll and what not.

Article that helped me building this application are:

Sunday, July 18, 2010

Controlling cursor with laser light



Hi. I've created a program that could control cursor by using a webcam and an ordinary laser pen. Check out the video above!

I used the open source image processing library called AForge.net(hosted at google projects). You could visit the official site of creator of AForge to see some tutorials and documentations. Algorithm is pretty simple based on extraction of red blob from image then with position of that blob mouse is controlled. If you working on similar project then you could see one of my article or I could give you source code, just leave a comment below. Have fun !