![]() | ![]() | ![]() |
| |||||||
| Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution. |
![]() |
| | Tools |
| | #1 |
|
Hi all, I'm looking for some advice here. I used to be an electronic engineer but left the industry in 1992 to take up a career in IT so I have forgotten most of what I used to know. And anything I do remember is obsolete ![]() A colleague of mine has a requirement for some electronic expertise and as I am the only 'technical' person he knows, he's turned to me. The requirement is to control a number (up to 20ish) of small LEDs and program them to flash at varying intervals (each LED needs to flash with a different interval). He has a circuit which someone made for him a few years ago (the creator has sadly passed on) and it consists of 2 PIC16LF84A controllers. I know nothing of these controllers and am wondering if: a) Can I reverse engineer the programs on these controllers to get an idea of what is required b) What tools do I need for the above and also to program new controllers c) Are these controllers still available d) Am I going about this the wrong way and is there an easier way to do this nowadays Sorry for the long post but hopefully it all makes sense. Any and all information/advice will be gratefully received. | |
| |
| | #2 |
|
Reference suggestions: Go to Datasheet & Application Note Database, PDF, Circuits, Datasheets | Datasheet Archive to see if there is data on the PIC. Multiple RC flasher circuits can feed the PIC input port, with a coding program to read each input and feed an output port. You can use 555, logic gate circuits, or electronic circuits from microwaves. Are these LEDs individual, or in a matrix? | |
| |
| | #3 |
| | |
| |
| | #4 |
|
George, That microcontroller is pretty much obsolete these days. If you want to have a go at learning microcontrollers, have a look at this.. MICROCHIP|PG164120|PROGRAMMER, PICKIT 2 | Farnell United Kingdom You will need the Low Count Demo board too. Jim | |
| |
| | #6 |
|
Look at Talking Electronics website under: Elektor,EPE,Silicon Chip and it will show you programs to help you with what you are wanting to do.
| |
| |
| | #7 |
|
What do the LEDs do? What are the intervals, and are the LEDs on 50:50 duty or a small ON period and long OFF period? If you provide more information its much easier for people to help you. | |
| |
| | #8 | |
| Quote:
The LEDs will be used at wildly varying intervals. For instance if I have a circuit with 10 LEDs 2 may be flashing at 1s on, 3s off. Another may be 250ms on, 250ms off. Some others could be 2s on, 500ms off. They will vary that much and more but within each circuit a specific LED will always flash with the same interval. I assumed that if I can write a program to control 10 (or more) LEDs then I can have standard routines for the on and off cycles and just insert them where necessary. However, I do know assumption is a dangerous thing | ||
| |
| | #9 |
|
IMHO the easiest programming language to learn for a beginner is BASIC, and an excellent free student edition for the 18F series PICs is Swordfish BASIC SE. Blinking LEDs would only take a few lines of code. | |
| |
| | #10 |
|
You will most probably be dealing with a timer interupt, and a bunch of counters. Supposing each led has a static behaviour You shall finish with something like (in mostly correct C99) #define NUM_LED 10 #define DELAY_TYPE unsigned char const DELAY_TYPE tOn[NUM_LED]{...values...}; const DELAY_TYPE tOff[NUM_LED]{...values...}; DELAY_TYPE counter[NUM_LED]; bool status[NUM_LED]; timerISR() { //deal with the interupt stuff //insert a sub counter here if you need longer ticks than the one your mcu can provide //as in if(counter--) return; else counter = divider; for(int i=0; i < NUM_LED; i++) { if(status) counter[i]--; else { counter[i]=(status?tOff:tOn)[i]; status[i] = !status[i]; } } // deal some more with some interrupt related stuff here if needed } Plenty of optimisation to be done in there, but the question in the end is always, can you really be bothered if it works. In real life, the status array would most likely be the output buffer registers for your mv ports, and hence would be bit packed. I could see how you would get more generic, but you would waste an awful lot of ressources to do so. Last edited by superfrog; 17th November 2009 at 04:43 PM. | |
| |
| | #11 |
|
Thanks for all the advice and information, I think I'm heading up the learning curve now.
| |
| |
| | #12 | |
| Quote:
![]() Its a cheap solution to get going with. If you order some 2.54mm header strip too, you can knock up any project you like on a breadboard, and use the header strip to program the PIC in circuit Jim | ||
| |
|
| Tags |
| novice |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| Novice needs help with power | NickK1066 | Electronic Projects Design/Ideas/Reviews | 4 | 8th February 2009 02:40 AM |
| Help for a complete novice | DAGONITWIT | Electronic Projects Design/Ideas/Reviews | 26 | 27th September 2008 04:43 PM |
| Novice..please Help!!!! | Anurag_Singh | Micro Controllers | 11 | 17th February 2008 11:16 PM |
| Novice needs help | Trevor Rymell | Electronic Projects Design/Ideas/Reviews | 13 | 22nd April 2006 02:10 PM |
| Any Expert to help this novice | Raheem | General Electronics Chat | 3 | 11th May 2003 11:36 PM |