English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 22 February 2021, 15:23   #1
amiga_amigo
Registered User
 
Join Date: Aug 2018
Location: Germany
Posts: 19
Serial port problem

Hello all,
i can't seem to get my serial connection with WinUAE 4.4.0 to work as it should - maybe someone can give me hint.
I need to send data to a piece of hardware using the following settings: baudrate 31250, 1 start bit, 8 data bits, parity even, 1 stop bit, no handshaking (not supported by hardware).
Everything works fine on windows but i can't get it to work from within WinUAE.
For debugging i've set up com0com (com1 <=> com2).

WinUAE IO-port settings:
com0com (com1) selected in Serial Port dropdown
Shared - unticked
RTS/CTS - unticked
Direct - unticked
uaeserial.device - unticked

WB serial preferences:
baudrate: 31250
input buffer size: 8192
Handshaking: none
Parity: even
Bits/char: 8
Stop Bits: 1
Applied "Use" and "Save"

echo "hello" >ser:

gives the following ascii output in a terminal on windows connected to com2:

A9,
68='h',
A8,
65='e',
A8,
6C='l',
A8,
6C='l',
A8,
6F='o',
A8,
0A='\n'

Tried various settings, none worked except if i switch to parity 'None'. Unfortunately this is not an option, since this setting is not supported by my hardware ('even', 'odd', 'mark', 'space' - all supported, but 'none' isn't).
What am i doing wrong? Is parity not supported / buggy? Any alternatives? I need to send data to the serial port from within the amiga shell...
Any help appreciated.

Michael
amiga_amigo is offline  
Old 22 February 2021, 22:48   #2
duga
Registered User
 
Join Date: Nov 2010
Location: Sweden
Posts: 471
What odd hardware are you using that doesn't support parity = none?
duga is offline  
Old 23 February 2021, 18:34   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,629
uaeserial.device supports parity. (But probably was never tested..)

Paula serial port emulation can't because Paula serial port parity is Amiga-side serial.device software feature so there is no way for emulator to know if data written to SERDAT is actually 8/9 bits or 7/8+parity bit.
Toni Wilen is online now  
Old 23 February 2021, 20:43   #4
amiga_amigo
Registered User
 
Join Date: Aug 2018
Location: Germany
Posts: 19
Thanks Toni,

so if i understand correctly, then sending data with parity is impossible from within WinUAE using serial.device due to this Paula thing?
Maybe using uaeserial.device? I read somewhere, that it's directly connected to PC-side comports (unit == portnumber).
Is it possible to use uaeserial.device from the shell (classic WBs 1.3 ... 3.1)? Is there a "compatible" handler to mount it e.g. as aux or whatever?
I'd like to use shell scripts to compile code and send the ouput via serial to the connected hardware.

Googled quite a bit for uaeserial.device but there's not much information...

Michael
amiga_amigo is offline  
Old 23 February 2021, 22:54   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,629
uaeserial.device unit 0 is first PC port, 1 second and so on. Otherwise it works just like normal serial.device.

But I am not sure if all PC serial ports support 8 + 1 parity bit mode. 7+1 would have worked even with emulated serial.device because there is no hardware level difference between 7+1 and 8+0.

I think there was some way to customize serial device name and unit to AUX handler via extra mount list entries but I don't remember it now. Or just hex edit l:aux-handler
Toni Wilen is online now  
Old 25 February 2021, 21:54   #6
Rock'n Roll
Registered User

Rock'n Roll's Avatar
 
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 46
Posts: 18
I want control the onboard LED on an Arduino over the WinUAE serial port.
But there is anything wrong.

I have the settings 9600,8N1,Handshaking none.
The output from WinUAE to a terminal is ok.

I send
1 or 0 for "1-LED on" and "0-LED off"
I can control the led on or off over the terminal.

But from WinUAE only the 0 "LED off" works.
By the command 1 the LED flashes but remains off.

This are the commands:
>echo >ser:"1"
>echo >ser:"0"
(also possible: echo >ser:"aawedew1ds" any 1 or 0 in this data)

Maybe anyone can check this?

(Test with Arduino Uno and Mega2560 with 9600 or 19200 and com0com)

Last edited by Rock'n Roll; Today at 19:28.
Rock'n Roll is offline  
Old Today, 19:28   #7
Rock'n Roll
Registered User

Rock'n Roll's Avatar
 
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 46
Posts: 18
I made some further tests and it works, when I make following:
In my case I have to COM-Ports
COM7: Arduino Mega 2560 (USB to USB)
COM8: USB Serial Port (its an USB to serial TTL cable with open pins)

If I write the serial commands direct to COM7 - there is any problem.
But if I take COM8 with the USB to serial cable and connected it
direct to the pins RXD,TxD and GND on the Arduino board then it works.

I tested with the commands:
SYS:>echo >ser: 0 for LED off
SYS:>echo >ser: 1 for LED on

In my Arduino code I write back the serial data.
if (Serial1.available() > 0) {
incomingByte = Serial1.read();
Serial.println(incomingByte);
...

And in the terminal I get following response for:
SYS:>echo >ser: 0
hex: 0x34, 0x39, 0x0D, 0x0A, 0x31, 0x30, 0x0D, 0x0A
and for
SYS:>echo >ser: 0 noline
hex: 0x34, 0x39, 0x0D, 0x0A, 0x30, 0x0D, 0x0A

Is there a DOS-command for only:
hex: 0x34, 0x39, 0x0D, 0x0A (or only hex: 0x34, 0x39) ?
Rock'n Roll is offline  
Old Today, 20:01   #8
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,629
I guess it is "echo" that adds the linefeed. (Not that this has anything to do with emulation or OPs problem..). Try for example copying properly formatted text file to SER: instead of using echo.

OP: If you really can't find any other solution, I can add config file option that forces Paula serial port emulation to always use specified parity and number of bits.
Toni Wilen is online now  
 


Currently Active Users Viewing This Thread: 3 (0 members and 3 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial Port? EugeneNine support.FS-UAE 5 23 February 2017 02:09
Debugging over Serial-Port sigma63 support.WinUAE 1 14 March 2016 20:02
Serial port, parallel port, and pipe device mount errors Samurai_Crow support.FS-UAE 4 13 March 2014 01:04
Serial Port Questions iainnitro support.Hardware 10 21 April 2012 17:03
How to test serial port? mmikko support.Hardware 2 05 February 2008 09:43

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:37.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.11668 seconds with 15 queries