1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

YAY!!!!!! I got my first LED to blink!

Discussion in 'Microcontrollers' started by Marks256, Apr 6, 2008.

  1. Marks256

    Marks256 New Member

    Joined:
    Jul 14, 2006
    Messages:
    2,350
    Likes:
    9
    Location:
    Minnesota, USA
    I'm just excited...

    It took me an hour and a half to get MPLAB working (it kept complaining...)

    I used a PIC16f877A and bill's "hello world" poster.

    :D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D
     
  2. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    Three thumbs up !
     
  3. Krumlink

    Krumlink New Member

    Joined:
    Aug 10, 2007
    Messages:
    2,080
    Likes:
    20
    Location:
    Michigan, USA
    Congratulations!

    Your next project is to connect it to a LCD and a 1 Wire interface to communicate with a RS232 Port :p

    (I dunno what I said)
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. BeeBop

    BeeBop Active Member

    Joined:
    Dec 22, 2005
    Messages:
    1,281
    Likes:
    23
    Location:
    Vancouver Canada

    WOW, finally! :D
     
  6. jbarnaby2000

    jbarnaby2000 New Member

    Joined:
    Nov 20, 2006
    Messages:
    57
    Likes:
    0
    Location:
    Rio Rancho, NM
    shoot...that is cool dude.... maybe reading some switches would be a better second step don't you think??
     
  7. art-666

    art-666 New Member

    Joined:
    Dec 6, 2006
    Messages:
    14
    Likes:
    0
    or an LCD to a 10F206:D :D :D
     
  8. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Your first program is always exciting. What was MPLAB complaining about?
     
  9. Salgat

    Salgat New Member

    Joined:
    Nov 23, 2007
    Messages:
    195
    Likes:
    7
    Location:
    Michigan, US
    Interfacing with a LCD is a good suggestion. Try a 2x16 character LCD. Extremely easy to interface with, and is a very rewarding step up from LEDs.

    http://www.geocities.com/dinceraydin/lcd/index.html
     
  10. Marks256

    Marks256 New Member

    Joined:
    Jul 14, 2006
    Messages:
    2,350
    Likes:
    9
    Location:
    Minnesota, USA
    Nah, the next step is to see if i can make it blink on my own... :)

    It would be nice if i had a tutorial, though... :eek: (free...)

    Most of it was my fault...
    First i had my ICD2 plugged into Com2, instead of Com1. Then MPLAB found it on it on com2, and decided to use it. I didn't have FIFO disabled on Com2. Once i switched ports, it connected fine, but then i couldn't figure out why it would download the program, but wouldn't run... Then i realized i didn't build all. Next it complained because when i copied out of the PDF, it didn't copy the tabs, so i had to put those in... Then it errored out because the file path was longer than 62 characters (wtf!?)

    But after that, it blinked... Then i had to go to work... :(


    Yes, i know i have asked this MANY times before, but can someone point me to a good PIC tutorial. I only have 16f877a's, 16f84a's, and 16f887's...

    I would do nigel's tutorials, but i don't have that PIC (and i am too lazy to get more free samples...)
     
  11. Gayan Soyza

    Gayan Soyza Active Member

    Joined:
    Oct 23, 2006
    Messages:
    1,821
    Likes:
    19
    Location:
    Colombo
    Interfacing LCD is nothing! Better learn how to use inbuilt modules.So you can apply the modules & measure something & can show in your displays.
     
  12. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Well an LCD is much more complex than an LED, but you're right. Learn the chip from the inside out. Lots of neat stuff in there. I would try a pushbutton next, denouncing one can be an interesting experiment.

    Marks256 since you're running an ICD2 try to modify the program as suggested in the poster to use the debugger. It's an incredible tool and will make learning the PIC much easier.

    Tell me what would you want to do next? Perhaps I can find a tutorial. Two LEDs? A buzzer, motor, pushbutton, relay? What would interest you?
     
    Last edited: Apr 6, 2008
  13. Gayan Soyza

    Gayan Soyza Active Member

    Joined:
    Oct 23, 2006
    Messages:
    1,821
    Likes:
    19
    Location:
    Colombo
    Oh yes I also caught to this debouncing trap when I started PICs.Its real interesting.

    I have seen in many basic PIC courses contains this sections.Finally all courses does the same.Data sheet has half of them :D

    *Turn on a led
    *Blink a led introducing (delays)
    *Led moving both sides (left & right)
    *Press SW to toggle the led (introduction to debounce)
    *driving SSD (introduction to multiplex)
    *indirect addressing (ex shows how to clear the ram in a bank)
    *interrupts (using TMR0 as an first example)
    *Introduction to AD (shows how to setup AD channels & how get a sample)
    *PWM (introduce to fade a LED)
    *DC motors (taking a stepper as an example)
    *LCD (8 bit mode) – (shows hello world in the display)

    Very few courses dealing with advanced techniques or they continues the rest of the methods in their advanced courses.
     
    Last edited: Apr 6, 2008
  14. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,019
    Likes:
    317
    Location:
    Brisbane Australia
    Here is an online book that is excellent.

    Mike.
     
    • Like Like x 1
  15. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    Jumping from getting the the HELLO WORLD poster ASM working to a LCD is a very large leap.

    First you need to pick a language. Then start with getting a single LED to turn on. Work you way up.
     
  16. BaCaRdi

    BaCaRdi Member

    Joined:
    Apr 7, 2008
    Messages:
    233
    Likes:
    2
    Location:
    Hoboken / NYC
    I love ME, I have their EasyPic5 Protoboard, and it is the mother of all pic boards I have to say! I also enjoy their high-level compilers, specifically pascal. They have a lot of good stuff I have to say.

    -BaC

     
  17. Marks256

    Marks256 New Member

    Joined:
    Jul 14, 2006
    Messages:
    2,350
    Likes:
    9
    Location:
    Minnesota, USA
    Well, i would like to start with C. yes, yes, i know i should start assembly, but i would like to get some uC applications working, so i know i can use them. Plus i already know most of the basics of C, so it would be easier for me... Then i would like to learn asm, of course.

    I am not sure what i will do next. When i learn a programming language, i learn from example, then i hack the examples to do other things. that is how i learn. I can't seem to find very many C tutorials for PICs on the net. And the ones i do find only show one example for the whole tutorial. I like to take code, cut and paste, and then modify. As i said before, that is how i learn.

    I guess if i had to, i would be willing to pay a bit of money (paypal) for a good tutorial. Maybe even a kit or something.

    I have a few awesome project ideas that i would like to start working on, but they involve microcontrollers, so i am open to ideas.

    ;)


    THANKS FOR THE LINK POMMIE! :) It looks pretty good. I may just start there if i can't find anything else. ;)
     
  18. Marks256

    Marks256 New Member

    Joined:
    Jul 14, 2006
    Messages:
    2,350
    Likes:
    9
    Location:
    Minnesota, USA
  19. Krumlink

    Krumlink New Member

    Joined:
    Aug 10, 2007
    Messages:
    2,080
    Likes:
    20
    Location:
    Michigan, USA
    OMG I HATE THE 62 CHAR LIMIT!!

    Why do they even have that in there? I just made a folder directly on the C drive, since it then goes:

    C:\Project\38khz.c

    short and sweet :p
     
  20. BeeBop

    BeeBop Active Member

    Joined:
    Dec 22, 2005
    Messages:
    1,281
    Likes:
    23
    Location:
    Vancouver Canada
    I would take one of Bill's over the mikroe ones, any day! Much better prices, and also, Bill is trying to help people learn, rather than protect his market. As well, mikro C seems to want you to use their libraries, which you have no access to. I think it would be best to try out some of the other 'free' tools, such as source boost, or CCS, or...
     
  21. Marks256

    Marks256 New Member

    Joined:
    Jul 14, 2006
    Messages:
    2,350
    Likes:
    9
    Location:
    Minnesota, USA
    Yeah, i will have a look at Bill's kits. Then i need to get my homework done... :eek:
     

Share This Page