TOP
SSV Software Systems Register  Register
Log in to check your private messages  Log in to check your private messages
Startseite FAQ Search Mitglieder Profile  Log in 
SSV Support-Forum
UART zum empfangen von daten eines Microcontrollers

 
Post new topic   Reply to topic    SSV-Forum Forum Index >>> DNP/2486
<<< Previous topic - Next topic >>>  
Display posts from previous:   
Author Message
M_BW



Joined: 06 Feb 2012
Posts: 6

PostPosted: 04.04.2012, 14:26    Post subject: UART zum empfangen von daten eines Microcontrollers Reply with quote

Ist es möglich die UART- Schnittstelle des DNP2486 so zu konfigurieren das Daten eines Microcontrollers (Atmel ATmega8) empfangen und verarbeitet werden können?

Wenn ja wie??
Ich hab leider nichts zu diesem Thema in den mitgelieferten Dokumenten gefunden.

Vielen Danke im Vorraus
Back to top
View user's profile Send private message
hne



Joined: 11 Jul 2008
Posts: 210
Location: Hannover

PostPosted: 10.04.2012, 12:39    Post subject: Reply with quote

Der UART wird wie bei jedem Linux über ioctrl parametriert. Beispiele dazu gibt es in serial-demos.tgz.

Viele andere Beispiele ändern alle Flags ("z.B. "c_cflag") der Struktur termios einzeln. Die einfachste Art ist aber cfmakeraw wie in rs485demo.tgz zu benutzen.

Im groben Prinzip:
Code:
struct termios termios;
int fd;

fd = open ("/dev/ttyS0", O_RDWR);  // open device
tcgetattr (fd, &termios);  // Get actual device configuration
cfsetospeed (&termios, B19200); // set Speed
cfmakeraw (&termios); // Disable Echo, 8 Data, 1 Stop, no parity, no handshake
tcsetattr (fd, TCSANOW, &termios); // set new configuration


Bitte bedenken, dass das serielle Gerät /dev/ttyS0 in eigenen Programmen nur benutzt werden kann, wenn kein anderer Prozess (z.B. getty, der Login) diese Schnittstelle geöffnet hat, der RCM-Jumper also gezogen wurde.
_________________
Henry Nestler
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    SSV-Forum Forum Index >>> DNP/2486 All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

SSV Software Systems GmbH

Dünenweg 5
30419 Hannover

Fon: +49(0)511  ·  40 000-0
Fax: +49(0)511  ·  40 000-40

sales@ssv-embedded.de


Impressum    ·    Datenschutz    ·    AGB

© 2023 SSV SOFTWARE SYSTEMS GmbH. Alle Rechte vorbehalten.

ISO 9001:2015