some question on microcontroller

Discussion in 'Embedded Systems and Microcontrollers' started by cpleng7, Feb 10, 2011.

  1. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    May I know what is the output voltage for the microcontroller?

    why I just can get 2V?

    Why my output from the microcontroller have a lot of noise, how to avoid this noise occur?
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    We need more info like a schematics in order to help you. And also please describe how the noise look like. Now we are like this :confused:
     
  3. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    It would help if you would tell us what microcontroller. I can think of many reasons why you might measure 2VDC on the pin of a properly functioning part. Do you have an oscilloscope or a logic analyzer?

    For example:

    Q: If the microcontroller outputs a square wave that swings between 0 VDC and +5VDC at a frequency of 20 kHz. with a duty cycle of 40%, what voltage would you expect to measure with a typical DVM?
    A: Gee lemme think. Could the answer be ummm...(drum roll)...2 VDC

    Da-da-da-da-dah -- Give that man a cee-gar!! woot! woot!
     
  4. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    This is the waveform and the schematic with the real component .

    [​IMG]

    [​IMG]
     
  5. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
  6. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    if i running in 50 Hz system, will it too fast for the system?
     
  7. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Add 0.1uF decoupling caps to the uP

    Can't read the schematic, it's too small. What is the circuit supposed to be doing?
     
  8. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    I could not read the schematic either. It is too small. I see channel 1 on the oscilloscope with a waveform that has pulses that swing between ground and 2V. Which pin is channel 1 attached to? Which microcontroller are you using?

    I see what looks like pins driving a resistor in series with an LED to GND. If the resistor is too small and too much current is being drawn then the processor will put out a voltage that is much less than Vcc. If you read the datasheet carefully the specification for Voh always specifies a current for which that voltage is valid. Draw more current and the value goes lower.
     
  9. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    What is the Vcc? Whatever is is, the 2 volt output with no pullup resistor may be reasonable if it's a micro with "weak" internal pullups.
     
  10. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    I don't see any 0.1uF bypass caps, on the 40pin PIC one per side is nice. Gotta have em.
     
  11. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    May I know where should I put the 0.1uF decoupling caps?

    the channel 1 is I attach to the first LED.
    the microcontroller that I have used in here PIC16F877A.

    May I know what is the pull up resistor ? What is the function of the pull up resistor? How is the pull up resistor going to connect to the output?

    below the link is the schematic. Please click it and zoom it and view
    https://picasaweb.google.com/cpleng7/MicrocontrollerQuestion#5572294741138378402
     
  12. russ_hensel

    Well-Known Member

    Jan 11, 2009
    818
    47
    Fair bit of noise on ground as well. Some of noise on output high looks like hum. Have you scoped v+ and what does it look like. Suggested bypass seems a good idea. Schematic is not sharp enough for me to read. Are you using 5 v power for the chip? Are the outputs set high? Unless overloaded a digital out should be very close to to v+
     
  13. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    I am using the 5V input, and some things i have find out is if i directly measure from the PORTD output, the voltage that I get is 3.9V but when I measure the after the resistor 330 ohm, I found out the voltage only 1.9-2.1. May I know why after the resistor, the voltage will reduce? is that the noise problem?
     
  14. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    After the resistor, you are reading the Vf of the LED, the rest of the voltage is dropped across the resistor.

    The noise is a problem with your supply and lack of filtering/decoupling. Decoupling caps are 0.1uF caps between power and ground on the IC, as close to the IC as possible.

    Check the power supply with the board not connected, it shouldn't have that noise on it.

    If the noise still shows up, check your probes with a known good signal generator or similar. Make sure the ground clip on the probe is connected and the x1/x10 switch is fully in one direction, stuff like that.

    --ETA: Channel 4 has 50mV of noise on it, is a probe hooked up? Try enabling noise rejection (20Mhz cutoff) to see if that helps
     
    Last edited: Feb 12, 2011
  15. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    Is that after I solving the noise problem , the voltage will not be 2 volt again?
     
  16. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    It appears you are measuring the voltage at the anode of the LED, rather than the output pin of the PIC itself. The LED drops 2-2.5V, the current limiting resistor drops the rest of the voltage.

    The noise is from an external source that may cause "glitches" in the operation of the controller.

    What do you measure for the Vss supply of the PIC, and what do you measure at the output pins? Do the LEDs light up?
     
  17. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    The power supply is 4.44V, the output pin from PORTD is 3.97V . however when measure LED is 1.9-2.0V . the LED have light up.
     
  18. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    if later i need to connect the PORT D pin to the not gate, is that i need to put the resistor between the microcontroller and the not gate 7404?
     
  19. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    An LED Drops voltage across it, just like a regular diode, only more. Once past the turn on point, they appear almost like a short circuit. That is why the current limiting resistor is needed. If you measure across the LED + Resistor, you'll find the full ~Vss voltage.

    Treat the LED and current limiting resistor as a single unit.
     
  20. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    one more question I want to ask is regrading my push button, why my push button sometime can function smooth, sometime when press it , it didn't give any result? is that my schematic problem ? should I add a diode 1n4148 to the push button there?
     
Loading...