PicoMite serial Input


Author Message
Mark
Regular Member

Joined: 26/11/2022
Location: United States
Posts: 99
Posted: 03:44pm 06 Jan 2025      

Thanks for all the replies. I was trying to use the INPUT command rather than writing my own input processor, but I'll take a look at that code.

As for the description of the INPUT behavior, that's what I was expecting, but not what I'm seeing. The keyboard on the terminal connected to the COM port does not respond. I make sure the terminal window is active and type, but nothing echos on the screen and pressing ENTER doesn't do anything.  I re-wrote the program to using INKEY$ in a loop, exiting as soon as something is received and as soon as I press a key, it responds, so I am sure that the COM port is working for both send and receive.

The reason I use a variable (_fileno%) for the file number is so that I can make one change (changing the value of _fileno%) to direct the output and input to the USB console or the COM port console.  When I run the program using the USB console (_fileno% 0) INPUT behaves as expected. I did try hardcoding the file number in the INPUT statement (INPUT #5, X$), but that didn't work either.

AFAIK, I am using identical parameters for both instances of the terminal programs (one for USB, one for COM).

I just tried the same MMBASIC program using two instances of PuTTY running on Windows 10. I see the same thing,
INPUT works on the USB terminal, not on the COM terminal.  I've also tried two different terminal programs on the Mac (screen and minicom), no joy.

When opening a file in MMBASIC, you have to specify whether the file is input, output or both. I don't see a similar option when opening a COM port. Do you need to tell MMBASIC that the COM port is used for both input and output?

Thanks,
Mark