Author Topic: Can I connect two PWM pin together to increase my voltage?  (Read 8585 times)

0 Members and 1 Guest are viewing this topic.

Offline zorthgoTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Can I connect two PWM pin together to increase my voltage?
« on: November 09, 2012, 02:39:03 am »
Hi Guys,

     I am working on a project for school and I have a question for you guys. I have a FreeScale M52233Demo board that works on 3.3V. I bought an LCD module from Parallax model #27979 that works on 5V. Can I by any change take two PWM pins from my microcontroller and put them together to increase the voltage to 6.6V or would that just fry my board? I did some googleling but I am not sure if it is safe to try it, and I definitely do not want to have to buy another LCD or board and wait another week to get it. 

Thanks for the help!
Slow and steady wins the race!
 

Offline poodyp

  • Regular Contributor
  • *
  • Posts: 151
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #1 on: November 09, 2012, 03:03:35 am »
Electricity doesn't work that way. If you connect two 3.3v sources together you still get 3.3v. If you have two sources that are floating relative to each other you could connect them serially, but two outputs on the same chip aren't.

 What you need is a logic level shifter.
 

Offline zorthgoTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #2 on: November 09, 2012, 03:28:58 am »
Thanks poodyp for the reply! I guess I can't do that. I looked up logic Level Shifter and it sounds a little out of my league. I do however have a RadioShack battery box that can hold 4 AA batteries. Can you give me a hint as to how to drop those 6V down to around 3v? Thanks! :)
Slow and steady wins the race!
 

Offline Jimmy

  • Regular Contributor
  • *
  • Posts: 224
  • Country: au
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #3 on: November 09, 2012, 03:36:58 am »
To raise the voltage you will need a level shifter like http://www.freetronics.com/products/logic-level-converter-module#.UJx6PpFmOYQ
 

Offline zorthgoTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #4 on: November 09, 2012, 04:01:26 am »
Thanks Jimmy, But I think that device is if you would like to use a 3.3v sensor on a 5V microcontroller. In my case, I need to use a 5V LCD on a 3.3V microcontroller.

Question: To reduce my 6V from the battery pack to 5V, can I use a voltage regulator? I remember going over them in Electronics I when dealing with rectifiers.

Thanks!
Slow and steady wins the race!
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5022
  • Country: ro
  • .
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #5 on: November 09, 2012, 04:16:10 am »
Yes, you can use low drop linear voltage regulators.

Pay attention to  maximum drop voltage (you should be safe with up to 0.6-0.8v, this way voltage should be regulated to 5v even when battery goes a bit below 6v). Then pay attention to maximum current the regulator can handle - a sensor would work with a 100mA regulator but for a LCD panel you're safer with a 250mA or higher regulator.

For example:

http://uk.farnell.com/microchip/mcp1700-5002e-to/ic-v-reg-ldo-250ma-to-92-3/dp/1331481
http://uk.farnell.com/microchip/tc1262-5-0vdb/ic-ldo-500ma-5-0v-sot223-3/dp/1852185
http://uk.farnell.com/microchip/mcp1703at-5002e-mb/ldo-2-7-16vin-0-25a-5v-2-3sot89/dp/2218577
http://uk.farnell.com/on-semiconductor/ncp5501dt50g/ic-voltage-regulator/dp/1703369
http://uk.farnell.com/microchip/tc1262-5-0vab/ic-ldo-5-0v-500ma-to220-3/dp/1852184
http://uk.farnell.com/microchip/mcp1825s-5002e-ab/ic-ldo-5-0v-500ma-to-220-3/dp/1578405

Should find the chips somewhere else like digikey, just search for the base name like "mcp1700" , "5501" or "ncp5501" , "tc1262" etc

You'll find similar chips that have fixed output for 3.3v in case you don't use a linear regulator already.  Or you can use something with adjustable voltage output and use two resistors to set the output voltage.
I'd suggest connecting the 3.3v regulator in that case to the 5v linear regulator output, this way the losses are smaller and the battery should last longer.

battery ->
6v to 5v linear regulator (250mA - 500mA or more)
  -> lcd
  -> 5v to 3.3v linear regulator (100mA - 250ma, doubt your microcontroller uses more than 100mA)

Read the datasheets, all should have basic circuits which tell you what capacitors you should use and where, linear regulators are very simple.
« Last Edit: November 09, 2012, 04:20:22 am by mariush »
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #6 on: November 10, 2012, 01:08:24 am »
driving the 5 volts lcd from the 3.3 volts cpu should not be a problem. the output voltage high (VoHmin) of the cpu is high enough to be seen as a logic '1' by the 5 volts display .

as long as you are only driving the display there is no problem
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9939
  • Country: nz
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #7 on: November 10, 2012, 02:12:57 am »
You could generate a Q and "not Q" square wave using two 3.3V io pins and feed it into a diode cap voltage multiplier.
That would give you 6.6V, add a 5V zener and you would have ~5V.

Then you'd need to
- Put a resistor divider on every 3.3v mcu input so it could accept 5V from the LCD
- Add a transisor for every 3.3v mcu output to switch 5V to the LCD.

But, as others have said, use a level shift IC. Its far easier and simpler

Or you could forget active level shifting and just add voltage dividers on all 3.3V mcu inputs.
The 3.3V mcu outputs will probably be accepted by the 5V lcd correctly.
It's not good practice but most of the time it works for hobby stuff.
« Last Edit: November 10, 2012, 02:16:32 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline notsob

  • Frequent Contributor
  • **
  • Posts: 695
  • Country: au
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #8 on: November 10, 2012, 02:26:35 am »
If you are not aware of this, you can get 3.3volt LCDs, even sparkfun has them in stock

https://www.sparkfun.com/products/9053
 

Offline zorthgoTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #9 on: November 10, 2012, 02:40:07 pm »
Thanks guys for the replies! :)

I bought a 5V voltage regulator at radioshack but unfortunately it drops my 6.6V to 4.5V instead of 5V, and the LCD doesn't even light up. I plugged the 6.6V into the LCD and ran the self test on it and it displayed the initialization text and sound correctly. Which leaves me with the following question. Would it be ok if I ran it at 6.6V since is seems to be working correctly or is it slowing killing my LCD? Also, I am sending the Asynchronous Serial signal to the LCD (I can see the signal on my oscilloscope) at the correct baud rate, but the LCD doesn't display anything. Could that be because of the 6.6V I am applying to the LCD? Thanks for all the help! ;D
Slow and steady wins the race!
 

Offline zorthgoTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #10 on: November 10, 2012, 02:43:09 pm »
Hi Jimmy, in the description of the link you sent me it says that the level shifter is for using 3.3V sensors with a 5V MP. Would it also work in reverse?
Slow and steady wins the race!
 

Offline zorthgoTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #11 on: November 10, 2012, 04:26:35 pm »
Ok, I think I might have killed my LCD module.  |O

At 6.6V, I couldn't get anything to display on the screen when sending data from the MP, so I decided to use my variable power supply to supply the necessary 5V to the LCD screen. Now when I send data at 19200 baud, I get garbage on the LCD screen (at least I am getting something). When sending the signal using the other two speeds (2400, 9600 baud) I still get nothing. Do you think that I might have killed an internal component on my LCD screen like the timing crystal causing the serial communication to be off sync? Is there any way I can test that? Any help would be appreciated.

Thanks!
Zorthgo
Slow and steady wins the race!
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #12 on: November 10, 2012, 04:53:10 pm »
The module has an own test mode, did you use it?
The module has baud rate switches. Did you change them?
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline zorthgoTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #13 on: November 10, 2012, 06:52:25 pm »
Hi  Bored@Work,

     Yes, I ran the self test and it displays the test text string on the screen and plays the sound. I did change the baud rates to all three speeds (and configured the MP to send the data at those speeds). But the only baud rate that I get anything displaying on the screen is the 19200, and even then, it is garbage data. When I set the baud to the lower speeds, I get nothing on the screen. At 6.6V I get nothing on all baud rates.
Slow and steady wins the race!
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9939
  • Country: nz
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #14 on: November 10, 2012, 07:14:32 pm »
5v devices often have an "absolute maximum rating before damage" of 6 - 6.5V
 
It should be in the datasheet
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline zorthgoTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #15 on: November 10, 2012, 11:42:00 pm »
Ok, I checked the datasheet up and down. The only specification is the operating voltage (which is a fixed 5V not a range). I've been working on this thing for the last two days without any luck (that's what you get for trying to go beyond what the teacher has taught |O).  I guess I will have to take it in to my teacher to see if he will help me with this (or at least tell me if the LCD is dead). 

But thanks for all the help. I will try some of the things you guys suggested for the power supply (probably the voltage divider), so that I don't have to lug my bench top power supply with me when I have to deliver my presentation on the project. :)


Thanks!
Jay
« Last Edit: November 10, 2012, 11:45:54 pm by zorthgo »
Slow and steady wins the race!
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9939
  • Country: nz
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #16 on: November 10, 2012, 11:47:50 pm »
The datasheet will have an operating voltage but also in another section will be table for
"Absolute maximum ratings".
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline zorthgoTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #17 on: November 15, 2012, 12:15:34 pm »
Hey guys, After almost a whole week tinkering with this stupid LCD, I found out I was the one being stupid. Apparently because my board and the LCD had different grounds, they were not able to communicate serially. This was very exciting because this is the first time that my oscilloscope actually helped me learn (and debug) something. Now that I connected both my LCD module and my MP board to the same power source, they are communicating with each other perfectly.

Would anyone be so kind as to explain to me why they have to be connected to the same power source? Also, why do I need to plug my oscilloscope to the circuit's ground? I noticed that when I didn't plug my oscilloscope to the circuit's ground instead of seeing the square wave of my serial signal, it displayed the square wave of the signal ridding on something that looked like a sine wave.

Thanks guys for all the help!  O0
Slow and steady wins the race!
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9939
  • Country: nz
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #18 on: November 15, 2012, 12:35:20 pm »
Hey guys, After almost a whole week tinkering with this stupid LCD, I found out I was the one being stupid. Apparently because my board and the LCD had different grounds, they were not able to communicate serially.

Hehe, we've all done that.


Would anyone be so kind as to explain to me why they have to be connected to the same power source?

They don't need to be powered from the same supply but they do need to have a common ground. Otherwise it's like a lightbulb with only one wire connected to power :P.
If you want one device to communicate with another then current needs to flow between. If you only connect the signals wires there's no current flow.


I noticed that when I didn't plug my oscilloscope to the circuit's ground instead of seeing the square wave of my serial signal, it displayed the square wave of the signal ridding on something that looked like a sine wave.

The scope is always grounded to mains earth. So any measurement it displays is with reference to mains earth.
It's likely there was actually some ground connection between the scope and your circuit (even with the scope ground clip unplugged) due to mains earth getting to your circuit through some other means. It probably had to travel through half the mains wiring in your house and back again and as a result the signal quality is terrible and you get 50/60hz mains noise superimposed on top.

Even if there was definitely no earth connection to your circuit it would have been earthed somewhat just by capacitive coupling to nearby earthed objects. The scope input is high impedance so will pickup stuff like that without a proper ground.
Also things start acting like an antenna without an ground.
« Last Edit: November 15, 2012, 01:12:50 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline zorthgoTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #19 on: November 15, 2012, 05:21:53 pm »
Thanks Psi! That was very insightful.

Your explanation on the oscilloscope made perfect sense to me. I do have a question though. What do you mean when you say "common ground"? If I power one device from a 5V lab powersupply and the other from a 5V battery do they have a common ground? If not, is it because the battery's negative is isolated from the other system?

Thanks!
Slow and steady wins the race!
 

Offline T4P

  • Super Contributor
  • ***
  • Posts: 3697
  • Country: sg
    • T4P
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #20 on: November 15, 2012, 06:07:52 pm »
Common ground is when the grounds are linked together. That's the simplest explanation i hope you will understand
 

Offline zorthgoTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #21 on: November 15, 2012, 06:35:33 pm »
Thanks T4P! That was simple enough.


But I still have a question. My asynchronous serial connection between my developer's board and my LCD module didn't work because they did not have a common ground. But how come I can talk to a serial device using my laptop' serial port (which is running on it battery, therefore not a common ground). Shouldn't the serial device be required to have a common ground with the laptop? How does that work?

Thanks for the help!

Slow and steady wins the race!
 

Offline Thor-Arne

  • Supporter
  • ****
  • Posts: 500
  • Country: no
  • tinker - tinker, little noob.....
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #22 on: November 15, 2012, 07:24:51 pm »
But I still have a question. My asynchronous serial connection between my developer's board and my LCD module didn't work because they did not have a common ground. But how come I can talk to a serial device using my laptop' serial port (which is running on it battery, therefore not a common ground). Shouldn't the serial device be required to have a common ground with the laptop? How does that work?

The laptop's ground is connected trough cable to your serial device's ground, so they have common ground.

The meaning of having a common ground is for the devices to have a common reference point so they can "understand" each others signals.

Common ground does not necessarily mean the mains ground, think of it as 0 volt point in the circuit.
 

Offline zorthgoTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #23 on: November 15, 2012, 09:03:17 pm »
Now it makes perfect sense! That is why on serial cables you have the ground pin. Thanks Thor-Arne!
Slow and steady wins the race!
 

Offline T4P

  • Super Contributor
  • ***
  • Posts: 3697
  • Country: sg
    • T4P
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #24 on: November 16, 2012, 12:07:46 am »
That's also why you have ground pins on ... everything. Signal transmission does not work magically (i.e having no 0V to reference 'LOW' to)
 

Offline ptricks

  • Frequent Contributor
  • **
  • Posts: 671
  • Country: us
Re: Can I connect two PWM pin together to increase my voltage?
« Reply #25 on: November 16, 2012, 12:49:22 am »
Now it makes perfect sense! That is why on serial cables you have the ground pin. Thanks Thor-Arne!

The outer shell of the serial cable connector are also ground points.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf