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 : MM Basic & UBW32
Author | Message | ||||
Dinosaur Guru Joined: 12/08/2011 Location: AustraliaPosts: 311 |
Hi All Is the one and only usb port on the ubw32 accesable from within a MMBasic program to receive or send commands to a PC ? I want to connect a UBW32 permanently to an industrial cpu board with XPe on it. Then by writing a program for the UBW with MMBasic the commands from the cpu would change PWM or Freq outputs. Just using the standard UBW32 hex file I can set inputs and outputs, but nothing more. Regards Hervey Bay Qld. |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6101 |
The USB port acts like standard console input/output. As long as your PC application is able to handle error messages etc, there is no problem. Whenever your PC application opens the serial port, it will get the Maximite opening message. If that's a problem, you could send your data via one of the serial ports and a USB to TTL adaptor. I have had a Maximite hanging of a PC gathering all sorts of data ever since MM Basic V2.6 or 2.7 For my own application, I use a checksum but data errors are rare and usually caused by Windows doing something to upset the USB port. UBW32's are a good reliable choice for your application. Jim VK7JH MMedit MMBasic Help |
||||
Dinosaur Guru Joined: 12/08/2011 Location: AustraliaPosts: 311 |
Hi All Thanks for the reply Jim. I can simply keep dumping the input to garbage until no further input, then when sending a command, the response should make sense. Am I to assume that opening as console is the same as Random ? (Input & Output) In other words I can read the buffer in the UBW32 and write the response to the port using Print or Write ? Regards Regards Hervey Bay Qld. |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6101 |
Yes. The actual commands will depend on the programming language you are using. When you are using the Maximite USB serial port, the speed is irrelevant. With the MicroMite, you use a USB to serial adapter and then the speed used is relevant. Jim VK7JH MMedit MMBasic Help |
||||
Dinosaur Guru Joined: 12/08/2011 Location: AustraliaPosts: 311 |
Hi All Thanks for your prompt replies Jim. Regards Hervey Bay Qld. |
||||
Print this page |