Sending AT commands through gpio pins - gsm

I am working on Toradex VF-50 SoM using the evaluation board. I have a quectel M10 Modem. The modem is connected to the board using gpio pins and not on the serial port. There are many solutions available for configuring the modem over the serial port. But i need to configure and use the modem over the gpio pins. I have connected the Rx(36),Tx(38),Gnd,Vcc and 5v with the gpio. Now i need a sample code on how to configure and send AT commands over this modem. The os in the SoM is WinCE6. I need to develop the code is Visual Studio 2008. please help...

I do not recommend connecting a modem to GPIOs which do not have UART functionality! This makes your SW unnecessary complex and you load the CPU with work which could be done more efficient by the UART HW.
The Toradex Colibri VF50 has many pins with UART functionality, you can use the Pinout designer to find a good solution for you.
In case there are some good reasons you have to use other pins you can use the GPIOLibary for an easy way to program the GPIOs. It comes with code samples:
http://developer.toradex.com/software/windows-embedded-compact/toradex-ce-libraries-and-code-samples
I don't have a link but I guess there is sample code how to emulate/bit bang a serial port.

Related

Arduino 2006 how to connect to my laptop?

I have borrowed an Arduino BT-V06 (analogue) from my college IT storage department.
At home I am trying to do some research on this for subsequent work I am going to perform with this Arduino later on. As this model is a 2006 version; my question is, how do I connect it to my laptop? Some sort of adapter? or perhaps shield it with a newer model that has a usb-port?
Because I would like to have it connected to my laptop in order to try out some codes on it.
Thank you very much for your time!
-M
There's at least two options. First, it's set up to be programmed over Bluetooth. So if you have Bluetooth on your laptop, you can connect the two wirelessly. Pins 0 and 1, per the documentation, are TTL serial transmit and receive pins (which are also used for Bluetooth communications), so if you AREN'T connecting via Bluetooth, you could connect a serial to USB adapter so you can connect to your laptop via USB. This reference has this to also say:
"The on-board serial communication between the bluetooth module and the Arduino sketch (running on the ATmega328) needs to be at 115200 baud (i.e. call Serial.begin(115200) in your setup() function). Communication between the bluetooth module and the computer can be at any baud rate.
Communication between the BT module and the computer can be temperamental. You might want to open the serial monitor a couple of seconds after resetting the board. The text of the Arduino getting started guide is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the guide are released into the public domain."

Is it possible to use both external power jack and USB port with Arduino?

I have the Arduino UNO board and I want to know if it is possible to use both the USB connection (for exchanging data) and the external jack to power supply it.
I will use the following cable: http://ecx.images-amazon.com/images/I/41OMXaj5cPL.SY355.jpg with a AC-DC 5V adaptor in order to power supply the Arduino. However, I want to use also the USB connection in order to send some data from the computer.
Both will be connected at the same time.
In short, I want the Arduino to be able to run even if the computer is OFF and whenever I open the computer to send data to Arduino from USB connection.
Is this possible? Will the Arduino Uno board support it?
Yes. From the official Arduino website:
Power
The Arduino Uno can be powered via the USB connection or with an external power supply. The power source is selected automatically.
External DC power will override USB power if the Arduino detects it. [Source]
as other said, it is absolutely possible to have both usb and power jack plugged in.
but be aware that if you shut down your computer and turn it on after, when reading the usb port you'll restart the Arduino and might loose important data.
yeah both of them can be used. If you want to upload the code in arduino then simply use the usb cable otherwise keep it on adapter. it wont harm the device.
What I personally do is, I keep on plugging the adapter and remove the usb once I am done with uploading and then test it as normally the usb cable is quite small and I normally work on robots so I need long wires.
if you want just plugs it in, it's ok but Arduino board will chose one and usb has priority to other power source.
********* Very important :*****
if you are controlling other circuits, that are connected to an external power supply, with your Arduino and connecting it to your PC's usb, Arduino will have potential difference and it will cause current flow that will damage your PC and Arduino board. if you want to do such thing, you have to shield your Arduino board from your other circuits that you want to control and they have external power source. this could happen with optocouplers for digital ports, non signal analog ports with shield relays, and complex analog circuits for analog signals

Combine RPI and Arduino

I have a few questions about rpi and arduino.
1. Is it possible to provide arduino and rpi two-way communication? (Sending data from the sensors to the Arduino and from arduino to RPI and processing information on RPI).
2. Can i use sensors from Arduino on RPI?
3. Can I programming RPI using C++ (such an as Arduino)?
Yes, checkout the ArduPi project. Serial communication (a USB cable) between the two is a fairly simple way to get started. It provides bi-directional communication between Raspberry and Arduino. And yes, you can compile C/C++ on the Raspberry Pi (but in most cases, you cannot directly reuse C/C++ for Arduino directly on the Pi, as it might use some special .h files not available on the Pi).
Yes it can. Just use I2C Bus (or Two-Wire). By TWI You can easily communicate Rpi and Arduino.
You can directly read the Arduino through the USB serial port. There is a Linux board I came across that you plug directly on top of your Arduino like a shield (It's called the Rubix) .
Of course it is, Uart , I2C or SPI.
I highly recommand Uart.
1.The library GPIO has demo of Uart Communication.
2.You can use USB to connect the serial port.
you can follow this tutorial to make it run
https://electrosome.com/uart-raspberry-pi-python/
Yes you can communicate using I2C. There should be a wired connection between RPi and Arduino to communicate using I2C. If you wanna try wireless communication you can use ESP8266 13 arduino wifi shield.
https://www.tindie.com/products/doit/esp8266-esp-13-wifi-web-sever-shield-for-arduino/
Otherwise you can use a ESP8266 module replacing arduino and you can communicate bidirectionally using wifi.
Most sensors that work with the Raspberry Pi, also work with Arduino and other boards like it.

Is it possible to use Arduino 2560's serial/USB communication without Arduino bootloader?

I have an Arduino 2560 and would like to send serial data to my PC. However, I am currently not using the Arduino Bootloader because I wanted to use a program that I wrote for an Atmega644 before (as far as I understood, one has to use the Arduino language when using the Bootloader?).
Does anyone know if what I am trying to do is possible with reasonable effort?
Connection to PC via 2560's serial0 does not depend on bootloader (if you plan connection when main program is running). You need 16u2 running to bridge 5V serial UART to USB or you can of course use any other option (e.g. MAX232 or so) to convert 5V UART to USB or RS232. But in case of RS232 double check baud rate error because of 16MHz crystal for particular baudrate.
2560 bootloader just implements firmware flash.

What happen when use rs232 instead of usb in arduino?

I just start a project which is very basic actually. But I need an information. It is about arduino serial communication. Here is the question.
If I connect arduino to computer using TTL to RS232 converter without USB cable then can I still use serial monitor to get some data or what happens ? Assume arduino is programmed before using usb cable, and it is powered externally when usb is not used.
for instance the code just
Serial.println("It is working");
delay(1000);
Thansk a lot.
you will fry it. Standard RS232 use a +-12V level, while arduino use TTL level (0-5V), so you still need a RS232 -> RS232TTL converter. If you use it, then using virtual serial over USB or real hardware serial is exactly the same, except that hardware serial port never appear/disappear when you plug in the arduino (there is not something like plug'n'play in rs232, it is always plugged)

Resources