PDA

View Full Version : Wanna write my own Pic code!


gbarc
Oct 14, 2004, 07:36 AM
Hey! Whats a good book for information on how to write your own PIC codes?




Greg

epilot
Oct 14, 2004, 07:47 AM
Take a look at the books by Myke Predko (do a search on Amazon.com)

Michael

blue_bull
Oct 14, 2004, 08:06 AM
This book is very often recommended. I do not know it.
http://www.sq-1.com/emtoc.html

Herbert

Bob Blackburn
Oct 14, 2004, 08:08 AM
There is no fast way!

But lots of keyboard time and 12 months will get you started!

I have been at it for 10 years and I am still learning!

Microchip have a lot of helpful stuff on their website: microchip.com

They do a range of pdf files that show you how to do pretty much anything even brushless controllers!

blue_bull
Oct 14, 2004, 08:14 AM
Bob Blackburn, I agree with you. PIC programming is not an easy thing. And there are many traps you can step in with the different types of PICs.

Pete P.
Oct 14, 2004, 08:25 AM
MAybe I should gte my hands on it, but I have no access at all to a PIC programer or PICS, other than online. I am a programmer, I know about 10-12 different languages fluently....Anybody know of a PIC emulator? Does one exist? If not, then I'm out.

Dave Wulff
Oct 14, 2004, 09:23 AM
Pete,

MicroChip sells a PIC programmer kit with everything you need in one package. I got mine at DigiKey for $35, they include a PIC to practice on and all the software. At that price there is no reason to avoid working with PICs, but writing your own code from scratch is another story. There are a lot of files available, like the ones from Koichi, depending on your project.

Dave

gbarc
Oct 14, 2004, 09:33 AM
I just want to write a simple program for a Two channel IR RX/TX. Throttle and rudder thats it...no more no less. I have very simple schematics...no code. Need help!


Greg

Dave Wulff
Oct 14, 2004, 09:51 AM
Greg,

Why re-invent the wheel. Koichi has done all this for you, Billy has the codes on his website. It has elevator control, but no nee to hook it up, just ignore it.

Dave

gbarc
Oct 14, 2004, 10:27 AM
True. But i have schematics based on Sergio Zigras designs. Thought it would be kinda neat to do.


Greg

Dave Wulff
Oct 14, 2004, 10:31 AM
Greg,

Sergio is very active, I am sure the circuits are good if the components are not outdated. Maybe somebody in contact with him will ask if he will make his code available. But honestly, nostalga aside, Koichi's work uses all the latest PIC's and it is all well proven, along with PCB masks. It is like a kit without the parts, tough to beat IMHO. I will shut up now. :)

Dave

gbarc
Oct 14, 2004, 10:37 AM
Thats a very hard point ta beat Dave. As a matter of fact i've already have parts on order for Koichi system. I'm crazy...but not that crazy;)


Greg

Bob Blackburn
Oct 15, 2004, 07:24 AM
I have just finished a preliminary version of what you describe and it is not something you can do without knowing the internals of the pics quite well. (A little electronics experience wouldn't go amiss either)

I agree with the why re-invent the wheel but I wanted to have more channels output by the pic. Which I have managed, for a project other than thr, rudd, aileron.

Pete P.
Oct 15, 2004, 09:16 AM
That PIC Kit sounds nice! I'll have to pick one up, as soon as my budget allows (read: Christmas)!
I wish Zigras IR stuff was still available. I emailed him a while back requesting some, and he never responded. Anybody know about the CapRX on the Aeronutz site? That's a very simple one indeed!

clipclop
Oct 15, 2004, 09:23 AM
Bob ,
Have a look here at Darkiths work , he has a 4ch opption in his code as well as 2 esc's for heli use .:- http://darkith.dyndns.org/~darkith/html/ir.shtml
code is compatable with Koichis to !!
Stewart

Bob Blackburn
Oct 15, 2004, 02:30 PM
Clipclop
The link didn't work!

Mine does all eight channels
any of which could be speed controllers ( or all :-) )
or actuators (requires two io lines)
is currently driving 80 ohm actuators direct from pic io
and it will support ir

Cirip
Oct 15, 2004, 05:17 PM
Hi,

Just a few comments.
A PIC programmer is extremely easy to DIY. It's a couple of hours of work at most.

MPLAB IDE provided by Microchip includes a simulator with external stimuli capabilities. I wrote my own program to connect a Hobbyzone ABC remote control to FMS. Before actually burning the chip, I've created stimulus files that mimic the remote control signals and extensively simulated the program. When I burned the chip, the only error I had to correct was the USART speed and then it worked righ away.

But, I agree, the learning curve for someone with no previous experience with micros might be steep. For those who have had some exposure it's just another micro.

Cirip

clipclop
Oct 15, 2004, 10:05 PM
Bob,
Try this link :- http://darkith.dyndns.org/~darkith/html/ir.shtml <- works for me ok .
Sounds like you have the pic down pat Bob.
Cirip,
I think your coment about the learning curve is correct , for most of us the micro is a tiny magic box .
I must take the time to work through the basics so I can get around how they think .
Stewart

ZAGNUT
Oct 16, 2004, 06:23 AM
here's a very good tutorial on pics that really helped me understand a lot. http://www.amqrp.org/elmer160/lessons/

if anybody has some more please post them too


dave

darkith
Oct 16, 2004, 09:59 PM
Clipclop
The link didn't work!


Heh, my wifi router has decided to play games, and sometimes goes down for a little while...shrug. Probably replace it with a linux box when I move in 2 weeks.

The code I have up isn't that special...but it's decently commented (I think it is, anyway...), and might make a good starting point for tinkering/modifications if you want to work in assembler.

Cheers,
D.

OmegaDot
Oct 18, 2004, 12:29 PM
I too recommend the book by M. Predko. Mine came with a bare PCB for the "EL Cheapo" programmer which seems to work fine. Parts to populate the programmer are only a few $. Also, there are numerous example programs on CD-Rom and a somewhat dated version of MPLab included. Latest MPLab is a freebie download from Microchip.

Yes, there is a learning curve, but it opens up a whole world of possibilities.