serial

ARM LPC1768 UART0 configuration problem, wrong baud rate.

My baud rate should be 115200, but it is 892.9 void UART0_Init(int pclk, int baudrate) { unsigned long int DLest; //unsigned long int pclk; unsigned int temp; // Turn on power to UART0 SC->PCONP |= PCUART0_POWERON; // Set PINSEL0 so that P0.2 = TXD0, P0.3 = RXD0 PINCON->PINSEL0 = (PINCON->PINSEL0 & ~...

Serial port loopback/duplex test, in Bash or C? (process substitution)

Hi all, I have a serial device set up as loopback (meaning it will simply echo back any character it receives), and I'd like to measure effective throughput speed. For this, I hoped I could use time, as in time bash -c '...' where '...' would be some command I could run. Now, the first problem is that I want to use the device at 2...

SetCommState failing on Windows 7

We have code that talks to our USB COMM class device, which works fine under Windows XP but is failing under Windows 7. Specifically the call to SetCommState is failing. Here's a simplified snippet. Note that in this case we don't even change any fields from GetCommState, but the result is that SetCommState fails with an error code of 87...

Serial Interfacing over IP for medical devices

Looking for help to connect and record and real time monitor the parameters data during the patients treatment. All our machines have a serial port and the manufacturer has provided us with the machinne serial communication protocol but it is all greek to me. Need someone to fill in the pieces and help with the connection and programming...

Serial Programming for POSIX, non-standard baud rate

I am implementing a simple program in unix that takes a RS232 input and saves it into a file. I've used these references: http://en.wikibooks.org/wiki/Serial_Programming/Serial_Linux http://www.easysw.com/~mike/serial/serial.html #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <termios.h> #include...

C++ Serial Blocking Read

I'm trying to create a C++ serial port class for a project that i'm working on. Unfortunately I'm stuck. I need the user to be able to specify if the port read function is blocking or non-blocking. So when the user creates a port object they specify a flags variable. If flags is set then the read should return -1 if there is no data at t...

.Net SerialPort still locked after application is killed

I have an application which calls SerialPort.Open() ... This works fine and data is read/written through the port. However if a user decides to kill the Application through the TaskManager the application will close without calling my destructor calling SerialPort.Close(). This in turn (only sometimes) causes the following error: Acces...

The connection of bluetooth with multi devices using SPP

Hi ~ I could connect to two devices from Android based cell phone simultaneously using SPP, but once I turn on the inputstream (like socket.getInputStream()), one of them will return 0 in the stream, that is, no data available on the stream. For example, thread A(thA) and thread B(thB) connected to device A(devA) and device B(devB) res...

What serial file transfer protocol to use?

I'm looking for some input on witch file transfer protocol to use over a serial line. I want to be able to transfer files of max 200 Mb size over a serial line (RS232) in both directions, but only one of the machines needs to be able to initiate the get/put (think master-slave). The protocol also needs to be: Easy/simple to implement sin...

C#: How do I get the ID number of the last row inserted using Informix

I am using the Informix.NET driver (C#) to insert a row into a database table. This works fine, except I have no idea how to get the ID of the last inserted row: Insert Command: //Sample Query: "INSERT INTO names (id, name) values (0, 'John Smith');" public static void Insert(String query) { try { ...

pySerial getting writeTimeout exeption when sending data

Hi, I'm getting a writeTimeout on a serial connection using pyserial. I have googled a lot and so far i have found nothing. I thought some other might have had the same problem and solved it. However here is my example code ser = serial.Serial('COM10', baudrate=115200, timeout=2, ...

Cannot send character with minicom

Hi all, I'm using minicom to connect through a serial link to a target (UART link of a sparc processor). With gtkterm or cutecom, I can connect, read and send characters. The only issue with them is that they both insert empty lines after each LF character, and : -gtkterm cannot record output to a file -cutecom does not "flush" after r...

C language, serial port reader.

hi, I want to make a program that reads a serial port (V.24). with the info from the serial port i need to split a string up. and add it to an mysql database. I don't know C very well, so i need some help with what functions should i use. The program has to run under windows xp, and i have to make it an service. thanks, Sebastian ...

Managing usb-serial converter device name

Hello everyone: I have a problem with USB-serial converters.I'm developing an app for a stand-alone surveillance station,connected to several peripherals trough serial port. My embedded PC has only one serial port, so i must use at least 2 usb-serial converter. When i plug one of them, ubuntu automatically generates the device name in...

Ubuntu pl2303 usbserial overflow?

Hi, I am connecting a currentcost electricity monitor to my ubuntu server and am using the method to connect as described here ... http://martgadget.blogspot.com/2009/09/putting-your-watts-on-web.html Now, I am also having the same problem as described here ... 2010/01/putting-your-watts-on-web-part-2-for.html (same domain ... can onl...

How to connect properly to an Optivote device through a local socket connection?

Optivote IR8 is basically a voting system with a bunch of remote controllers, which can send IR signals to a receiver, which is connected to a computer through a USB port. And I'm trying to write my own little software for that with Flash. Optivote receiver communicates with software through a virtual serial port. When I connect to that...

How to make the read function not to hang?

I'm using socat to create a virtual serial port with: socat PTY,link=/dev/ttySV0,echo=1 PTY,link=/dev/ttySV1,echo=1 The in my program written in C++, I open the ttySV1 port and start to read. The read function is in a while, but the problem is that the read function hangs until I send data to the port. Do you know how to make the tah...

Netmf SPI master to Pic18f4550 slave synchronization problem (C18)

A .NET Micro Framework device (ChipworkX in this case) sends a byte through the SPI interface to a Pic18f. Having PIE1bits.SSPIE enabled the following code is executed on interrrupt: void high_isr (void) { PIE1bits.SSPIE = 0; PIR1bits.SSPIF = 0;// Clear interrupt flag LATDbits.LATD5=1;//enables led for high interr...