Shop OBEX P1 Docs P2 Docs Learn Events
Project 1 in "What's a Microcontroller"? — Parallax Forums

Project 1 in "What's a Microcontroller"?

fjohnsonfjohnson Posts: 2
edited 2008-12-08 09:51 in Learn with BlocklyProp
I'm a newbie to this MC stuff. I am following the Parallax book, What's a Microcontroller? In chapter 2, at the end (pg. 68), there is a project I cannot make work. I have looked over the code several times with no success. So far all has gone as the book says it should except this. Any help please.

Frank

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-26 17:58
    First thing you have to learn is how to communicate usefully via the forum. We're not at your side and we don't know what you've tried so far nor what you've learned already. If you're talking about the project description in the middle of page #68, there are several pieces that are built on previous problems. What have you successfully done so far? Obviously something has gone wrong with combining the various pieces (flash this LED, flash that LED, etc.) You need to post your source code as an attachment to your next message. You should also attach a schematic if possible or a clear picture of your breadboard or a clear description of what's connected to what including which end is which for those things with "ends". Lastly, you need to describe clearly what you mean by "I cannot make work". How far have you gotten? What works and doesn't work?
  • fjohnsonfjohnson Posts: 2
    edited 2008-10-26 18:33
    Thanks

    Below·is my source code

    Everything in Chapter 2 prior to Exercises, worked OK.· I think it matches the code on pg. 69 & 70 in the book.

    When you 'Run', the Red Bi-LED comes on and at the same time the Yellow comes on and flashes for 10 seconds. The Red stays on solid for the same 10 seconds the yellow is on. It should be on for 3 seconds, then the Yellow is to come on and flash. After the Yellow stops flashing the Green comes on and stays on, the Red does not follow as it should.

    The schematic is as follows: Matches Yellow LED on pg. 48. The Bicolor matches pg. 64.



    'WAM - Chp2 Project.bs2
    'Page 68

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    DEBUG "Program Running"

    counter VAR Byte

    'Red for three seconds········ 'Bi color LED Red
    HIGH 15
    LOW 14
    PAUSE 3000

    'Green for 10 seconds
    LOW 15························ 'Bi color LED Green
    HIGH 14

    '.....WHILE the Yellow LED is flashing

    FOR counter = 1 TO 10

    HIGH 13······················ 'Yellow LED on
    PAUSE 500
    LOW 13······················· 'Yellow LED off
    PAUSE 500
    NEXT

    'Red stays on················· 'Bi color LED Red
    HIGH 15
    LOW 14
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-26 19:50
    The program appears to be correct. If you followed the drawing on page 48, you probably forgot to connect the LED (Yellow here instead of green) to I/O pin 13. You may have connected the Bicolor LED incorrectly as well. Check the connections. Your program assumes that the Bicolor LED is connected between pins 14 and 15 and the Yellow LED is connected between pin 13 and Vss (along with their current limiting resistors).
  • morgandeomorgandeo Posts: 16
    edited 2008-12-08 09:51
    Hi
    If you want to know all the things about a microcontroller than you are going to want a book. There are a lot of different microcontrollers from different manufactures.
    I have few information on 8051 microcontroller.
    microcontroller consist of only these part;
    1. CPU
    2. Ram
    3. Rom
    4. I/O
    5. Alu
    6. Timer
Sign In or Register to comment.