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 : CMM2 Terminal Software
Page 2 of 5 | |||||
Author | Message | ||||
JimDrew Newbie Joined: 07/10/2020 Location: United StatesPosts: 39 |
Thanks for the response. Good to know that line numbers are supported. :) Is there any difference in the speed of the interpreter when using labels vs. line numbers? Is the source code to the OS available? Unfortunately, there is really no way (short of reducing the baud rate) of insuring fast serial communications to a RS-232 device without having flow control. You can check the buffer on the transmit side, but that is not going to tell you if the receive side (the RS-232 device) can't accept anymore data. This seems like a simple fix where the ARM's UART (or code that works with the UART) just checks the state of an I/O pin before transmitting a serial character. If it's set, then hold off sending it until the line is cleared. This is also something that should probably be allowed to be inverted. Some RS-232 devices expect RTS and CTS to be different polarities from normal. For example, Commodore's C64's data lines for flow control are backwards from the norm. There are a few quirky devices out there. I am sure that flow control the other direction would be beneficial as well, especially at high baud rates and other interrupts are running. I am looking forward to tinkering with this. Edited 2020-10-07 17:04 by JimDrew |
||||
RetroJoe Senior Member Joined: 06/08/2020 Location: CanadaPosts: 290 |
OMG, that’s awesome - well done :) That spinning text cursor is 100% Pure Nostalgia! Enjoy Every Sandwich / Joe P. |
||||
lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3010 |
Note that there is no OS--just Basic. The source code to the latest official release is available on Geoff's site: CMM2 Home But development continues so hot and heavy that the "latest release" is not the "latest beta". Edited 2020-10-07 22:47 by lizby PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
frnno967 Senior Member Joined: 02/10/2020 Location: United StatesPosts: 104 |
I believe there's a little bit of circular reference thing going on because the links for source on the maximite site refer to his mmbasic.com site, but on mmbasic.com there are links referring back to the maximite site. Probably best to fill out the form on this page to request the source, or email him directly. There might be some purposeful obfuscation afoot Jay Crutti: Ham Radio Operator, K5JCJ. Computer Enthusiast. Musician. Engineer. |
||||
RetroJoe Senior Member Joined: 06/08/2020 Location: CanadaPosts: 290 |
Note that there is no OS--just Basic. It should be noted that MMBasic includes a number of DOS-like commands for manipulating directories on the SD card, as well as an integrated (and excellent) full-screen editor. But, everything is purpose-built to support the MMBasic interpreter i.e. it is not a generic operating system, and you can’t directly run ARM compiled code (but, you can extend MMBasic with machine code using the “CSUB” function). Enjoy Every Sandwich / Joe P. |
||||
elk1984 Senior Member Joined: 11/07/2020 Location: United KingdomPosts: 227 |
So many ideas, too little time, Tom One of my three projects in flight at the moment. I've recreated the Mode 7 font complete with graphics, and I know the format used by by wxTed (for Teefax). I'm in the process of writing a page creation programme and a viewer - although hooking it into a real BBS server is beyond me, I was going to use it standalone with an IR remote as a "kiosk". Screenshot is from wxTed, I'll try and post at least a static from my program later this week. |
||||
JimDrew Newbie Joined: 07/10/2020 Location: United StatesPosts: 39 |
Although the source code is an interpreter it also has to setup and handle all of the ARM functions, including the UARTs, USB, etc. There is a LOT more to the source than just a BASIC interpreter. I have sent off a request to get the source code, and an email to Geoff. Thanks for the link. I am still trying to figure out if the v1.5 main board is the board I should build or if there is something newer/better? |
||||
frnno967 Senior Member Joined: 02/10/2020 Location: United StatesPosts: 104 |
From viewing the CMM2 Construction Pack file it appears that v1.5 is the current SMD model that most people are selling. Not sure if the files in that ZIP are the latest rev, but it's probably functional and usable as is. Note that I'm in no way tied to the development of the system, just interpreting what's on the website. Can someone involved in the hardware design chime in here? Jay Crutti: Ham Radio Operator, K5JCJ. Computer Enthusiast. Musician. Engineer. |
||||
elk1984 Senior Member Joined: 11/07/2020 Location: United KingdomPosts: 227 |
If it's in MM Basic I've found they're supported but only as labels. A test of 10 PRINT "Welcome to my program" 5 PRINT "Ta dah!" 20 PRINT "Goodbye" Outputs Welcome to my program Ta dah! Goodbye But I may be wrong.... |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5886 |
If it's in MM Basic I've found they're supported but only as labels. A test of 10 PRINT "Welcome to my program" 5 PRINT "Ta dah!" 20 PRINT "Goodbye" Outputs Welcome to my program Ta dah! Goodbye But I may be wrong.... No you are right (more or less) Once-a-pon-a-time, you could enter lines of code at the command prompt and if they started with a number they were added to the program rather than being executed immediately. You could enter them in any order and they would get sorted for you. That feature has been buried. MMBasic can read and run a file with line numbers but it is up to you to do the assembly and sorting. The ability has been retained to make it easier to run 'historic' code. Using code with line numbers is not going to end nice... Jim VK7JH MMedit  MMBasic Help |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5886 |
I am looking forward to tinkering with this. Very easy to do in Basic. It will not be a problem. Jim VK7JH MMedit  MMBasic Help |
||||
JimDrew Newbie Joined: 07/10/2020 Location: United StatesPosts: 39 |
Well... I got the source code, setup STM32CubeIDE and I am able to compile everything without any issues. I now just need a board! Jim ::EDITED:: BASIC has nothing do with this. This is something that has to be enabled and supported in the UART hardware module itself. The ARM datasheet shows that the flow control is available and can be enabled (not a surprise). That's the good news. The bad news is that according to the pin-out on page 10 of the Maximite 2 manual, there is no provision for RTS/CTS for any of the UARTS on the expansion port. A new board would have to be made with a new expansion header. I would make that header have Rx/Tx/RTS/CTS/DCD lines. That would give you the basic requirements for a terminal program or BBS program. With a new board design you might as well add the level shifting hardware built-in (MAX232 or similar). Are people flashing these boards initially through a JTAG header or something? I have not worked with the STM32 stuff before, so I am not sure what is needed for programming these. Edited 2020-10-08 08:47 by JimDrew |
||||
lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3010 |
CMM2 Manual, Appendix G – Loading the Firmware PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
JimDrew Newbie Joined: 07/10/2020 Location: United StatesPosts: 39 |
Thanks! Like I said, I am a newbie to this project. I have been developing microcontroller based products since the late 90's, producing more than 300 commercial products. This is a first for STM32 stuff, which is something I wanted to look into, so this works out perfect for me. |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1592 |
said TassyJim is correct. It is very easy to allocate pins for CTS and RTS and manipulate them in BASIC. Bill Keep safe. Live long and prosper. |
||||
JimDrew Newbie Joined: 07/10/2020 Location: United StatesPosts: 39 |
Good news! Pins 16 & 37 of the expansion port can be re-purposed for RTS/CTS. It just requires a code change. Pin 37 is labeled as COM1_DE. I am not sure what "DE" is since that is not listed anywhere in the datasheet, but this pin is connected to the ARM's PA1, which can be USART2_DE or USART2_RTS. Pin 16 is labeled as COM2-Tx. This pin is connected to the ARM's PA0. So, COM2 is using USART4_TX. PA0 can be USART2_CTS. We need CTS to be functioning to throttle the CMM2 from sending data when the RS-232 device's buffer is full. PA2 and PA3 are USART2_Tx and USART2_Tx (respectively). In order to have RTS/CTS without making ANY hardware changes, the code would need to be changed so that when you open a new COM port (COM4?) that COM1 and COM2 ports are actually being used together as a single port. But, a code change is better than a hardware change if you want to get something running soon! Going through the source code you can see that none of the COM ports have flow control enabled, ie: huartx->Init.HwFlowCtl = UART_HWCONTROL_NONE; This makes sense because there are no pins assigned for this purpose from the ARM. This needs to be changed (and there is a provision for this in the source code), and then the proper pins assigned for RTS and CTS. However, as I stated above, this would limit the ports to a single port. There is nothing in the underlying OS or BASIC interpreter that allows RTS or CTS to be enabled or disabled. This is something done at compile time (or not, as it is now). A better solution for backwards compatibility would be a new board design. If a new board design was done, I would recommend using UART7 on PF6/PF7/PF8/PF9 (pins 24-27). These are currently not connected from the ARM to anything. I did find a new design of the board here: https://github.com/Manawyrm/CMM2-JLC I am modifying this board design right now to add a dedicated serial port (with flow control). A new COM port (I guess 'COM4') would need to be added to support this. Based on how well written this code is, I don't think this would be that difficult to do. Edited 2020-10-08 14:25 by JimDrew |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1592 |
COM1_DE is the "Driver Enable" output to be used when COM1 is used for RS-485. Bill Keep safe. Live long and prosper. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8569 |
Don't use a different board design with different pins - it won't be supported. As has been discussed repeatedly, the best way to kill this project is to have multiple H/W variants. Please also note the licence restrictions. You can only use the source code for your own personal use and may not distribute a modified version without approval which won't be forthcoming. RTS/CTS is a very specific requirement and has not been raised before in months of discussion on this forum. Moreover, it is not supported on any of the Micromite range and AFAIK has never been requested. It can be implemented in Basic code if required as could XON/XOFF |
||||
JimDrew Newbie Joined: 07/10/2020 Location: United StatesPosts: 39 |
Can you explain how this can be implemented in BASIC code? I have worked with RS-232 devices for more than 40 years, and never has it been possible to throttle the data *stream* (not a single byte FIFO) without having hardware intervention (flow control). The ARM provides this as a simple switch with no work required by the programmer. You just need to use two data lines with it. As I stated, this can be done right now without any type of change to the hardware using pins 16 and 37 on the expansion port for RTS/CTS. *I* have had numerous requests for me to look at adding this support this year, and this is not even my product! It's why I am here right now. If you have no plans/do not want to implement hardware flow control then that's fine, but please make this well known so that I am not contacted about this anymore. Thanks! |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3649 |
You'd use one or more pins read/driven by software to mimic RTS/CTS, I expect. (Or XON/XOFF if available.) John Edited 2020-10-09 06:23 by JohnS |
||||
Page 2 of 5 |
Print this page |