• 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.

Where to Start Programming Pics

Status
Not open for further replies.

ibwev

Member
I have a PicKit 2 Programmer that I experimented with a few years ago. I am now attempting a different project that needs a micro-controller. All I will need the micro-controller to do is detect a high or low signal from a sensor and then send an ASCII char via a transmitter to a receiver connected to a Raspberry Pi.

It appears Microchip has discontinued support for the PicKit 2. Please recommend another programmer (and maybe an IC) and set of tutorials.
 

Les Jones

Well-Known Member
Most Helpful Member
There are PICs that can be programmed with the PICKit2 that would do what you want. The PIC16F628A is one of them. For later PICs I use a PICKit3. If you want a cheap solution and are prepared to change to one of the Atmel chips such as the ATtiny85 then you can buy cheap programers on Ebay such as this one.

Les.
 

Wp100

Well-Known Member
The PK2 is still a fine programmer, so do not throw it away !
Though not supported, it still does hundreds of chips, just not the very latest ones.

For something just needing a couple of i/o lines look at the 12F675 , its 8 pins and about £1 at most outlets, even Maplins stock it, though at a costly £3

When you last programmed you probably used MPLAB IDE V 7 or 8.nn ? but again there is now MPLABX, however for a simple job you can still download the last MPLAB IDE V8.92
http://www.microchip.com/development-tools/downloads-archive

As for a tutorial, what language did you program in ?
 

MaxHeadRoom78

Well-Known Member
For what you would need to do a small (8 pin) footprint Pic should work, 12F etc, if want to progress to some of the latest IC's, I agree the Pickit 2 was easier to use, but you may have to bite the bullet especially if wishing to take advantage of some of the nice features of later IC's and you are programming in Assembly.
I was forced to go to the 3 but I miss the features of the stand alone program for the 2.
Max.
 

Wp100

Well-Known Member
I and many others in the forum still use Pic Assembly so it should be a simple job to guide you there.

Your project sounds simple enough with a High /Low input sense and a matching character sent out on the Usart to your transmitter (?), though experience has taught that there is often more required ?:)

We just need to know what chip you will use, what your sensor is , analogue or digital and what baud rate you want data sending at.

A 12F675 will need a Software Usart routine but think the smallest (PK2 ) chip with a hardware Usart is the 16f88, both have onboard ADC
 

JonSea

Well-Known Member
Most Helpful Member
Check out Swordfish Basic. It works with PIC 18F-series parts, is easy to use, generates efficient code, and for what you're doing, the SE edition is more than powerful enough and FREE.

Something like an 18F2520 28 pin micro will work great and doesn't have some of the complications of the newer chips. the PICkit 2 will work perfectly with it.
 

granddad

Well-Known Member
Even though I "advanced " to PK3 and PIC24's I still think for a small interface project PK2 and PIC16xxx usually do the job, I found assembler very rewarding , and the MPLAB SIMulator, is great for catching my bugs, not forgetting the PK2 logic tool.
 
Last edited:

MikeMl

Well-Known Member
Most Helpful Member
...If you want a cheap solution and are prepared to change to one of the Atmel chips such as the ATtiny85 then you can buy cheap programers on Ebay such as this one...
Or just Use this Arduino... No programmer required, just a USB cable. Relatively simple to use IDE. Has everything you need, including UARTs, check out the price, especially in qtys of 5 to 10.
 

granddad

Well-Known Member
Check out Swordfish Basic
(Bit of a tangent ) When I worked for a living, we had a chap in H/O by the name of John O'Shea he was a electronic genius , he designed and built an embedded encrypted comms system for banks (X25 packets) Jon every time I see your post i think of him ... sorry for hijack...
 

JonSea

Well-Known Member
Most Helpful Member
A 28 pin to do basically two functions, that an 8 pin can do?
Isn't that a little OTT?
Max.
The poster has been given suggestions of using a PIC16F628, buying an Atmel part and programmer, using assembly language and various PICs from small to large, using an Arduino....the possibilities are unlimited. How much (in terms of money and time) is invested in a cheap part and learning assembly language vs. using a part that costs a few dollars more but can be programmed in an easy-to-learn language very rapidly?

The best solution is what accomplishes the original poster's goal in a way he can handle it. Programming microcontrollers doesn't have to hurt, and people don't have to "pay their dues" and program in the most difficult way possible. As you and others have done, I was offering a possible solution. I'm sorry if it's not an acceptable or practical solution to you but it's something for the OP to consider.
 

ibwev

Member
I really appreciate each response. This is a wonderful forum made up of helpful people.

I and many others in the forum still use Pic Assembly so it should be a simple job to guide you there.
Please recommend a tutorial. I originally used http://www.gooligum.com.au/PIC-Tutorials. Is there a better source?

We just need to know what chip you will use
Since I have had a little experience with the PicKit 2 and it appears other people still use it, I think I am going to attempt to complete my project using PIC16F88.


what your sensor is , analogue or digital
I am going to attempt to make a wireless moisture sensor. I haven't attempted to draw a schematic yet. I am going to attach the PIC in place of the LED in the 3 volt schematic on the following page- http://www.instructables.com/id/Simple-Water-Sensor/?ALLSTEPS. I was thinking about trying to adjust the moisture circuit to operate on 5 volts instead if 3 volts.


what baud rate you want data sending at.
Going by this article http://www.romanblack.com/RF/cheapRFmodules.htm and a suggestion made in this post http://www.electro-tech-online.com/threads/rf-receiver-transmitter.149721/#post-1282303 , I think 110 baud rate.


Thanks in advance for any help.
 

Wp100

Well-Known Member
A lot of point you mention there, so think you will get quiet a few varying views.

Gooligum was a good totally free site, but now charges for many of them.

Probably the other good tutorial is by the forums own active assembly guru Nigel.
http://www.winpicprog.co.uk/pic_tutorial.htm

Plenty of help here to get you going if you cannot get on with tutorials.
The Water sensor , first need to ask if its to be used to gauge the moisture level of soil /potted plants or to detect the actual level of a fluid ?

From what I have read, ( never tried myself) moisture sensors can be very flakey, so you are unlikely to get very accurate long term results.
You might want to look at some of the ready made sensors like this one.
http://www.ebay.co.uk/itm/Moisture-...167151?hash=item1a1167d52f:g:VvQAAOSwGYVXBnGF

Level sensing is easier as there are several ways of doing that.

Those 433mhz modules are very well covered in the forum, assume their range will meet your needs ?

An alternative could be a bluetooth module, range permitting, which means you just plug in a little bluetooth dongle into the pc rather than the need for 2 large boards you need with the 433mhz.
It also has the advantage you can get the Pics data on other devices like your phone.
 

spec

Well-Known Member
Most Helpful Member
And another option- just use an Arduino. Then all you would need would be a PC, a USB lead and an internet connection to download the Arduino development environment (free), and you are set to go.

If you used USB to link the ASCII data, I would guess that you could do the whole thing in couple of hours without touching a soldering iron.:)

You do not say where you are, even in your user profile, but Arduino clones are available from eBay for a £1UK or so: http://www.ebay.co.uk/itm/NEW-UNO-R...62e485f&pid=100033&rk=2&rkt=8&sd=201106261383

spec
 

Wp100

Well-Known Member
Bit of a sucker link there, a far east supplier, the 99p /£1 is for the Bluetooth board, which is in fact just a mininal base board without the main chips.
 

spec

Well-Known Member
Most Helpful Member
Bit of a sucker link there, a far east supplier, the 99p /£1 is for the Bluetooth board, which is in fact just a mininal base board without the main chips.
OK, £3UK for Arduino processor board including post and packing. (just click 'Model').

spec
 

ibwev

Member
Probably the other good tutorial is by the forums own active assembly guru Nigel.
http://www.winpicprog.co.uk/pic_tutorial.htm
I started looking at this tutorial. The initial hardware setup appears to be somewhat challenging but Lesson 0 is very helpful.

The Water sensor , first need to ask if its to be used to gauge the moisture level of soil /potted plants or to detect the actual level of a fluid ?
I am trying to monitor if water is present in an open container. Under normal operation, the container will be dry. When container starts to fill with water, I would like to receive an alert.

Those 433mhz modules are very well covered in the forum, assume their range will meet your needs ? An alternative could be a bluetooth module, range permitting, ......
Unfortunately, bluetooth is not an option due to range. The range of the 433mhz modules will work.

And another option- just use an Arduino. Then all you would need would be a PC, a USB lead and an internet connection to download the Arduino development environment (free), and you are set to go.
Or just Use this Arduino... No programmer required
Please recommend a resource to learn how to use these micro-controllers for Aduino. This also looks like a very good option and may have a little less of a learning curve. Although, initial setup may be a little more pricey since I would need to purchase an Arduino.

You do not say where you are, even in your user profile
I am from Shreveport, Louisiana in the United States.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top