This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Conecting HM55B (compass sensor) to MCB2379

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

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

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

Children
No data