Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:43 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PicoMite USB(CDC) Bridge

Author Message
BishopXXL
Newbie

Joined: 13/01/2019
Location: Germany
Posts: 34
Posted: 11:37am 08 Apr 2022
Copy link to clipboard 
Print this post

Hello,

It's me again ;)
I have a question....hopefully not another stupid one like last time.

I would like to use the USB(CDC) from the Picomite
to build a USB bridge. (PC)->(Picomite USB -> COM2)->(RS485 with RE/DE)
I redirected the console with the command "OPTION SERIAL CONSOLE COM1,GP0,GP1".
So now to the question: Can I read/write the free Picomite USB(CDC) via a basic command???

Thank you BishopXXL
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 11:53am 08 Apr 2022
Copy link to clipboard 
Print this post

No - sorry: But do you really need to? You can address the console with the same commands as any other com port. Print, input etc. In addition you have extra capabilities like ON KEY.
 
BishopXXL
Newbie

Joined: 13/01/2019
Location: Germany
Posts: 34
Posted: 12:22pm 08 Apr 2022
Copy link to clipboard 
Print this post

Hi Peter,

Yes, thanks for the reply, I'll try to implement it that way !
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 01:09pm 08 Apr 2022
Copy link to clipboard 
Print this post

You'll probably find INKEY useful.

To send back to the host over USB you probably want PRINT with a final semi-colon.

(Peter's code makes the fact it's USB essentially irrelevant.)

John
Edited 2022-04-08 23:10 by JohnS
 
BishopXXL
Newbie

Joined: 13/01/2019
Location: Germany
Posts: 34
Posted: 09:30am 09 Apr 2022
Copy link to clipboard 
Print this post

Hi John,
Thank you for the tip with INKEY . I will try it. I only had concerns that the incoming data stream, which can also contain a "Ctrl-C" (0x03) can interrupt the program ;)

BishopXXL
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 10:01am 09 Apr 2022
Copy link to clipboard 
Print this post

  Quote  I only had concerns that the incoming data stream, which can also contain a "Ctrl-C" (0x03) can interrupt the program ;)


OPTION BREAK 0
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 10:32am 09 Apr 2022
Copy link to clipboard 
Print this post

  matherp said  OPTION BREAK 0


What if the incoming data stream can contain a NULL, or an I missing something?

Best wishes,

Tom
Edited 2022-04-09 20:33 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
BishopXXL
Newbie

Joined: 13/01/2019
Location: Germany
Posts: 34
Posted: 10:57am 09 Apr 2022
Copy link to clipboard 
Print this post

Hi Tom,

this is a snippet of the dates that would come, yes 00 and 03 too





BishopXXL

P.S.

oh, i could also transfer the data in .hex then it wouldn't be a problem ;)
i'll just try it out, i'll get back to you if it works ;)
Edited 2022-04-09 21:04 by BishopXXL
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 11:09am 09 Apr 2022
Copy link to clipboard 
Print this post

  Quote  What if the incoming data stream can contain a NULL, or an I missing something?


From the manual:

  Quote  OPTION BREAK nn Set the value of the break key to the ASCII value 'nn'. This key is
used to interrupt a running program.
The value of the break key is set to CTRL-C key at power up but it can
be changed to any keyboard key using this command (for example,
OPTION BREAK 4 will set the break key to the CTRL-D key).
Setting this option to zero will disable the break function entirely.


In the code:

if (BreakKey && ConsoleRxBuf[ConsoleRxBufHead] == BreakKey) {// if the user wants to stop the progran
MMAbort = true;                                        // set the flag for the interpreter to see
ConsoleRxBufHead = ConsoleRxBufTail;                    // empty the buffer
}
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 01:11pm 09 Apr 2022
Copy link to clipboard 
Print this post

  matherp said  Setting this option to zero will disable the break function entirely.


Thanks Peter, I'd managed to miss that in MMB4L.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025