some question on microcontroller

Thread Starter

cpleng7

Joined Dec 18, 2008
120
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?
 

t06afre

Joined May 11, 2009
5,934
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:
 

Papabravo

Joined Feb 24, 2006
21,159
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!
 

Papabravo

Joined Feb 24, 2006
21,159
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.
 

beenthere

Joined Apr 20, 2004
15,819
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.
 

Thread Starter

cpleng7

Joined Dec 18, 2008
120
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?
May I know where should I put the 0.1uF decoupling caps?

Which pin is channel 1 attached to? Which microcontroller are you using?
the channel 1 is I attach to the first LED.
the microcontroller that I have used in here PIC16F877A.

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.
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
 

russ_hensel

Joined Jan 11, 2009
825
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+
 

Thread Starter

cpleng7

Joined Dec 18, 2008
120
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?
 

thatoneguy

Joined Feb 19, 2009
6,359
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:

thatoneguy

Joined Feb 19, 2009
6,359
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?
 

Thread Starter

cpleng7

Joined Dec 18, 2008
120
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?
 

thatoneguy

Joined Feb 19, 2009
6,359
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.
 

Thread Starter

cpleng7

Joined Dec 18, 2008
120
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?
 
Top