[En-Nut-Discussion] Baud 19200 Rs232 port

Damian Slee damian at commtech.com.au
Wed Sep 8 02:33:03 CEST 2004


I think cause your using the debug port.

Try

	NutRegisterDevice(&devUsartAvr0, 0, 0); 
	g_rs232 = fopen("uart0", "r+b");
	fileno = _fileno(g_rs232);
	lTmp = 9600;
    _ioctl(fileno, UART_SETSPEED, &lTmp);

-----Original Message-----
From: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Sigurd Kleppan
Sent: Wednesday, 8 September 2004 5:10 AM
To: en-nut-discussion at egnite.de
Subject: [En-Nut-Discussion] Baud 19200 Rs232 port


I try to communicate throuth the rs232 port on the ethernutboard. I want the baudrate to be 19200. I have written this:

main(){
    u_long baud = 19200;
    u_char i = 0;
   FILE *uart;

	// Initialize UART
    NutRegisterDevice(&devDebug0, 0, 0);
    freopen("uart0", "w", stdout);
    _ioctl(_fileno(stdout), UART_SETSPEED, &baud);
    NutSleep(200);}

I write to the rs232 port by using the "printf" command, but when i use the Terminal program I only get words by using the 115200 baud. It happens nothing when i use 19200 baud.

Is it something I write wrong, or is it any other variables i have to change to get baud 19200? What about stopbits and handshake?

Thank you!
Sigurd Kleppan



_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004
 



More information about the En-Nut-Discussion mailing list