Getting Started w/PIC Microcontrollers - advice, please?

Electronics Computer Programming Q&A
Post Reply
PICmeUp
Posts: 11
Joined: Tue Jul 08, 2008 1:02 pm
Location: New York
Contact:

Getting Started w/PIC Microcontrollers - advice, please?

Post by PICmeUp » Tue Jul 08, 2008 7:32 pm

I am designing and building a remote-controlled filming device (similar to a CAMCAT®) as an independent project at my high-school. I have been working hard on this project for many months, and recently finished debugging the proof of concept. This fully functioning prototype has been used now in filming two stage productions. I am now moving on to version two, which I plan to build around PIC micro-controllers.

v2.0 Description:
Version two of the system will be controlled by the user at a base station by a combination of joysticks and buttons. The station will also include an interface for setup such as channel travel, centering, joystick position vs. motor position curves, and velocity/position control selection, as well as a screen to view the live video signal. Data will be sent wirelessly from the base station to a traveling carriage, where it will be decoded to control the motor drivers. As in the prototype, the carriage will be suspended on taut cables and will hold the camera, electronics, and motors. Power will be supplied through the carrying cables, also as in the prototype.

Question:
Being new to programming micro-controllers, I am unsure quite where to start. I have done extensive programming in VB6, and I am well-versed in electrical engineering. I already own the Microchip ICD 2, and mikroC (www.mikroe.com), and have done good research into development boards. However, each time I search again, I find something new. Because of this, I am still unsure what hardware to get.

I am considering MikroeElectronika's EasyPIC5, but I'm unsure if this will be the best choice. What development hardware would you recommend to a new user who learns quickly? - something that will hopefully continue to be useful for some time, and not exorbitantly priced, as I am doing this project on a shoestring budget.

Thanks in advance!

Charliem
Posts: 1
Joined: Wed Oct 22, 2008 4:42 am
Location: WY,USA
Contact:

Post by Charliem » Wed Oct 22, 2008 4:47 am

Hi Picmeup,

I have a Easypic4 and think its a valuable tool for pic programming. You can't go wrong with the EP5.It supports a vast number of pics and has tons of features.Updates for the picflash software are free. There is a distrubitor there in NY.
http://www.circuit-ed.com/index.aspx

regards Charliem

psycho
Posts: 388
Joined: Thu Jan 10, 2008 8:13 pm
Location: Northwest Indiana
Contact:

Post by psycho » Wed Oct 22, 2008 7:23 am

I have the EasyPic3 and I love it. I also have MikroPascal - which I hardly ever use anymore - switched to Microchip's C18 compiler.

If you don't need any more that a 40 pin uC, the EP5 would be a great choice. If you need more than a 40 pin device, check out the BigPic or check out some of microchip's dev boards - I just picked up an Explorer18 & an Ethernet Pictail card about a month ago. Tho, the Easypic boards can do PIC18's, too.

This may be overkill, but have you checked into the PIC32? You can see an ongoing design challenge at http://mypic32.com - some of the projects are really nice.

Just my $.02
Kevin

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba » Wed Oct 22, 2008 10:26 am

Before anyone buys a programmer, do yourself a favor and take a look at the PICKit2 programmer from Microchip. It's both a programmer and debugger. It programs a truly wide range of PICs and is a decent little debugger. Cost? $35.

I wouldn't buy an integrated programmer/trainer/dev board. In my opinion, it's a big waste of money. For the cost of one of those boards, you can by the pickit2, prototype boards and all manner of peripherals and have a fair amount of change left over.

goner19
Posts: 84
Joined: Wed May 20, 2009 8:15 pm
Contact:

Re: Getting Started w/PIC Microcontrollers - advice, please?

Post by goner19 » Thu Dec 31, 2009 8:46 pm

NOTE: listen to philiba and psycho...youll be glad you did!!!!

psycho
Posts: 388
Joined: Thu Jan 10, 2008 8:13 pm
Location: Northwest Indiana
Contact:

Re: Getting Started w/PIC Microcontrollers - advice, please?

Post by psycho » Thu Dec 31, 2009 9:02 pm

// begin ramblings

Thanks! And, btw, I finally got a Pickit3 (my wife "got it for me for xmas"). It seems OK so far. Why did I get it, you ask? Because the debugging support on the Pickit2 for PIC32's is pretty much non-existant and I am working on a PIC32 project. From what I have read, the PICKIT2 project has been put on the back-burner and they might update it when/if they get around to it. That is what I got out of the comments, anyway.

So, now I use the pickit3 and it pretty much seems just like the version 2 except that it has a PIC24 chip in there (16 bit device). So, later on down the road they can put all kinds of goodies in there if they see fit.

// end ramblings

goner19
Posts: 84
Joined: Wed May 20, 2009 8:15 pm
Contact:

Re: Getting Started w/PIC Microcontrollers - advice, please?

Post by goner19 » Fri Jan 01, 2010 8:09 pm

yeah psycho
i been looking at that pickit3 since we talked way back in july
but have not had the extra cash to pull the trigger
i will when i get back to work later this month (crossing fingers)

i been trying to do a simple input deal where i push a button once than one pattern flashes
and 2 pushes makes another pattern but to no avail

any suggestions?
right now all i can really do is progam chasers and the like
but nothing w a human interface of any kind.

psycho
Posts: 388
Joined: Thu Jan 10, 2008 8:13 pm
Location: Northwest Indiana
Contact:

Re: Getting Started w/PIC Microcontrollers - advice, please?

Post by psycho » Fri Jan 01, 2010 9:05 pm

If the button(s) is(are) debounced, you would want to get the first button press. Note the "time" when it was pressed (i.e. have a 1ms timer running in an ISR and producing a "ticks" variable to count the milliseconds). Then, if the button is released and pressed again in a given number of ticks, you know that there was two clicks. If your given number of ticks passes with no additional button presses, treat the input as a single button press. SO...

1 - set up a 1ms timer interrupt.
2 - have the timer ISR add 1 to the ticks variable each time the interrupt fires. 1000 ticks means 1 second has passed.
3 - when you get a button press, mark the ticks of when it happened. (lets say the ticks variable is 12345 when it was pressed) (buttonpress = ticks or whatever)
4 - if there is no additional button presses in say, 1000 ticks (the ticks variable would then = 13345), then run your single button code.
5 - if there was another button press between ticks = 12345 & 13345 then run your two button press code.

Hope it helps!
Kevin

goner19
Posts: 84
Joined: Wed May 20, 2009 8:15 pm
Contact:

Re: Getting Started w/PIC Microcontrollers - advice, please?

Post by goner19 » Fri Jan 01, 2010 9:59 pm

yeah kevin,

the concept makes perfect since...
but....
whats an ISR?

=/

psycho
Posts: 388
Joined: Thu Jan 10, 2008 8:13 pm
Location: Northwest Indiana
Contact:

Re: Getting Started w/PIC Microcontrollers - advice, please?

Post by psycho » Fri Jan 01, 2010 11:33 pm

ISR = Interrupt Service Routine. You setup the timer to trigger an Interrupt. Every time the timer reaches 0, the processor will fire an interrupt (provided that interrupts are enabled). When the interrupt is fired, the processor will switch control to an ISR (which you have to write). Note that there are many different interrupts that can occur depending on what PIC (or microcontroller, in general). For instance, some PICs have an interrupt-on-change ability - This will trigger an interrupt if the state of a pin goes from hi to low or low to hi. Not all PICs have this and not all pins have it, either. You can find sample code and alot more info on the net about it.

Kevin

goner19
Posts: 84
Joined: Wed May 20, 2009 8:15 pm
Contact:

Re: Getting Started w/PIC Microcontrollers - advice, please?

Post by goner19 » Sat Jan 02, 2010 9:14 am

hey kevin,

thanks again....
ill do some homework and see if i can figure out ISR's

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests