Communications arduino(serial) from Assembler

Hi everyone,

I'm trying to send data to arduino from assembler (8086 -windows).

I can read data but write doesn't work. I always receive 80H in AX, this is the code:

send proc
MOV AH,00 ; init port
MOV AL,11101011b ; 9600, N,1 bit stop, 8 bit data
MOV DX,00 ; com1
INT 14H
MOV AH, 1 ; write function
MOV AL, 'S' ; char to send
MOV DX, 00 ; com1
INT 14H
RET
send endp

This is the code to read, which works perfectly

recibir proc
push bx
MOV AH,00 ;inicializar el puerto
MOV AL,11110011b ; velocidad 9600, N,un bit de stop, 8 bit de datos....
MOV DX,00 ; puerto com1
INT 14H

Esperar:
mov dx,0000
mov ah,03h
int 14h
test ah,01h; si el bit 1(dato listo) esta puesto a cero no hay dato listo
jz Esperar ;salta y vuelve a verificar
mov dx,0000
mov ah,02h
int 14h
mov car, al
pop bx
ret
recibir endp

Regards

Would it be wrong of me to suggest you should be posting in an Intel forum?

like you want, i put my question here because i think the problem has to be with the serial of arduino.

But you've posted only 8086 assembler.

yes, i think the problem is how i configure the serial in the asm, and i want to know if this configuration is ok in order to know with the arduino

recibir proc
    push bx
    MOV AH,00 ;inicializar el puerto
    MOV AL,11110011b ; velocidad 9600, N,un bit de stop, 8 bit de datos....
    MOV DX,00 ; puerto com1
    INT 14H
   
Esperar:  
  mov dx,0000
    mov ah,03h

Are you calling this at "recibir" or at "Esperar" ? You can't re-initialize the PC's uart to 9600,n,8,1 each time you want to receive a character; it will end up throwing away any buffered characters...

Thanks,

I'll change the receive function so the inicialization happens one time. But what's wrong with send?

Oh. It wasn't clear which one wasn't working. It's been a long time since I've worked with the bios calls for serial (they were awful back then; I bet they're still awful.)
I'm looking at http://maven.smith.edu/~thiebaut/ArtOfAssembly/CH13/CH13-3.html for reference. Have you tried the bit where you use the status call to get more details on the error? An error code of 0x80 (no other error bits) seems to imply a timeout error; do you have the serial pins jumpered to fake the required HW flow control? My memory says the PC uart won't transmit without "true" signals on the incoming modem signals; the usual trick for connecting to a three-wire device is to short together RTS, CTS, and DSR...

yes, that's the key. I'm only setting the parity (N), baudios(9600), stop(1 bit) and length of word (8 bits).

So i'm sure that the problem has to do with that, but i'm searching and i don't find anything.

i.e i'm looking in http://lrs.uni-passau.de/support/doc/interrupt-57/INT-14.HTM

best regard.

I really grateful your help

I don't think there is a way to turn off the requirement that DSR be TRUE before transmit can occur from software. There aren't a lot of errors that can occur on transmit; is the time it takes to return from the bios call consistent with a "timeout" rather than some more short-term error?