Shop OBEX P1 Docs P2 Docs Learn Events
What is a Microcontroller - Chapter 5 - Activity 2 — Parallax Forums

What is a Microcontroller - Chapter 5 - Activity 2

harshudeshpandeharshudeshpande Posts: 5
edited 2012-04-02 06:34 in BASIC Stamp
I wonder if someone could explain this to me. I have pasted a diagram from the book below. (I have added A and B markers)


chapter5acticity2.jpg


I understand the first part. High 7 makes the current flows throgh p7. As we add more and more resistance, more voltage flows through p7 - A - Capicitor + and the capacitor gets charged.

What I do not understand is the discharge part i.e when INPUT 7 command is executed.

The only way I could make sense of the program is is to think that the current flows from Capacitor positive to 220 Resistor to p7. But what I do not understand is how come P7 becomes negative charged? This is what I do not understand.

Thanks in advance for your time.
446 x 310 - 15K

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,563
    edited 2012-04-01 17:57
    The Capacitor does not go negative or get a negative voltage from P7, the capacitor is discharged through "R" if the resistance of R is a low value, then the discharge happens quicker than if the resistance of R is a higher value. P7 in this case is used as an input to time how long it takes for the capacitor to discharge. This amount of time is proportional to the value of R.
  • sylvie369sylvie369 Posts: 1,622
    edited 2012-04-02 06:34
    It's probably helpful to be aware that an I/O pin reads as a digital "1" above a certain voltage (Beau could certainly give you the more-or-less actual number in this case - I think it's 1.4V) and a "0" when below that voltage. The help file entry for the RC Time command in PBASIC explains it all very clearly. I'd start by reading that carefully.

    Chapter 8 of the Propscope book will tell you more than you ever cared to know about RC Time circuits.
Sign In or Register to comment.