![]() |
Forum Index : Microcontroller and PC projects : PicoMite USB(CDC) Bridge
Author | Message | ||||
BishopXXL Newbie ![]() Joined: 13/01/2019 Location: GermanyPosts: 34 |
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 KingdomPosts: 10315 |
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: GermanyPosts: 34 |
Hi Peter, Yes, thanks for the reply, I'll try to implement it that way ! |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
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: GermanyPosts: 34 |
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 KingdomPosts: 10315 |
OPTION BREAK 0 |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
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: GermanyPosts: 34 |
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 KingdomPosts: 10315 |
From the manual: 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 KingdomPosts: 4311 |
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 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |