CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Square Wave Data Logging
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
iso9002
Guest







PostPosted: Sat Aug 21, 2004 2:40 pm     Reply with quote

Ok.... so say I was going to cut that square wave down from 6-8 to somthing the pic can handle (2-5V)

I dont need to cut any amperage out of the system (its pretty low to begin with) but I'de like to halve to voltage... somthing like this should work no? (that first pic was WAY screwed up)

Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sat Aug 21, 2004 3:21 pm     Reply with quote

The simplest way is a series resistor with a zener between the PIC and the resistor to ground.
Guest








PostPosted: Sat Aug 21, 2004 4:16 pm     Reply with quote

Um.... One of these?



I figured with two resistors of the same value it should make 1/2 the voltage....

I wish I wasnt so dumb.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sat Aug 21, 2004 10:46 pm     Reply with quote

Nope. The resistor goes between the pic and the signal. Then a zener is reversed biased between the pic and resistor to ground.

Code:

pic ________/\/\/\/\/_________ signal
           |
           |
          __
          /\
          _
          |
          |
         ground
iso9001 - (ME)
Guest







PostPosted: Sun Aug 22, 2004 2:35 pm     Reply with quote

Ok, I see....

So the resistor cuts the power of the highs right... AND powers the diode up... then when thier is a low, the diode is unpowered and the pic see ground...

(This next part is going to sound retarded.... but like I said... I'm dumb)

Ok... I know ohms law and all, but I'm confused....

If I put a 1k resistor inline between somthing and DMM both sides, SOMETIMES it stays the same voltage, but a lower amperage, and somtimes the voltage is changed.... I dont get it.... How will I figure out what resistor will cut down the 6-8V to a more reasonable 2-5V ?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sun Aug 22, 2004 10:26 pm     Reply with quote

The diode would be a zener type. They come in many voltages. You could pick say a 4.7v or 5.1v and the voltage across it would be either 4.7 or 5.1 volts. What it does is sink current to ground. Now how does the voltage get dropped? Well that is what the resistor is for. Remember ohm's law. The voltage drop across is equal to the current running through the resistor times its resistance. So to make things easy, if we had a 5V zener and an 8 volt signal, we need to drop 3 volts. The zener and resistor do all the work. We are just concerned with how much current the zener will sink. If we chose a 1K resistor then that would be about 3mA (3VDC/1K). A 10K resistor would give about 300uA.
iso9001-
Guest







PostPosted: Mon Aug 23, 2004 1:17 pm     Reply with quote

Well... It a little hard to measure this signal w/ a dmm since its a bus signal thats always running... If I probe it, the DMM says its ~.2mA... but I know that isnt exactly accurate since the DMM just isnt nearly fast enough to capture the right reading... Likewise if I measure the voltage on the line I get 1.0-2.7V, but when I hook a scope up I get highs of exactly 7.5V


So if it were .2mA (probably not) I'de use a 15k resistor to get 3V to drop into the zener ?

And if the signal was 1mA (more likely) I'de want to use a 3k resistor

I should be able to check the voltage after my setup with the scope to see where I need to be. But does this seem right as far as the ohms law goes ?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Aug 23, 2004 2:06 pm     Reply with quote

No, no, no. It doesn't matter what the current passing through the signal wire is. You are not going in between the signal but rather tapping off of it. If you draw too much current, then what ever is supplying the signal might be overloaded.
iso9001+
Guest







PostPosted: Mon Aug 23, 2004 4:41 pm     Reply with quote

I'M SO RETARDED!

Ok... so lemmi understand this properly... The diode will draw 5.1V from the computer supplying the signal. The computer is already sending out 7.5V on the highs to whoever is listening, the pic and all the other moduals in place.

So... The resistor is going to limit the amount the zener draws ?

With a 1k resistor there, when the signal is high the zener activates and all the pic seeing is the 5.1V of the zener ???
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Aug 23, 2004 6:09 pm     Reply with quote

The resistor limits the amount of current the zener "conducts". But yes, you have the right idea.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group