1

I am developing a project using Arduino to send a message to Raspberry Pi using an APC220 Radio Communication Module.

The Raspberry Pi can't receive serial message by using USB connect to APC220. I want to know how to use APC220 in Raspberry Pi?

Chris Stratton
  • 39,853
  • 6
  • 84
  • 117
pyrhaha
  • 13
  • 1
  • 5
  • I don't know what kind of Arduino you have, but most have at least 1 other UART(serial) connection available on 2 of the digital pins, in addition to the UART available through USB. – nos Feb 15 '15 at 19:20
  • 1
    @nos. I don't think the Arduino connection is the issue here, it is connecting the ACM220 to the RPi rather than a PC that the question is about. The ACM220 kit includes a TTL-serial to USB adapter for connecting to a PC - it seems that it is this adapter that he can't make work with the Pi - but it is not needed the Pi already has TTL level serial on the GPIO header. – Clifford Feb 15 '15 at 20:00
  • The issue here is not unique to the raspberry pi, but rather arrises from the use of Linux (or actually anything but windows - it reportedly exists on OSX as well) – Chris Stratton Feb 22 '15 at 16:30

1 Answers1

0

The APC220 has a TTL UART interface which you can connect directly to the RPi TTL UART pins on the GPIO header - you do not need the USB-Serial converter (though that should work too if it is a standard CDC/ACM device - though this suggests that there may be issues).

A note of caution however, the RPi GPIO pins use 3.3Volt logic, the APC220 datasheet is not clear on the TTL level used, but the specified supply range is 3.3 to 5.5 volts so it seems likely that it is 3.3V - best measure it to be certain. You can probably use the RPi GPIO headers's 3.3V supply pin to power the ACM220, then you will be sure to be safe. If the ACM220 level is too high, the quick-and-dirty solution is to use current limiting resistors in-line to protect the RPi (10KOhm should be enough, but don't hold me responsible; you should know what you are doing before proceeding).

The UART device on the Pi is /dev/ttyAMA0.

See here for details of serial I/O on the Pi.


22 Feb 2012 Update

The discussion here suggests that to make the TTL<->USB adapter work on Raspberry Pi, you need to disconnect the EN signal - the discussion links back to the manufacturer documentation, which gives that advice in the troubleshooting section. Since that makes the device appear as a USB serial, and you won't have to reconfigure the on-chip serial or build a connector that may be simpler.

Clifford
  • 88,407
  • 13
  • 85
  • 165
  • Thanks very much for your answer.Does the pins all in APC220 should be connected to RPi ?The pins in APC220's description as following. APC220-43 1 GND Grounding of Power Supply 2 VCC Power supply DC 3.5V-5.5V 3 EN Power enable,≧ 1.6V or empty,≦ 0.5Vsleep. 4 RXD URAT input, TTL 5 TXD URAT output, TTL 6 MUX The pin is expanded for other functions 7 SET Setting parameters, setting online supportted 8 NC Not connected 9 NC Not connected – pyrhaha Feb 22 '15 at 15:25
  • @pyrhaha : As described in the [documentation](http://www.dfrobot.com/wiki/index.php?title=APC220_Radio_Data_Module(SKU:TEL0005)#Connect_APC220_to_MCU). The GND and 3.3V should additionally be connected to the GPIO header's GND and 3.3V to power the module. The 3.3V can source 50mA, which according to the APC220 data sheet is just about enough, but only just. The 5V pin is connected directly to the Pi's power supply, so may be better, but as described if there is no regulator on the board and the TTL levels are then 5V, you cannot use it directly and will need a 3.3V regulator. – Clifford Feb 22 '15 at 16:00
  • @pyrhaha : See also my update on getting the USB adapter to work, which may be simpler/safer if you are not an electronics expert. – Clifford Feb 22 '15 at 16:20
  • For sake of clarity, that is not a raspberry pi issue, but rather an "anything but windows" issue - Linux, OSX, etc. And most likely it is simply that someone forgot to configure whichever serial control signal is wired to the EN signal, and is relying on whatever windows does by default, or knows how to configure that on windows but not how to do it against a unix serial API. – Chris Stratton Feb 22 '15 at 16:26
  • whether the "set" pin should be connected.I heard someone said it shouldn't be connected when transmit signal – pyrhaha Feb 22 '15 at 16:31
  • SET must be pulled high to transmit and low to configure. If you only use it with default configuration, perhaps you can tie it high, possibly it will float high. The documentation is not clear. To be honest, I would avoid the device altogether on the quality of the documentation alone! A schematic of the board and the USB adapter would be useful, and lack of information on signal levels makes it difficult to advise without measuring the signals on the board itself. – Clifford Feb 22 '15 at 16:37
  • @ChrisStratton. The documentation is truly poor. I would guess perhaps that the EN corresponds to DTR which Windows normally asserts automatically when the port is opened. – Clifford Feb 22 '15 at 16:44
  • @Clifford:I see the update. You solve my question perfect.At begining I thought a idea.Whether it is possible if I connect a new ardunio to RPI with USB and equip this ardunio with APC220, we can transmit remote though these two ardunio and the new ardunio transmit message to RPi by USB. – pyrhaha Feb 22 '15 at 16:44
  • Using an Arduino as a bridge is resourceful thinking but probably not a great idea in practice - it's overly expensive, another thing to configure, and an Uno lacks a second serial port so you would have to use a software serial instance to talk to the RF module, or else pull out the ATmega and merely use it as an overpriced USB-serial converter. – Chris Stratton Feb 22 '15 at 17:10
  • Since the Arduino to RPi interface would likely be via the serial port, I2C or SPI the only benefit would be better documentation! – Clifford Feb 22 '15 at 19:57
  • @ChrisStratton:You are right. My idea is lack of some practical things. Anyway,thanks for your answer – pyrhaha Feb 24 '15 at 14:06
  • @Clifford:Yes,Better documentation can make it easier for the person who like me is a newcomer.But, I think your suggestion is the best.So,Thank you very much – pyrhaha Feb 24 '15 at 14:12