We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello. I'm trying to connect the module HM55B (electronic compass) with MCB 2378. The module operates at 5 volts and I want to connect FAST GPIO pins that go to 3.3 volts. How I can do? Thank you very much
Sorry , it´s mcb2378
LPC2378 have 5V-tolerant pins, so if signals are only sent to the processor, then it's enough if you add a series resistor for each signal.
If signals goes from processor to sensor then you need to check if the sensor can accept +3.3V as logic high with enough safety margin. If not, then you may have to use a pull-up to 5V and send data by changing the I/O pin between input (pulled to 5V) and output driven low. Or buy a level-changer chip and place between. Or put a transistor between.
Standard electronics stuff. You have spent time reading the datasheet/user manual? And you have read up a bit about mixed-voltage interfacing?
"The module [HM55B] operates at 5 volts"
Are you sure?
I Googled "HM55B" and found several 3rd-party datasheets using this chip - and it seems that it's actually a 3V3 chip.
Example: www.totalrobots.com/.../HM55BModDocs.pdf
It is left as an exercise for the student to find the original chip manufacturer's datasheet...
In the datasheet i have read this Pin Definitions and Ratings Symbol Quantity Minimum Typical Maximum Units Vcc Supply Voltage 4.8 5.0 5.2 V Icc(Ave) Average active supply current* 5 7 mA Icc(Pk) Peak instantaneous current** 30 45 mA Icc(Sb) Standby supply current 2 3 mA GND Ground reference connection 0 V VOH Signal high transmit (Dout) Vcc × 0.9 Vcc Vcc + 0.5 V VOL Signal low transmit (Dout) GND - 0.3 GND Vcc × 0.15 V VIH Signal high receive (/En, CLK, Din) Vcc × 0.8 Vcc Vcc + 0.3 V VIL Signal low receive (/En, CLK, Din) - 0.3 GND Vcc × 0.12 V * Measurement cycle = 80 ms ** Typical duration is 5 µs (1) Din - Serial data input (2) Dout - Serial data output (3) GND - Ground -> 0 V (4) CLK - Synchronous clock input (5) /EN - Active-low device enable (6) Vcc - +5 V power input 29123 I guess you can not use other voltage.
Yes. I have the chip in my hands and I've used it with arduino. I have read the three sheets that I found on the internet and says the same (5 v). I had thought of two ideas. 1st to send the data to the sensor using a transistor working in court and saturation (BC 547). 2 º To receive data from the sensor to LPC2378 using a voltage divider. Thank you for your help Antonio Moyano
In the data sheet at the beginning says "The sensing device on the Compass Module is a Hitachi HM55B chip. An onboard regulator and resistor protection make the 3 volt HM55B chip compatible with 5 volt supply BASIC Stamp ® microcontroller and signal levels". I do not know if it will work when connected to 3.3 volt Vcc, since then he says that the Vcc is 5 v. It has a voltage regulator. If I want to receive data from the sensor, which is the amount of resistance I have to put in series. Please, Do not get angry with me. Antio Moyano
A voltage divider is not a good choice when feeding 5V data to a 3V3 device. And it isn't needed since I have already told you that the LPC23xx is 5V-tolerant. All you should do is add a series resistor as current limiter.
"says the same (5 v)."
The ones I found clearly said that the chip itself was 3V3 - the module is supplied with 5V, but has an onboard regulator that drops this to 3V3.
Maybe you have a slightly different variant of "HM55B (compass sensor)" - so you need to provide links to the actual documents that apply to the actual version of the actual part that you're actually using.
Two things. 1 What is the value of the resistor I put in series when I receive data from the processor? 2 You tell me to send data to the compass sensor I have put a pull up resistor to 5v. I guess it's outside the processor. But to set the pin with the PINMODE register, do I have to program it as "10"?: 00 Pin has an on-chip pull-up resistor enabled 01 Reserved. This value should not be used. 10 Pin has neither pull-up nor pull-down resistor enabled. 11 Pin has an on-chip pull-down resistor enabled. Than you for your patience. Antonio Moyano
The series resistor is when sending data to the processor, not the other direction. Many processors have body diodes that shorts overvoltages to VCC. The LPC23xx chips are no exception when configured as inputs with pull-up or pull-down. The clamp voltage is a bit above 3.3V so the series resistor will limit the current. If you have a 10k resitor and we assume that the clamp voltage is 3.5V, then you have 1.5V and 10k, giving 150uA current.
When the LPC23xx GPIO pin is set as output, it will swing between 0V and 3.3V. It is driven strongly, and you can't just add a pull-up to draw it from 3.3V to 5V.
The pull-up most definitely must be externally - the internal pull-up will only pull towards VCC, which is 3.3V. When the GPIO pin is set as tri-state input, it is possible to use an external pull-up to float the pin all the way to 5V. Since almost all pins on the LPC23xx are 5V-tolerant, this is safe. But you better check the datasheet so you really are using one of the signals that are 5V-tolerant. A few pins have special functions that makes their implementation differ a bit (such as AD inputs, I2C and USB data signals, ...)
So you configure the pin as input with tristate (no pull-up and no pull-down - the 10 combination from your list). And you set the output state to low. Then you can switch between pull-up to 5V or hard drive to 0V by just toggling the output-direction bit. There is no need to perform any reconfiguration to toggle the pin.
The size of the pull-up needs to be adjusted based on the signal speed and signal trace capacitance to make sure that you get an acceptable rise time. A pull-up will not give as fast flanks as you get when actively driving the output pin.