Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 03:26 29 Mar 2024 Privacy Policy
Jump to

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 Kingdom
Posts: 8516
Posted: 05:53pm 10 Jul 2020
Copy link to clipboard 
Print this post

  Quote  this version works with my keyboards when I re-plug them

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: Germany
Posts: 367
Posted: 06:06pm 10 Jul 2020
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 8516
Posted: 06:38pm 10 Jul 2020
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 134
Posted: 07:53pm 10 Jul 2020
Copy link to clipboard 
Print this post

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: Germany
Posts: 367
Posted: 07:59pm 10 Jul 2020
Copy link to clipboard 
Print this post

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: Germany
Posts: 486
Posted: 08:05pm 10 Jul 2020
Copy link to clipboard 
Print this post

Will this be included into the general firmware?

Andre ... such a GURU?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8516
Posted: 09:41pm 10 Jul 2020
Copy link to clipboard 
Print this post

  Quote  Will this be included into the general firmware?

Yes, of course. In the next beta
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5867
Posted: 09:41pm 10 Jul 2020
Copy link to clipboard 
Print this post

  Quote  IT FINALLY WORKS !!!!

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: Germany
Posts: 367
Posted: 10:02pm 10 Jul 2020
Copy link to clipboard 
Print this post

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: Australia
Posts: 5867
Posted: 10:38pm 10 Jul 2020
Copy link to clipboard 
Print this post

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: Australia
Posts: 2861
Posted: 12:51am 11 Jul 2020
Copy link to clipboard 
Print this post

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 States
Posts: 6
Posted: 01:04am 11 Jul 2020
Copy link to clipboard 
Print this post

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: Australia
Posts: 2861
Posted: 01:14am 11 Jul 2020
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 3641
Posted: 05:49am 11 Jul 2020
Copy link to clipboard 
Print this post

  Amnesie said  But what I am really wondering is, why not more people had problems?!

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: Australia
Posts: 1336
Posted: 06:30am 11 Jul 2020
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 8516
Posted: 07:15am 11 Jul 2020
Copy link to clipboard 
Print this post

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: Australia
Posts: 3163
Posted: 12:55pm 11 Jul 2020
Copy link to clipboard 
Print this post

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: Germany
Posts: 486
Posted: 01:20pm 11 Jul 2020
Copy link to clipboard 
Print this post

  Geoffg said  This sort of solution illustrates just how good this forum is.


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


To reply to this topic, you need to log in.

© JAQ Software 2024