PDA

View Full Version : L.e.d



Marty
- 17th October 2007, 20:59
Hi, i go to college and my teacher randomly said make a circuit containing L.E.D and micro-controllers. However i have no idea how to program a micro controller an i don't have any softwares to do this. Can anyone give me some advise please?

mackrackit
- 18th October 2007, 00:00
Is this an electronics class?
Does your school have a programmer?

Goto microchip.com and download MPLAB (free), but you will also need some parts and a programmer.

Marty
- 19th October 2007, 10:41
Which Mplabs should i get because there are several downloads available to download from

Marty
- 19th October 2007, 11:23
Hi, i have downloaded MPlabs (the correct one) but i have no idea on how to use it.
Can anyone help?
Thanks

mackrackit
- 19th October 2007, 13:03
Most of the information needed is in the help file, but I know it can be daunting the first time through.

So to better help you.
What programming language do you plan to use?
What are you planning for a programmer?
What PIC chips do you have available?

Marty
- 20th October 2007, 13:17
I prefer English
Well i am planning to make an electronic game where a button is pressed and L.E.D flashes and create a pattern and the micro controller controls which ones to flash
I don't know which Microchip is the best though.
thanks

mackrackit
- 20th October 2007, 16:10
I prefer Englishfunny
The closest thing to English I know of is PIC BASIC, so you are in the right place.

Your project is a good one to work up to, but you need to start with one LED blinking, add a button and so on.

There are several chips that would work, I will recommend the16F676. This chip has an internal oscillator, ADCs, comparators, and I think pretty cheap. The data sheet is only 130 pages:D

Now, what about a programmer? Do you or your school have one? (not a person, a device:))

nomad
- 20th October 2007, 17:54
dont forget you can get free samples from microchip website. something like 2 or 3 each of 3 different types. stay away from the cheap ebay jdm programmers if at all possible. they look like a good deal but aside from learning the hard way not worth the 10 bucks i saved.

nomad
- 20th October 2007, 18:00
oh and i'd probably start with a 16f628a or similar. the simpler the better for starting out.

Marty
- 21st October 2007, 10:46
No my school is a Noob they don't have anything.
Which programmers would you recommend?
Thanks

mackrackit
- 21st October 2007, 11:02
I woud go with the PICKIT2 Starter KIt http://www.microchipdirect.com/ProductDetails.aspx?Catalog=BuyMicrochip&Category=Getting%20Started%20Programmers&mid=1&treeid=6&lmid=602

And here is how to make PIC BASIC work with MPLAB http://www.melabs.com/support/mplab.htm

Marty
- 10th November 2007, 13:33
I got some idea on how to use basis but i don't exactly knoq how to program the process i want.

Also the microchip you recommended for me '16F676' is good but i couldn't find out how many pins and inputs it has. Can you help me please?

Thanks you :)

mackrackit
- 10th November 2007, 15:44
Hi Marty,

Have you got PIC BASIC yet? and a programmer?

Go to Micro Chip's web site for the data sheet and read it. The data sheet tells everything about every pin on the chip.

To make a LED blink :


LOOP: 'label
HIGH PORTC.5 'makes the pin output a positive voltage
PAUSE 100 'will pause for 100 milli seconds
LOW PORTC.5 'makes the pin zero voltage
PAUSE 100
GOTO LOOP 'starts over

Darrel Taylor
- 10th November 2007, 19:53
Hi Marty,

Since the assignment didn't specify PIC's as the microcontroller. And since it's such an easy project...

I think you'll be much happier using a Basic Stamp.
No programming hardware required (other than your computer).
No messing with oscillators and config settings and analog pins and ... and ... and ...

Many people here started out with Basic Stamps, Me included.
None of them will ever go back to Stamps after using PIC's, but it's a MUCH better place to start.

You'll have it up and running the first day or 2.
With PIC's It might be a Week or 2.

http://www.parallax.com
<br>

Marty
- 28th November 2007, 20:05
Hi i have got all the items i need to create my project but i do not know how to use BASIC and i've researched how to do it but i found nothing. Can anyone help me?
Also is there any 32 pin microchip with 16 outputs?
Thanks

mackrackit
- 28th November 2007, 20:15
Are you going to use a Basic Stamp or a straight PIC chip.

BrianT
- 29th November 2007, 08:29
For the lowest cost system, have a look at the PickAxe. It is very similar to the Parallax Stamp but much cheaper, at least downunder. There are plenty of examples and the entire system can cost as little as $45. Additional PicAxe chips are $10 - $45. Available from many places. Here is one to start.

http://www.microzed.com.au/18pin.htm

HTH
Brian

Marty
- 3rd December 2007, 18:52
Hi i am not going to use BASIC Stamp because i already got one similar to it but now i need a pic with at least 16 outputs and i found several but there are quite expensive so i thought about connecting one of the outputs of a pic with an input of another pic.
Would this be possible?
Thanks

mackrackit
- 3rd December 2007, 19:24
You could do that, but for a first project it would be a nightmare.

Go to microchip.com and look at their sample program. They give free samples!

I would point you to 16F877A for starters.

CocaColaKid
- 3rd December 2007, 20:11
The 16F877A is a nice start is rather friendly. I personally like the 18F series though. I find they are easier to configure. At least for selecting the ADC ports.

GrandPa
- 3rd December 2007, 21:47
Marty,

I STRONGLY suggest you to go with Picaxe chips. Much easier to start with and most of what you will learn will be usefull if you later want to 'upgrade' to picbasic. I DID IT and enjoyed it.

You will be able to do almost everything you can do with picbasic too, but it's not as fast because the program is interpreted instead of being compiled (no hex files). On top of that you will NOT need to pay for a compiler and you don't need a programmer (hardware) either. And you know what, a picaxe is just a microchip PIC with a bootloader and an interpreter!

Look at their forums, they are very friendly with newbies.
http://www.picaxeforum.co.uk/

J-P

nomad
- 3rd December 2007, 22:05
Go to microchip.com and look at their sample program. They give free samples!


thought I already mentioned that. lol

mackrackit
- 4th December 2007, 01:13
thought I already mentioned that. lol
Yup, but when the high cost was mentioned I figured it needed said again.

Marty
- 22nd December 2007, 11:35
Hi, my electronic teacher has suggested me to connect 2 pic's together but i don't have a clue how to. Can someone help me please

mackrackit
- 22nd December 2007, 11:49
You can hook two PICs together with some sort of serial communication but again for a first project I would not recommend.

The basic idea is to send a command from PIC#1 to PIC#2. When PIC#2 receives a command it will execute an operation. The manual tells how to get started with serial comms.

Have you blinked a LED with one chip yet?

Marty
- 23rd December 2007, 12:35
Yes i want control over around 16 L.E.Ds but i cannot find a pic with 16 outputs so i thought connecting 2 pic together would be a better solution. Which command should i send from pic 1 to pic 2?
Thanks

mackrackit
- 23rd December 2007, 14:20
Marty,

For your first project I strongly recommend using just one chip. There are plent of PICs with 16 and more IOs.

The 16F877A-I/P would be a good one to start with. At least I like it. 33 I/Os.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1335&dDocName=en010242
But if you look here you can find others. Just make sure your programmer will support it. And get something in the "F" , 16Fxxxx. These are flash memory.
http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=1002&mid=10&lang=en&pageId=74

If you still want to use two the send part would look something like this.


SEROUT PORTC.4,T2400,[9,3] '9 is the character the receiving
PIC is waiting for, 3 is the command


The receiving code


SERIN PORTC.4,T2400,[9],net 'when 9 is received the next
character is written to variable "net"

IF net = 3 THEN Do something


Here is a simple example of how to control more LEDs than you have pins.
http://www.mackrackit.com/mac/www/dave/LED/LEDs.html

Marty
- 13th February 2008, 20:14
Hi, i want to buy the micro controller - pic 28x but i don't know its code name (e.g. PIC 16F87X) can anyone tell me its name please?
Also i need to programme my pic after i've purchased it but i can't find any resources to help me learn to programme it. Can anyone suggest a good source which could help me pleasE?

Thank you very much! :D

mackrackit
- 14th February 2008, 08:14
Hi Marty,
Are you still working on that school project? If it is finished, how did it go?

I am not sure what you mean by 28x, do you want a chip with 28 IOs?
In the previous post on this thread several chips were recommended, if you can give some detail of the planned project we can help you choose a starter chip. But again, all of the ones recommended are good for starters and will also be good for more advanced projects in the future.

A good source for learning? When (if you do not have it yet) you get you copy of PIC BASIC, the manual has example code for all of the commands. There are more examples on MELABS web site, and I like www.rentron.com also.

Most of all, hang out on this forum and follow the questions and answers from others, some of the topics may not be clear at first, but sooner or later they will.

skimask
- 14th February 2008, 17:30
I am not sure what you mean by 28x, do you want a chip with 28 IOs?

Maybe the SX28 from Scenix/Ubicom?

mackrackit
- 14th February 2008, 17:36
Maybe the SX28 from Scenix/Ubicom?

Never heard of it :D

skimask
- 14th February 2008, 17:41
Never heard of it :D

Really? You serious?
I love them for those quick and dirty fast jobs...especially those older 75Mhz parts...work great as a multi-channel 555 replacement type thing.

mackrackit
- 14th February 2008, 17:46
Really? You serious?
I love them for those quick and dirty fast jobs...especially those older 75Mhz parts...work great as a multi-channel 555 replacement type thing.

Yeah, I have used them, I was being a smart _ _ _ :)

skimask
- 14th February 2008, 17:47
Yeah, I have used them, I was being a smart _ _ _ :)

I kinda figured, but wasn't 100% sure...
Sometimes ya just don't know for sure...

Marty
- 14th February 2008, 20:09
the pic im after is '' www.rev-ed.co.uk/picaxe/images/picaxe28x.jpg ''

Im in the process of soldering my components in but my school doesnt provide a 28 pin pic so i need to purchase it myself.

Thanks for the website but is there any more simplier sites that just tells you what code does what?

Thank you :P

skimask
- 14th February 2008, 20:34
the pic im after is '' www.rev-ed.co.uk/picaxe/images/picaxe28x.jpg ''
Im in the process of soldering my components in but my school doesnt provide a 28 pin pic so i need to purchase it myself.
Thanks for the website but is there any more simplier sites that just tells you what code does what?
Thank you :P

That isn't a PIC, that's a PICAXE, something similar but different than what this forum deals with primarily.
As far as simple goes, you can't get much simpler than a PICAXE, except for maybe a BASIC stamp..or maybe LOGO on an Apple IIe.

That website (http://www.rev-ed.co.uk/picaxe/) practically leads you by the hand from purchase to first ready made finished program, both software and hardware.

Marty
- 15th February 2008, 13:38
What is the difference between a pic and a picaxe? I've already started my circuit with that picaxe so i can't change it but il build some other ciruits with a pic in the future.

By the way, people in this forum are electronic engineers and not other engineers right?

Thank you

skimask
- 15th February 2008, 18:16
What is the difference between a pic and a picaxe? I've already started my circuit with that picaxe so i can't change it but il build some other ciruits with a pic in the future.

PIC = standalone microcontroller, comes from the factory blank, no code, does nothing. Call it a dumb blonde standing in a desert...she's capable of a lot, but doesn't have any instructions or anything to do, or any common sense (that's a stretch :) )

PICAXE = standalone microcontroller which is pre-programmed with a basic set of instructions which act on code downloaded to it's internal eeprom and runs that code according to it's program in flash. (back to the dumb blonde --- ) Call this one a blonde with a job assembling something, or coaching a game, or directing traffic.

You can yell at the dumb blonde all day and not get anything accomplished because she doesn't know anything.

You can yell at the blonde with a job to do something different because she's got directions.

You can make a PIC into a PICAXE by programming it with the core code... (give the dumb blonde some direction and a job)... Or make the PIC into something resembling a PICAXE by giving it a completely different job like lighting up some lights or something...i.e. writing your own program.

You can make a PICAXE into a PIC by erasing it completely... (fire the dumb blonde and drop her off in the desert)... Or make the PIC into something resembling a PIC or a PICAXE by giving it a completely different job like lighting up some lights or something...i.e. writing your own program.

See where the similarities are?


By the way, people in this forum are electronic engineers and not other engineers right?
Not neccessarily... I ain't got no degree in nothing... (good grammar eh?)

Marty
- 16th February 2008, 10:49
Lol i thought people here would be all professors etc... maybe its just you? Joking :P

i've got 1 more question and that is if i buy a PICAXE 28 ( Noobie stuff) do i have to buy the programmer which is '' PICAXE 28x starter pack '' or can other programmers to program it?

Have you anyone got examples of BASIC they could show me because i know some of the codes but im not sure how to apply it... :(

Marty
- 25th February 2008, 18:58
Heyy i've almost completed my project now but i need to buy an ABS box to fit my PCB inside to make it look like a electronic game. Does anyone know where i may be able to buy them? I need them to be around 140mm by 140mm or bigger.

Thanks! :P