Search Forums by tag:
Serial, mbed, compiler, ethernet, USB, I2C, SPI, interrupt, LCD, library, bug, HTTPServer, CAN, AnalogIn, adc, Power, Ticker, memory, pwm, SD Card, InterruptIn, rpc, Error, SDFileSystem, PwmOut, LocalFileSystem, UART, canbus, driver, TCP, interrupts, rtos, led, libraries, editor, timer, accelerometer, GPS, file, clock, website, C++, SD, frequency, reset, http, LPC11U24, flash, SDCard, RTC, DigitalIn, TCPSocket, problem, printf, Java, Servo, buffer, UDP, SerialPC, DMA, HTTPClient, Sleep, audio, pinball, MODSERIAL, NetServices, socket, array, compile, filesystem, RFID, beta, m3pi, write, LPC1768, multiple, newbie, keyboard, sensor, GPRS, Forum, digitalOut, assembly, debug, hardware, Speed, xbee, AnalogOut, RPCFunction, EthernetNetIf, Download, code, voltage, wait, network, C, suggestion, JTAG, keil, MATLAB, offline, Board, lwip, I2S, dead, Nokia6610, time, bluetooth, WiFly, current, tcp/ip, MODDMA, SPI Slave, pololu, robot, Communication, read, dac, string, pc, binary, filter, copy, USB Host, publish, rs232, DHCP, Host, Data Logging, windows, firmware, malloc, mp3, PCB, gcc, attach, program, fatfilesystem, class, email, arduino, stepper motor, WavePlayer, wifi, Nokia, camera, size, VGA, import, documentation, ide, linux, baud, TextLCD, Cortex-M0, M0, pointers, pullup, Relay, timing, function, latency, serial port, MIDI, compiler error codes, magjack, touch, screen, Production, client, server, stream, HID, breakout, FIFO, prototype, flashing, GPIO, sampling, Analog, display, api, ADXL345, Encoder, DSP, help, motor, sram, suggestions, PING, Terminal, link, browser, Pin, control, Eagle, Modbus, EEPROM, mac, Timeout, fopen, port, updates, usbserial, batteries, DMX, files, USBMIDI, scanf, protocol, PPP, slave, FTP, integer, noise, MODGPS, modem, float, threads, motors, for, monitor, Digital I/O, 7, Windows Serial Driver, pins, keypad, FAT, classes, webserver, delay, variables, time-triggered, c programming, labview, watchdog, post, math, Battery, LPCXpresso, MBED website, GSM, storage, nxp, mobileLCD, license, int, counter, baseboard, Assembler, Vin, rj45, registers, E289, news, i2cmaster, amoled, Compiling, connect, revision, prototype to hardware, UMTSStick, Optocoupler, Robotics, search, oscillator, glitch, Websockets, load, find, real-time, routine, format, offline compile, powersource, driverlibrary, processing, networking, ID, umts, debugging, color, BUTTON, software, PS3, Images, wave, bin, const, SNMP, OSX, supply, peripheral, sensors, data, Design, PID, version, RIT, character, freeze, USBDevice, bus, ARM, wav, SRF08, heap, output, basic, TFT, QVGA, mysql, piezo, update, ID12, Pachube, player, DigitalInOut, object, cmsis, capture, IR, slow, 1768, PSP, OS, syntax, mbed.lib, EmbeddedArtists, NMEA, paste, project, Web, GUI, UART0, firefox, SQL, wakeup, RAM, bitmap, handler, security, 3D, bugs, OLED, Temperature, not, I/O, Bidirectional, rss, wireless, delete, resolved, LED1, LIS302, getc, Safari, Wi-Fi, wiki, PinNames, accounts, PS2, BusOut, projects, RS485, pythonHi,
I once tried talking to my mbed using a C++ code in windows.. i was able to send char data to mbed and set the 4 LEDs according to the lower 4 bits of the char... and I was able to echo back the same char saying "LEDs set as : A"
my source file included windows.h and dos.h.. the code established serial connection using the COM port..Obviouslt we cant use that headers in Linux.. i think something similar can be done in Linux..
http://sourceforge.net/projects/libusb/ try looking into this..
Will update.. i work on it..
Thank you Krishna,
Libusb looks like overkill for our purposes. Perhaps I'm naive, but I'd like to hope that Linux can directly handle simple serial-like data transfers over USB. If not, then I wonder whether a USB to Serial adapter could do the trick. I presume that support for serial communication is built into every Linux.
The Windows/DOS headers of course wouldn't help, but what did the rest of your code look like?
Thanks again.
This http://en.wikibooks.org/wiki/Serial_Programming/Serial_Linux link looks pretty interesting for explaining the Un*x APIs to use for interacting with serial (tty) devices with the C programming language.
From the command line you can 'echo' or 'cat' to and from /dev/ttyUSBx in C you would use fopen with fgetc/fputc as usual with /dev/ttyUSBx as filename (x is the number of the USB serial port, if no other USB serial adapters are attached it would be /dev/ttyUSB0)
There are ways to force the kernel to assign fixed numbers to the USB serial devices if needed.
I am using two USB-serial adapters on a mythtv backend system and the devices have not changed numbers yet, the default order seems to based on the USB hostbusnumber they are connected too.
Hii... Ive refereed the site below to write my code..
http://www.codeproject.com/KB/windows/mobileconnect.aspx
regards
I would like to digress a little. Has anyone managed to come up with windows communication with mbed via C/C++ without a terminal program?
Please log in to post a reply.
Hello all,
We would like to have a Linux computer talk with an mbed via its USB port, in order to transfer data and commands back and forth via a C or C++ program, NOT via a terminal. That is, we want the mbed to talk with a C/C++ program on the Linux machine directly.
On the mbed side, I presume the various Serial commands will do.
On the Linux computer side, I suppose that printf, etc., will also function once the right port is engaged (correct?). However, what I do not understand is how to get the Linux machine to recognize the particular USB port that the mbed will be connected to, or (frankly) any other details on how to establish that sort of serial communication. I also don't know which, if any, special libraries or drivers are necessary.
The Linux computer that we will use probably has old-fashioned serial ports too, if that would make things easier. For now, it will be running Slackware.
Can someone point me in the right direction?
Thank you!