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?
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.
Related
I have a device which connects to its remote using rj45 port and 4 wire cable (a desk with adjustable height). I'm pretty sure it does not actually use an Ethernet protocol and uses sends some simple digital signals.
I want to Raspberry Pi to be able to control the device, so I was wondering if it is possible to read and dump and then send signals using Ethernet port just like I can do with any other pins? Probably the actual question here is about a way to bypass Ethernet driver in Linux OS.
This won't work. The Ethernet NIC on the RPi - just like any other NIC - can only receive Ethernet frames. Anything else needs to be connected over GPIO.
Edit: As NO-OP has reasonably pointed out, the signals may need to be made compatible with the GPIO pins - levels adjusted, maybe an opto-isolator here and there. Nothing expensive though usually. For controlling powered devices you likely need a driver or relais board - there are plenty around for the RPi.
I'm trying to connect a mass flow sensor, SFM-3000 by sensorion, to labview on PC using USB device, NI-8452, which provide I2C interface.
I followed the user manual of the sensor and used I2C example by labview but I cannot establish communication between them
I get the error message:
Error -301744 occurred at NI-845x I2C Run Script.vi:6110001,
Possible reason(s):
NI-845x: The I2C master lost arbitration and failed to seize the bus during transmission of an address+direction byte.
I'm using NI-8452 that include pull up resistor and I make sure to enable them by enabling 'Use Internal I2C Pullup Resistor' filled in 'NI-845x Device' property node.
I set I/O voltage level to 3.3,
I double check the address, I have 7 bit address defined in user manual of my device, 64 dec or 1000000 binary.
As specified in my device user manual, I provide it Vdd of 5v from NI-8452 pin 40 and also GND in pin 7.
Off-course SDA in pin 5 and SCL in pin 9.
I think I might have a problem with pull up reference voltage because the sensor specified it need to be 5v but NI-8452 use up to 3.3V.
but the low limit for high signal is 2.5v so it should work
My diagram:
another option i tried is using I2c script blocks
I tried similar solution also for pressure sensor, hdi0611arz8p5 by First-Sensor, but also got the same error.
After re-wiring it's started working, maybe some bad connectivity between wire and port. i hope this thread could help people that wish to connect sfm3000 using labview.
A number of bluetooth Arduino shields (Bluefruit EZ-link, SparkFun Bluetooth Silver) support DTR/RTS and have special out pin to wire. How do they work? Does it require special drivers (linux f.e.)? Can any bluetooth receiver be used or modified to provide DTR/RTS? Since setting DTR/RTS is vendor-specific does it depend on transmitter side or receiver (bluetooth shield) only?
The only idea is that special USB drivers needed that send special AT commands to make BT receiver know actual DTR/RTS value.
The documentation of Bluetooth SPP (https://developer.bluetooth.org/TechnologyOverview/Documents/SPP_SPEC.pdf) states in section 4.1 RS232 Control Signals that "all devices are required to send information on all changes in RS232 control signals".
And since Bluefruit EZ-link is not using any special drivers on the side of the computer, it must be that the standard BT virtual serial port drivers that manage the ports created for the BT connection to Arduino handle the control signals properly and send them over to the BT shield connected to Arduino. Hence no work should be needed on the side of the computer, and it only depends on the receiver: whether it has the control signals accessible on any of the output pins and operates them as it should, or not (as usually is the case, unfortunately).
Bluefruit EZ-link is described as programmer. It means it supports RTS/DTR:
The EZ-Link has another impressive feature: the DTR/RTS/DSR flow
control pins are automatically synced to the computer serial port.
What this means is that if the computer sets the hardware flow control
DTR or RTS pins high or low the pins on the bluetooth module will
follow.
So Arduino IDE performs reset to initiate flashing (as Arduino's Bootloader wait for few seconds after reset for upload commands from Arduino IDE). For USB reset works by switching DTR to 1 and 0 and special schematics on Arduino board monitors it and performs reset. After reset is done Arduino IDE runs avrdude and start flashing.
The question is "How does it works over Bluetooth module by Adafruit?" There is no RTS/DTR line for Bluetooth..
PS. I believe virtual COM-port drivers for this Bluetooth device should send special AT+ commands and Bluetooth device should handle them and perform setting 1 or 0 to special pin wired with MCUs reset. But this requires Bluefruit bluetooth driver to be used. But i can't see it requires special BT drivers at computer.
RFCOMM do support flow control.
RFCOMM is based on GSM TS 07.10. Bluefruit extract info on RFCOMM and map it to flow control lines.
My question is : what is the best method to drive a bluetooth module(BTM-331 as an example) over UART or SPI? I am asking this in the following context.
I have some analog sensors connected to a uP. The uP sends this data over spi to another uP who has also a bluetooth module. Because I talk with the sensors via SPI is ok to talk with the Bluetooth module with spi or uart is better?
I am pretty sure that even if you want to use it with SPI, you can't. I've used other BTM modules and the SPI on them is used for programming the module. Communication with it is possible through UART and (most of the times) USB.
Looking at the BTM 331 (description here) and it does say that USB and UART are the interfaces used.
Other than that it is fairly simple to use, you send data to it and the data goes to whoever the module is connected to. That is the least you can do with it but it is more than enough for most people.