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 No keyboard function on different keyboards that support PS/2
Page 4 of 4 | |||||
Author | Message | ||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
One more thought: The problem keyboards are USB/PS2 and the problem got worse when I put a delay loop in. Also they work fine when plugged in after the CMM2 is initialised. Perhaps when powered up at the same time as the CMM2 they are deciding to go into PS2 mode because of the state of the D+ and D- lines. Try putting a pullup resistor on D+. I believe the standard is 1K5. Let us know if it makes any difference |
||||
Amnesie Guru Joined: 30/06/2020 Location: GermanyPosts: 384 |
Hey matherp, I will try it in a few hours and post the result! If you want I will try even a new firmware, no problem at all. Would be cool, if I can help to get it work with (hopefully) every USB keyboard. And yes my "problem" keyboards are the one which support PS/2 AND Usb (they are comming with an usb connector, but they officially support PS/2 and are tested on the old colour maximite via PS/2 adaptor). |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Actually, reading the PS2 spec it may be the other way round. PS2 expects both clock and data to be pulled high and then both the keyboard and host use open collector drivers to toggle the pins, bit like I2C. Therefore, if the keyboard sees D+ and D- low then it should know that it can't be a PS2 I/F When plugged in a USB client sets either D+ or D- high to indicate whether it is a low speed (D- high) or high speed (D+ high) device which also implies the default state for an unplugged Host USB port is both low. Therefore, my new suggestion is a pulldown on both D- and D+ try 47K. You can also try the attached first before getting out the soldering iron. This attempts to pulldown both D- and D+ right at the beginning of initialisation CMM2V1.5.zip Edited 2020-07-11 04:42 by matherp |
||||
Atomizer_Zero Senior Member Joined: 04/07/2020 Location: United KingdomPosts: 134 |
I wonder if a simple USB multi adapter would work? Reason being that it's USB by default and then the controller in the adapter would initialise the devices attached to it separately. This is assuming that the cmm2 will even work with a multi usb adapter. Edited 2020-07-11 05:55 by Atomizer_Zero |
||||
Amnesie Guru Joined: 30/06/2020 Location: GermanyPosts: 384 |
Dear matherp, after three days of testing.. many posts and your brainwork IT FINALLY WORKS !!!! What a great day!!! Ha! Thank you very much! Now (I really hope) it is confirmed, that you fixed it. I tried your new firmware before heating up the soldering iron - works perfectly! I tested all my four (same model) Cherry keyboards I had to re-plug. Now it works without any problems all the time! My other cherry keyboard (other model) works also! I think you discovered the right thing to solve it. This was actually my first or second thought, it is why I named this topic "...on different keyboards that support PS/2" My "usb only" keyboard works too. Great! I am so happy! I am sure that the other guy here, who has this problem has got a "hidden" PS/2 function on his keyboard,too! That is why his maximite doesn't recognize his keyboard. What a lucky day! Greetings Daniel Edited 2020-07-11 06:08 by Amnesie |
||||
Poppy Guru Joined: 25/07/2019 Location: GermanyPosts: 486 |
Will this be included into the general firmware? Andre ... such a GURU? | ||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Yes, of course. In the next beta |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5913 |
That is good news. It is difficult to solve bugs when you can't reproduce them yourself. I do have a USB/PS2 keyboard but it always worked so no help in debugging. I am sure that your keyboards were switching to PS2 mode and Peters change to the firmware has either changed the timing so the keyboard initialises sooner or held the D= and D- lines low while waiting to initialise (or perhaps both). The alterations shouldn't have any effect for all the other keyboards out there. Jim VK7JH MMedit  MMBasic Help |
||||
Amnesie Guru Joined: 30/06/2020 Location: GermanyPosts: 384 |
Hi Jim, about an hour ago, I found some other keyboards in card boxes I had laying in the basement. I put again the old firmware without this fix on the maximite to test them and found out of four keyboards one that needed a re-plug, too. So I have tested it again after installing the firmware with the fix and now this keyboard works, too! But what I am really wondering is, why not more people had problems?! Does everybody only use those "modern usb-only" keyboards? I mean out of 9 keyboards (which all support PS/2, too) five (!) worked - only after replugging it. The only keyboard that worked all the time is a cheap "usb-only" ASUS keyboard... Hm! No matter, with this fix everything is fine! :) Edited 2020-07-11 08:05 by Amnesie |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5913 |
All my old keyboards are PS2 only (or older, like me). The only USB/PS2 keyboard is the Microsoft Office keyboard which always worked but too bulky and needs a Windows driver for the keys to work properly. We tried many different keyboards during development and didn't find the problem. WE all had newer keyboards I guess. It is good that we have squashed another bug. I don't think it will help the problem of backlit keyboards but we will wait and see. Too many things now rely on the host computer to do a lot of the setup. This makes using them for other purposes difficult. Jim VK7JH MMedit  MMBasic Help |
||||
bigmik Guru Joined: 20/06/2011 Location: AustraliaPosts: 2870 |
Hi All, Great News!! Peter, you are a Bl**dy marvel.. I don’t know how you get the time to do half of what you come up with. I am sorry I couldn’t assist more initially but as Jim said it is hard to debug when your own setup works just fine.. I have no idea which of my k/b are PS2 compatible or not.. I have a PC that takes PS2 so I should make/buy an adapter to try them. Out of interest I am going to flash the new beta version and test my 2 kb that didn’t work,, I will post the result here. I generally don’t flash beta releases as I am not a good programmer so I can offer limited testing. I am interested if Koryo can fix his issue with the latest beta. Regards, Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
Koryo Newbie Joined: 05/07/2020 Location: United StatesPosts: 6 |
A basic HP membrane keyboard works. Would be nice to know what part of the USB negotiation the CMM2 does not like. |
||||
bigmik Guru Joined: 20/06/2011 Location: AustraliaPosts: 2870 |
Hi Koryo, Are you able to try the new firmware Peter posted above? (Page 4 3rd post from the top) Regards, Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3662 |
I don't use a keyboard plugged in to the CMM2, but instead use a PC and download code to the CMM2. Just one user, but maybe others are the same. John |
||||
KeepIS Guru Joined: 13/10/2014 Location: AustraliaPosts: 1372 |
As mentioned by others, this thread kind of went everywhere. This current drain thing is getting confusing for some people trying to fault find a keyboard, it should not be this way. 1: If you power the device with a power pack, surely ALMOST everyone has a 5v power pack for a phone, then all this talk about the USB chip power negotiation from the power source (PC / Laptop) can be dismissed for the purpose of this test. 2: The only thing that needs 5V is the Keyboard. The regulator on the waveshare is a LVDO and the board powers up and runs with as little as 3.2 volts [Mine does] 3: Following on from JohnS above, I always try a totally different type of keyboard if the one I have doesn't work, yes I know it can be difficult, but on a new device, it helps to see if there is a hard board fault or a simpler firmware / hardware initialisation issue. I think the reason there are few reports of this problem is that the CMM2 is just now getting out into the general community. Most of us on here know the problems with some keyboards and various Micro Controllers. That's not meant to be dismissive of the problem, it's just the way it is, at least for me with dam keyboards. However for the very first time, EVERY keyboard I have works with the CMM2, including the two that came with a USB to PS2 convertor. I'm glad this problem cropped up now, as it looks like Peter has come up the answer, so thanks to all involved for finally getting here. I think we need a concise post or note in the manual with 3 simple steps to eliminate a keyboard issue from a CMM2 hardware fault. Mike. Edited 2020-07-11 16:31 by KeepIS It's all too hard. Mike. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
I don't normally get defensive about bugs but in this case let me be clear - there was no bug in the firmware. The bug is in the PS2/USB keyboards that are making assumptions about the state of the USB pins in order to decide to switch arbitrarily to PS2 mode and then never change back even when the electrical conditions are such that the I/F must be USB. USB does not have a specification for how to deal with such a device. It expects a device plugged in to be USB device. My "fix" is to set the USB lines as normal digital I/O and pull them low as soon as possible in the firmware, even before the main clocks are set up and certainly before the firmware is ready to initialise USB and accept characters. Normally, pins are floating before initialisation - this is standard across all microcontrollers. In other words I have provided a work round for a problem in a legacy device that itself had a bug. As Jim reports it is perfectly possible for a USB/PS2 keyboard to not have this issue and not need the work round. Remember how flakey USB was in its earliest incarnations when these dual mode devices were prevalent Edited 2020-07-11 17:16 by matherp |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
This sort of solution illustrates just how good this forum is. A few years ago I added support for the HC-SR04 ultrasonic sensor to the Micromite and someone (sorry, I have forgotten who) could not get it to work while it worked for everyone else. The result was a long interchange on this forum where I changed something and the user tested it with his flaky sensor until a fix was found. It would have been much easier if we could have met in the same room but that is not possible over the internet. This is another case where a dedicated user keeps helping with test after test until a solution is found that the developer (in this case Peter) could never have discovered on his own. A great result that will save many people in the future who use a USB/PS2 keyboard from a deal of pain. Geoff Graham - http://geoffg.net |
||||
Poppy Guru Joined: 25/07/2019 Location: GermanyPosts: 486 |
Not only ... but also! A very socially mature and technically sophisticated community. Impossible in Germany! Andre ... such a GURU? | ||||
Page 4 of 4 |
Print this page |