Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:10 03 Aug 2025 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: If you want a mouse

     Page 3 of 4    
Author Message
yock1960
Senior Member

Joined: 18/08/2020
Location: United States
Posts: 167
Posted: 02:28pm 28 Oct 2020
Copy link to clipboard 
Print this post

So, I'm seeing occasional errors with mouse usage. I'm not at home currently and should have taken a picture of the screen, but it mentions several possibilities, using a reserved word, firmware problem being among them. Most of the time there's no issue...similar to the occasional problem with playing modfiles. I'm going to hunt down a spare powered USB hub for providing power, or a newish phone charger to see if it helps or not.

Also, I tried a wireless mouse earlier today, movement was fine, but button presses weren't being detected. Is this a known issue?

Steve
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 02:47pm 28 Oct 2020
Copy link to clipboard 
Print this post

  [ said  QUOTE=yock1960I'm not at home currently and should have taken a picture of the screen, but it mentions several possibilities, using a reserved word, firmware problem being among them.


I don't know anything about the mouse, but what you are describing is the CMM2's "blue screen of death", the message is completely generic.

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
MachineEmpath
Newbie

Joined: 25/10/2020
Location: United States
Posts: 12
Posted: 06:24pm 28 Oct 2020
Copy link to clipboard 
Print this post

Peter, you mentioned that the STM32H7 only supports a single USB device.  Is that a limitation of the hardware?  Or just of the STM32Cube USB stack?  I ask because it looks like at least one open source project has multiple USB devices working on the STM32H743 (https://github.com/hathach/tinyusb).  I haven't thought a lot about license compatibility, so that may prevent using it.  But it's an interesting data point.

Anton
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 06:41pm 28 Oct 2020
Copy link to clipboard 
Print this post

  Quote  Peter, you mentioned that the STM32H7 only supports a single USB device.  Is that a limitation of the hardware?  Or just of the STM32Cube USB stack?


Basically the ST USB stack but also my lack of desire to try and understand USB in any more depth than I do now (minimal).
The code looks interesting

BUT from the github readme

  Quote  Most active development is on the Device stack. The Host stack is under rework and largely untested.

Edited 2020-10-29 04:41 by matherp
 
MachineEmpath
Newbie

Joined: 25/10/2020
Location: United States
Posts: 12
Posted: 07:47pm 29 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Peter, you mentioned that the STM32H7 only supports a single USB device.  Is that a limitation of the hardware?  Or just of the STM32Cube USB stack?


Basically the ST USB stack but also my lack of desire to try and understand USB in any more depth than I do now (minimal).
The code looks interesting

BUT from the github readme

  Quote  Most active development is on the Device stack. The Host stack is under rework and largely untested.


Heh, yeah, I saw that bit.  I wrote some of the USB stack for the ChromeOS embedded controller, so I'm familiar with the complexity involved.  It is nice to know that it could be done at some point.  Given enough enthusiasm and time.  :)
 
Womble

Senior Member

Joined: 09/07/2020
Location: United Kingdom
Posts: 267
Posted: 10:06pm 29 Oct 2020
Copy link to clipboard 
Print this post

  yock1960 said  I'm going to hunt down a spare powered USB hub for providing power, or a newish phone charger to see if it helps or not.

Try a different USB A-B cable.
Not all USB cables are equal, even "known good" printer cables.
Changing mine solved a host of problems.

A "bad" cable may work fine, just cause voltage drop wich leads to instability.
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1134
Posted: 06:13pm 31 Oct 2020
Copy link to clipboard 
Print this post

Peter:
The Hobbytronics(-esque, since I'm using my own version) mouse interface seems to work nicely. I wonder though if we could have access to the position changes (I2C registers 7,8,9) and allow changes to the settings registers (particularly 20,22,28). Can this already be done without upsetting the automatic background mouse polling?

There have been questions about whether a mouse is connected or not. The Hobbytronics I2C protocol can't answer that. I'm going to add an I2C register 10 to my implementation. What does the Hobbytronics device report for the value in register 10, or does it NAK that register request?

Also, an ISR call for button _up_ events would be very useful. This could be to the existing ISR, in which case the ISR must check for button up or down, which would likely break existing programs, or a separate ISR.

Finally, could we have (a few) more user-loadable mouse pointer image slots, and the ability to read them from memory, like the SPRITE READ command? I'm thinking, among other things, of animated mouse pointers.

As always, thank you for your amazing development work!
Visit Vegipete's *Mite Library for cool programs.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 06:47pm 31 Oct 2020
Copy link to clipboard 
Print this post

There is a bug in the Hobbytronics implementation for I2C registers 7,8,9. I'm trying to get this fixed and will also try and get a "connected" status byte added

You can do this now with a normal I2C command on the correct address (user beware). If I've got the coding correct the background polling is blocked when an I2C transaction is in progress on the same port
 
Sasquatch

Guru

Joined: 08/05/2020
Location: United States
Posts: 377
Posted: 07:42pm 31 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  There is a bug in the Hobbytronics implementation for I2C registers 7,8,9. I'm trying to get this fixed and will also try and get a "connected" status byte added

You can do this now with a normal I2C command on the correct address (user beware). If I've got the coding correct the background polling is blocked when an I2C transaction is in progress on the same port


Here's a thought....  My HT mouse interface seems to report 1 for I2C register 10 whether or not a mouse is connected.  We can't really control what the HT unit does, but we could have the arduino and any other versions report something unique so that we could tell what type of interface is connected.  Right now the Arduino version seems to have registers 7,8,9 working properly, but there is no way to have MMBasic know this.

Eventually I think we need to re-write the HT firmware from scratch so that we can "open-source" it.  It seems unlikely that they have written their own USB stack so they are probably using something provided by Microchip.  I haven't had time to look into this, but if the USB stack is available it shouldn't be too hard to get the rest working.

Update:  It looks like I2C register 10 on the HT module is actually wrapping back to register 0 so it is reporting the MSB of the X position?

Update2: Or perhaps instead of an I.D. it could be a bit-map of the device's capabilities?
Edited 2020-11-01 07:04 by Sasquatch
-Carl
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1134
Posted: 09:55pm 31 Oct 2020
Copy link to clipboard 
Print this post

I'm not at this stage yet but a PIC32MM0064GPM028-I/SS looks like a good chip to use for a Hobbytronics replacement. Just not available in DIP form.

To test for wrap, keep reading more locations?

Yes, I though a value at location 10 that could say more just connected or not. I don't know what all a mouse can report.
Visit Vegipete's *Mite Library for cool programs.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 10:03pm 31 Oct 2020
Copy link to clipboard 
Print this post

The Silicon Chip version uses the PIC32MX270F256B (DIL package). You can download their source file. That may be a good place to start?

Bill
Keep safe. Live long and prosper.
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1134
Posted: 10:49pm 31 Oct 2020
Copy link to clipboard 
Print this post

I've been studying the Silicon Chip firmware. It just needs the UART interface changed to I2C.

But my inventory does not include 28 pin MX270... More for the next order.
Visit Vegipete's *Mite Library for cool programs.
 
siwypiotr

Senior Member

Joined: 18/08/2020
Location: Poland
Posts: 127
Posted: 08:56pm 02 Nov 2020
Copy link to clipboard 
Print this post

Remember If mouse is needed and You have no time or skills You can always get this unit with USB support build in:

https://sklep.pslabs.pl/Colour-Maximite-2-Deluxe-Edition-USB-Host-Contr-p150
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 04:21pm 08 Dec 2020
Copy link to clipboard 
Print this post

HobbyTronics have just posted V1.03 of their mouse software which I have fixed for them to support the scroll wheel over I2C

You will need V5.06.00RC4 to use it with the in-built mouse commands

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip


Use the function:

MOUSE(S [,channel])


to read the scroll count

and

MOUSE(Z [,channel])


to both read it and zero it

JIM

To make your arduino version compatible:
the CMM2 now read 10 bytes rather than 7
The last byte is the scroll wheel. It should contain 255 if the wheel has been rolled away from you and 1 if it is rolled towards you. If no change it should contain 0.
The act of reading over I2C should reset it to 0. The CMM2 firmware deals with maintaining the scroll count so I just need a byte with 1, 0, or -1 (255)
Edited 2020-12-09 05:00 by matherp
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 08:30pm 08 Dec 2020
Copy link to clipboard 
Print this post

That is good news about the scroll. I missed it.

My current Arduino code works out-of-the-box with RC4.

I need to check it and compare it with the HobbyTronics.
I am part way through implementing joystick to mouse on the arduino.
IBM style joysticks are working, digital and linear style need more work.

As far as MMBasic is concerned, it is still a HobbyTronics mouse.

I will be away for a few days so no work on it till the weekend.

Jim
VK7JH
MMedit
 
JoOngle
Regular Member

Joined: 25/07/2020
Location: Sweden
Posts: 82
Posted: 10:49pm 08 Dec 2020
Copy link to clipboard 
Print this post

The mouse is really REALLY good for a sprite editor.
 
yock1960
Senior Member

Joined: 18/08/2020
Location: United States
Posts: 167
Posted: 12:24pm 09 Dec 2020
Copy link to clipboard 
Print this post

This requires updating the mouse adapter firmware too?

  matherp said  HobbyTronics have just posted V1.03 of their mouse software which I have fixed for them to support the scroll wheel over I2C

You will need V5.06.00RC4 to use it with the in-built mouse commands

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip


Use the function:

MOUSE(S [,channel])


to read the scroll count

and

MOUSE(Z [,channel])


to both read it and zero it

JIM

To make your arduino version compatible:
the CMM2 now read 10 bytes rather than 7
The last byte is the scroll wheel. It should contain 255 if the wheel has been rolled away from you and 1 if it is rolled towards you. If no change it should contain 0.
The act of reading over I2C should reset it to 0. The CMM2 firmware deals with maintaining the scroll count so I just need a byte with 1, 0, or -1 (255)
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2950
Posted: 11:19pm 09 Dec 2020
Copy link to clipboard 
Print this post

Hi All,

@Peter,

Is there an easy way to change mouse speed when using the mouse..

I have tried changing speed using com port then when I run the mousetest.bas  prog it seems to default back to 6. (Out of a range of 1-10). I assume this is set when the controller command is run... but it doesn’t appear to be an option.

Reason for the question is I have been experimenting with wireless mice and the HobbyTronics chip...
Whilst wired mice seem quite good at default setting and every mouse I tried works (a huge total of about 4 or 5), I have found most wireless mice do not work..  after discussion with Sarah from HobbyTronics she found a gigabyte eco600 that worked, this is now discontinued but I did find a gigabyte aire M58 that worked but the movement is a bit slow, (usable but I would like to speed it up a bit)

The reason, I think, most wireless mice do not work is they seem to use a dongle that sets up for BOTH keyboard AND mouse even though the mouse is sold as a separate entity with no keyboard..

I did capture 4 or 5 wireless mice settings using USBtreeViewer and sent them to Sarah for her information but I don’t hold any hope of there being any change as the person who wrote the code is no longer with them.
If there is interest I can post it here in PDF format.


Regards,

Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 580
Posted: 11:46pm 09 Dec 2020
Copy link to clipboard 
Print this post

@peter Why no ps2 mouse ? Cheap and available
Plasma
 
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 490
Posted: 01:17am 10 Dec 2020
Copy link to clipboard 
Print this post

  Plasmamac said  @peter Why no ps2 mouse? Cheap and available
 TassyJim's Arduino solution dose use a PS2 mouse.  It is also very cheap to implement. I am waiting for some parts from China but it will cost me about $4 to make it.  I can not seem to find the thread about how to set it up.  I will ask Him where that is.

EDIT:  Found it https://www.thebackshed.com/forum/ViewTopic.php?TID=12954&PID=157255#157255#157271
Edited 2020-12-10 11:21 by mclout999
 
     Page 3 of 4    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025