• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC microBASIC Programming

Not open for further replies.


New Member
Hi, I was wondering if anyone could help me with programming a PIC16F84 using basicmicro and LM75 temperature sensors. I, along with 2 other people, am working on a design project that uses the PIC16F84 and LM75 temp. sensor. The design is to build a climate control system using temp. sensors. The program is supposed to read the demand temp. (which will be inputed into a DIP switch), convert to degrees Celsius, read inside and outside temperatures and from that, determine whether to turn on the heating or cooling systems on or off. It would be helpful if I can get some info on initializing the option and TRIS registers and also how to read from the LM75. This and any other helpful info would be greatly appreciated.
-p.s. you will even be credited in the final report if your info is useful


New Member
Hi soniya,

First of all, if you haven't already bought the parts, use the LM76, it has much better temperature resolution.

The interface to the LM75 is quite easily done through an I2C protocol, which is helpful because you don't need to do any A/D conversions, it is already done for you.

How familar are you with the PIC microcontroller? If you are just beginning, I suggest you go ahead and learn the assembly language. I believe the PIC16F84 doesn't have any hardware I2C peripherals, so you need to implement it into software.

The process of doing this is called 'bit-banging', which requires a bit of knowledge of how to control the I/O of the control and timing routines. Try to find some information on I2C, it is all over the internet. You need to generate start and stop conditions.. You need to pullup the outputs with resistors to Vcc. I recommend the book 'Serial PIC'n' by Square 1 electronics, which details how to implement serial protocols with the PIC.

Myself and most others agree that it is best for students to learn and do for themselves with the guidance of more experienced people. Initially, as I said, you need to learn the assembly or even learn a higher level language and use a compiler.



Active Member
If you are looking for digital sensors try DS1820 / DS1821 from Dallas Semiconductors (www.maxim-ic.com). These are very tiny sensors in TO-92 package with 1-wire protocol. Accuracy is +- 0.5 degree and range from -55 to +125 Degree Celcius. DS1820 is normal temp. sensor while DS1821 is sensor with inbuilt thermostat.


New Member
use a basic compiler and I2C


Hi, maybe it's much easer to program in basic to get a quick result of youre
project. At site below you can download a demo version of a PicBasic
compiler who's supporting I2C and onewire protocols to.
One desadvantage of the demo is teh max length of program are
35 lines of basic and no multiple instructions on one line.
But I think for youre application it's much enough.

Hopely this would help you futhermore

Not open for further replies.

Latest threads

EE World Online Articles