Quick question, I am new to socket, so I was wondering is there a way to read data from a MCU (Atmel)? I'm running a Linux and I can connect an Atmel through RS232
, or USB to my computer(server). Is there a way that I can directly read the data that is coming from MCU (USB/COM) to my computer and process them?
Asked
Active
Viewed 385 times
0

lmcanavals
- 2,339
- 1
- 24
- 35

Bobby
- 31
- 10
-
2Yes, you can. What on earth sockets have to do with this? – Jan 19 '13 at 02:56
-
1@user1622997 .... any comment or reaction on my answer .... useful or not? – MikeD Mar 25 '13 at 09:14
1 Answers
1
Sockets are a concept of network communication (IP), so you would need network interfaces on both devices, plus an IP protocol stack on your Atmel (which may be the case for larger boards running a real operating system, e.g. embedded Linux).
If your Atmel has an USB interface, and if it implements a USB storage device, you can probably mount the Atmel to your server.
Otherwise (i.e. with a bare naked processor + peripherals, but no O/S) you really need to architect a solution from scratch - then a serial interface using the Atmel's UART function would be quickest to implement.
On the (Unix/Linux) server side you simply can use a character device to read in the data from serial or USB - e.g. cat < /dev/ttySxx >> SerPort.txt

MikeD
- 8,861
- 2
- 28
- 50
-
2MikeD, you are only nearly correct in all you statements. Sockets can also be used for inter-process communication. You don't need an OS to do network communication, only a network stack. MCU's rarely implement USB storage for communication, though it has been know. You can not just cat a serial port, you have to set it up with stty first. – jbr Mar 25 '13 at 09:22
-
@jbr agree on sockets (+1) ... still it needs a kind of OS on the micro which cannot be taken for granted - so once the architectual circumstances are clarified, I guess we're happy to answer more concrete questions to the OP (including how to initialize a tty port) – MikeD Mar 25 '13 at 15:19