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: Bug reports
Page 15 of 17 | |||||
Author | Message | ||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Your diagnosis is wrong but your observation may be relevant. Normal and conservative both take effect when you do them. However, the SDcard won't be in the same state depending on whether the power has been cycled. AFAIK most people having SDcard problems are using CGs boards which don't have a power switch. Power on is therefore when you plug in the USB cable which is inevitably going to be noisy and unclean. Please can you try fitting a power switch to the PCB, just a normal switch on a flying lead will do, set the SD timing to normal and switch on the board with the switch and see what happens. I have 8 CMM2 with a complete mixture of Y chips V chips, Waveshare and all-in-one PCBs (V2.1 and V1.5 respectively), and like KeepIs numerous different SDcards from 2GB up to 128Gb and they all work perfectly on all CMM2 at normal setting. For the avoidance of doubt NORMAL mode uses a clock speed of 195.312KHz for initialisation (50MHz / 256) and 25MHz for normal running |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1593 |
That's a good point Peter. Without a switch the supply start up will likely be more noisy and slower. Those with a switch could simulate that by leaving the switch on and powering off and on by the power point switch. Bill Keep safe. Live long and prosper. |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5914 |
To test the CMM2s long line capabilities, I add extra capacitance to the pin 40 and turned on. First with 250mm IDE ribbon cable into a breadboard: Next as above plus 39pF Next as above but 0.01uF Finally 0.22uF The ringing is most likely the switch bouncing. It occurred with all capacitors and only some times. In all cases, the spike in voltage on the pin was fully ended in 500uS The startup sequence now checks 3 times at 100mS intervals so I don't think long lead capacitance is going to cause any problems. Re your option 2. The serial port only comes on when power is applied so it would be difficult to send anything during port enumeration. Jim VK7JH MMedit  MMBasic Help |
||||
KeepIS Guru Joined: 13/10/2014 Location: AustraliaPosts: 1373 |
For what this is worth: I don't have a power switch, the board just powers up with USB, or when I plug into the port. HOWEVER: My SD card holder, running from USB 5v in, has a 3v3 regulator with filter caps, so at power up via USB it's getting a clean power state, and like Peter, every SD card I throw at it works. EDIT: Been a while since I looked at the Schematic, but the SD card holder in the supplied units is also run from the CPU 3.3v regulator, so unless there is some instability there (and I see none from mine) there may be another issue. . . Edited 2020-06-19 19:16 by KeepIS It's all too hard. Mike. |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 3850 |
Thanks Jim, My bug report wasn't because I can't read the function keys it was about not having them behave in undesireable or unexpected ways (I noticed because I have an unfortunate tendency to hit F11 on the Logitech K270 when I'm reaching for the Backspace). I believe the current behaviour is undesireable because the Fn key definitions are specific to things the user might want to do at the command prompt and are unlikely to want to do from within a running BASIC program ... though perhaps if they were all programmatically defineable (with a command extension of OPTION to return them to their defaults) then that could be a useful feature. I believe the current behaviour is unexpected because the Fn keys don't even behave the same as they do at the command prompt, c.f. F10-12. I have a suspicion they are producing the output expected from an earlier 'mite. Regards, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
GregZone Senior Member Joined: 22/05/2020 Location: New ZealandPosts: 114 |
This is an interesting observation. Just acknowledging I've seen your request, but it's getting late so I'll give this a try in the morning and report back. |
||||
GregZone Senior Member Joined: 22/05/2020 Location: New ZealandPosts: 114 |
Nice work Jim. I had considered doing the same observations, but after confirming with the datasheet that the internal pull-ups are nominally 40K, and knowing that likely PCB capacitance would only be in the 10's of pf, some maths told me that the slew rate would be (at worst) in the order of 10's of microseconds. ie. Certainly well within the 100ms settling delay that was coded. So it remains a bit of a curiosity what is actually going on here. |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 3850 |
Dear Peter, Apologies for resurrecting this from 7 pages past: I have this problem demonstrated by Z-MIM Release 1: 1. Start minizork 2. Type "restart" and "Y" to confirm 3. Start minizork 4. Type "quit" and "Y" to confirm You get the error: [execute:24] Error: EXEC is not declared which is decidedly odd because execute:24 is inside the EXEC function. I believe this is because "restart" is implemented simply as a call to "RUN" to re-run the current program and that the new instance is "troubled" so it misbehaves when it ENDs. I think you said this is legal, if inefficient, in which case it looks like the above demonstrates a firmware bug. Is this something you might look at and fix? or should I just rewrite so I don't need to call RUN? which I might end up doing anyway. Best regards, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Not without a much simpler example. My little test version below works perfectly. Really I need something that fails that I could also run on a MM2. a=exec( 1) run function exec(a) as float local b,c exec=3 if exec=3 then print "hello" end function Edited 2020-06-19 22:04 by matherp |
||||
zeitfest Guru Joined: 31/07/2019 Location: AustraliaPosts: 388 |
Any illumination on this ? [ Not being expert in the two Basic argots ...I am assuming that both show problems ie GW not handling line 6 fully and MM ditching at 7 / 8 (?) ] |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2290 |
my assumption is that GW-basic is canonical, however the MMbasic deviation is actually more useful in practice, allowing for the rather useful 'jam on toast' case. the end result, there are THREE if-then[-else] variants in MMbasic: 1. IF conditional THEN statements (no else, all statements after THEN are executed if conditional is true) 2. IF conditional THEN statement1 ELSE statement2 [: other_statements] (conditional true: execute statement1, conditional false: execute statement2, in both cases, always execute other_statements if present, no more than one statement is allowed between THEN and ELSE) 3. multi-line if-then-else the latest CMM2 manual kind-of-mostly explains this. cheers, rob :-) Edited 2020-06-19 22:54 by robert.rozee |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 3850 |
Dear Peter, Try this for size: Function exec(a) As Float Local s$ Do Line Input "Run again [y|n] ", s$ s$ = LCase$(s$) Loop Until s$ = "y" Or s$ = "n" If s$ = "y" Then Run exec = 1 End Function Sub main() Cls a = exec(1) End Sub main() Run and answer "y" followed by "n" to get this error: [17] Error: Nothing to return to It's not the same error message, but it has the same "feel" of the interpreter having lost context so I suspect it's the same issue. Regards, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Robert's explanation is entirely correct. The remaining issue which I've discussed with Geoff is that invalid versions are not always errored as you might expect and he is intending to look at this in the future. Of course the easy way round all this if you really want one line is to use IF conditional then : statements : else : statements : endif |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2290 |
good point, i'm forgetting that most micromites have a reset switch to facilitate this. i guess it is a little late to add a reset switch to the CMM2? 1. can/does the H7 processor sit idling in a low-power state for any length of time after powered is applied, to allow for enumeration to complete? i believe there exists no way for the H7 to tell when enumeration is finished. 2. prior to enumeration, how much power is available from a standard USB port with (a) a 1455 fitted, (b) a 2221 fitted, (c) neither fitted? 3. and how much power does a 2221 request? as i recall, the 1455 requests 100mA. is this sufficient for (most)every SD card that is likely to be encountered these days? 4. i note that the power switch is wired up on geoff's schematic BEFORE the 1455/2221. is this true to the actual PCBs? both the 1455 and 2221 can be configured to operate from 5v USB power using their internal 3v3 regulator, which would allow enumeration prior to powering the waveshare module. cheers, rob :-) addendum: just went back to the 'Introducing the Colour Maximite 2' thread, the first post describing the CMM2 states: " - Power is 5 volts at 170mA typical (ie, from an USB port or charger)." this is going to be a problem, with a fully compliant USB port things will go wrong if a 1455 or 2221 is fitted. it may be ok with the 1455/2221 removed, ie no enumeration occurring, but the USB documentation isn't exactly clear about this. the 2221 seems to default to 100mA max USB power draw, but this can be reconfigured later on, for up to 500mA using a utility supplied by microchip. as i remember, the 1455 is hard-coded to 100mA. my advice is to either remove the 1455/2221, or reconfigure the 2221 to request 300mA or more using the microchip utility. however, even with the 2221 reconfigured, this does not solve the issue of the CMM2 drawing 170mA while the 2221 is enumerating. Edited 2020-06-20 01:03 by robert.rozee |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Rob Thanks for the very useful input - AGAIN Microbridge request 500mA. The CMM2 doesn't use 170mA until all initialisation has happened. Starting current is about 43mA. If necessary I can introduce a delay before the clocks are wound up to allow more time for enumeration of the USB/UART but this doesn't seem to have been an issue thus far. |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2290 |
hi peter, i just checked a 'microbridge' with V1.18 firmware (the latest?), and under linux it reports: user@HP-stream11-392758:~$ lsusb -s 10 -v ... MaxPower 100mA ... does the 1455 offer any real advantage over a 2221A in the CMM2? icsp programming isn't useful with the H7 processor, and the only other material thing different is the 1455 offering the ability to maybe translate break->reset, which is a pretty minor feature outside of a micromite. cheers, rob :-) Edited 2020-06-20 01:31 by robert.rozee |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Price From the Microbridge code static const ROMPTR struct configuration_1_packet configuration_1 = { { // Members from struct configuration_descriptor sizeof(struct configuration_descriptor), DESC_CONFIGURATION, sizeof(configuration_1), // wTotalLength (length of the whole packet) 2, // bNumInterfaces 1, // bConfigurationValue 2, // iConfiguration (index of string descriptor) 0b10000000, 500/2, // 100/2 indicates 100mA }, Edited 2020-06-20 04:03 by matherp |
||||
vegipete Guru Joined: 29/01/2013 Location: CanadaPosts: 1083 |
Something is strange with the circle command and the colour black. From the command prompt: cls rgb(gray) box 50,200,200,200,1,rgb(black),rgb(black) circle 400,300,100,1,1,rgb(black),rgb(black) Where is that black circle? Changing the colour used in the circle command gives expected results. edit: sorry, version 5.05.03b1j, Waveshare based CircuitGizmo CMM2 Edited 2020-06-20 04:08 by vegipete Visit Vegipete's *Mite Library for cool programs. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Good question. As a workround use RGB(1,1,1) while I find out |
||||
vegipete Guru Joined: 29/01/2013 Location: CanadaPosts: 1083 |
No rush. I would like colour 0 so I can figure something out with sprites and transparency. Visit Vegipete's *Mite Library for cool programs. |
||||
Page 15 of 17 |
Print this page |