Disclaimer of the Author
Code
All the code available for downloads from this website, has been written with a “no-harm” policy in mind, such as it is intended to run on most computers without causing any harm. However, bear in mind it has not been tested for every hardware configuration imaginable. It is advisable therefore that you exercise care when using this code. Should any malfunction of the code occur, we do not assume any liability for the damage it may cause.

Entries (RSS)
respected Sir/madam,
I m Lokesh Bhatt.presently working on PIC24FJ128GA010.Can u help me by giving SPI tutorial/program of PIC24F.Your I2C code/tutorial helped me too much.
THANX in advance
Hmm, right now I don’t have any project dealing with the PIC24 and SPI. Usually I just pick out IC’s that doesn’t require SPI. If something comes up in the future, I’ll definitely post up the SPI tutorial.
-J
I have some working SPI code for the PIC24FJ. I’m interfacing with an ADIS16355. SPI is really easy, nothing to be avoided. If you want it let me know and I can send my code to you. Your site has help me get up to speed on the PIC24 so I’m happy to help.
That would be great! Please send the code. I’ll take a look and post it up. Send me a message at:
jliu83 (at…) engscope.com (those damn pesky web bots…).
Thanks.
-J
Hi..
I am a new user of microcontroller and we have this project involving MCU. I have just purchased the PIC24F04KA201 to be used. Our project is an MCU controlled oven use to get the moisture content of the soil. In the oven, we put a temperature sensor and a load cell for measuring purposes. So we have to fed the output of the sensors to the MCU to convert it to digital and send it over the serial COM. The signals are now to be plotted using MATLAB. The oven would turn on by a signal coming from the host computer and turn off if the soil weight would be constant(base on the output of the load cell). My concern now is that: what am I going to learn first about programming the PIC? Can you give me an advice on what to do first or the sequence of the tasks in the programming? I am done reading your tutorial. I am hoping for your kind attention. We have to accomplish this before March 2010. Thank you.
Well, if you are new to microcontrollers, or even to the PIC, I think it will take several months. First, you need to design a circuit board that will fit all your needs. Next you need to familiarize yourself with the PIC tool chain as well as the steps required to program the controller. Next you need to know how to write C. That’s a lot to do in two months. Lastly, if your project requires a host computer, you need to write host code. If you have a team of 4 specialists, I think it can be done, however if you are just starting out, I think it would be difficult in two months.
There are several complications. For example, the temperature sensors is probably a thermistor. You need a constant current source built into the circuit in order to use it, then you need to use the analog module of the controller to take readings. You also need to build a software filter to take care of noise and outliers, if any. Unless there is a digital interface on the load cell, it is probably also analog. On most of the PIC24F’s, there is only one analog sampler. This means that you will need to write a program that switches back and forth between the thermistor and the load cell. Next you need a TTL to RS232 converter in your circuit, then write the code to interface to a host. Lastly, write the host code. This is usually done is Java or in Visual Studios. Test/Debug comes next. I would say it’ll take a good 6 months for a student, 3 months for an experienced engineer.
-J
Well. Thanks for that. That time would be too long. I think I would just going to experiment on using the codes on your tutorial. That would for for any PIC24, right?
So, beside using RS232 circuit, we need an additional TTL to RS232 converter?
Sorry for many questions. I read about TIs MAX232, it says that each driver converts TTL/CMOS input levels into TIA/EIA-232-F levels. Do I need another TTL-RS232 converter? We are going to amplify the outputs of our sensors, for the temperature sensor, we are going to use a precision op-amp and for the load cell, we are going to use an instrumentation circuit. Could you give me a sample code on switching the outputs of load cell and temp sensor.
thanks.
Well it’s obvious you haven’t read the tutorial, or haven’t read it very well. Please read the analog section as well as the UART section. If you are new to microcontrollers, the only way to learn is to do it yourself. Please don’t go around asking for code, ESPECIALLY if you haven’t tried to do it yourself.
You’ll need a MAX200–MAX209/MAX211/MAX213, but if you read the tutorials and the sample codes… you would have known that.
-J
Okey.. Thanks.. I just received my PIC24 now.