+ Reply to Thread
Page 1 of 2
1 2 Last
Results 1 to 15 of 16

Thread: Novice looking for help

  1. #1
    StGeorge Newbie
    Join Date
    Nov 2009
    Posts
    7

    Novice looking for help

    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. #2
    shokjok Newbie
    Join Date
    May 2008
    Location
    Alberta, Canada
    Posts
    255

    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. #3
    StGeorge Newbie
    Join Date
    Nov 2009
    Posts
    7

    Quote Originally Posted by shokjok View Post
    Are these LEDs individual, or in a matrix?
    They are individual LEDs.

  4. #4
    jimmythefool Newbie
    Join Date
    Nov 2007
    Location
    UK
    Posts
    143

    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

  5. #5
    StGeorge Newbie
    Join Date
    Nov 2009
    Posts
    7

    Thanks for the info Jim, much appreciated.

    If I get this is it the same product with the board you indicated included with it?

  6. #6
    colin55 Newbie
    Join Date
    Feb 2009
    Location
    Melbourne Australia
    Posts
    1,457

    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. #7
    Mr RB Excellent Mr RB Excellent Mr RB Excellent Mr RB Excellent Mr RB Excellent Mr RB Excellent Mr RB Excellent
    Join Date
    Jul 2008
    Location
    Out there
    Posts
    1,753

    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. #8
    StGeorge Newbie
    Join Date
    Nov 2009
    Posts
    7

    Quote Originally Posted by Mr RB View Post
    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.
    Sorry, I'm new to this

    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. #9
    Help us help you blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent
    Join Date
    Jan 2007
    Location
    Toronto, Canada
    Posts
    10,565
    Blog Entries
    5

    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.
    Bill
    Smart Kits build Smart People

    http://www.blueroomelectronics.com/

  10. #10
    superfrog Newbie
    Join Date
    Oct 2009
    Posts
    45

    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. #11
    StGeorge Newbie
    Join Date
    Nov 2009
    Posts
    7

    Thanks for all the advice and information, I think I'm heading up the learning curve now.

  12. #12
    jimmythefool Newbie
    Join Date
    Nov 2007
    Location
    UK
    Posts
    143

    Quote Originally Posted by StGeorge View Post
    Thanks for the info Jim, much appreciated.

    If I get this is it the same product with the board you indicated included with it?
    Yep, thats the one
    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

  13. #13
    StGeorge Newbie
    Join Date
    Nov 2009
    Posts
    7

    OK, I've got the basic programming (that's a small 'b', I've done it in assembly ) worked out and have ordered some bits to build a more complete prototype of what I want, with extra LEDs.

    Jim, you suggested that I can program the PIC in circuit using the PICKit 2 programmer. Looking at the way it's connected on the demo board I just need to connect Vss, Vdd, RA0, RA1 and RA3. Will it be OK if I have things connected to these pins or do I need to isolate them in order to program the chip properly?

    TIA...
    Last edited by StGeorge; 25th November 2009 at 09:52 PM.

  14. #14
    colin55 Newbie
    Join Date
    Feb 2009
    Location
    Melbourne Australia
    Posts
    1,457

    do I need to isolate the programming lines in order to program the chip properly?
    The programming lines need to be "lightly loaded" so that the programming can produce a "HIGH." If you have a LED connected to any of the outputs, you will see it flash during programming.
    It is especially important to keep the Vpp line lightly loaded so that the full 13.5v will be detected by the chip.
    This is all covered on the link I gave previously, so it is plainly obvious that you have not taken the trouble to do any reading yourself.
    Last edited by colin55; 25th November 2009 at 10:04 PM.

  15. #15
    smanches Excellent smanches Excellent smanches Excellent smanches Excellent smanches Excellent
    Join Date
    Mar 2009
    Location
    Oregon, USA
    Posts
    831

    Try to read the program off the chip first. If these were hand programmed, they might not have the CodeProtect bit enabled. It'll be all assembly, but you should be able to decern something from the code.

+ Reply to Thread
Page 1 of 2
1 2 Last

Similar Threads

  1. Novice needs help with power
    By NickK1066 in forum Electronic Projects Design/Ideas/Reviews
    Replies: 4
    Latest: 8th February 2009, 02:40 AM
  2. Help for a complete novice
    By DAGONITWIT in forum Electronic Projects Design/Ideas/Reviews
    Replies: 26
    Latest: 27th September 2008, 04:43 PM
  3. Novice..please Help!!!!
    By Anurag_Singh in forum Micro Controllers
    Replies: 11
    Latest: 17th February 2008, 11:16 PM
  4. Novice needs help
    By Trevor Rymell in forum Electronic Projects Design/Ideas/Reviews
    Replies: 13
    Latest: 22nd April 2006, 02:10 PM
  5. Any Expert to help this novice
    By Raheem in forum General Electronics Chat
    Replies: 3
    Latest: 11th May 2003, 11:36 PM

Tags for this Thread