Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 09:58 29 Apr 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: V5.07.00b1 - Mouse heaven

     Page 3 of 5    
Author Message
yock1960
Senior Member

Joined: 18/08/2020
Location: United States
Posts: 167
Posted: 11:47am 04 Jan 2021
Copy link to clipboard 
Print this post

Peter,

Just installed the beta, if I double click on any filename to run, I get an 'IC2C not open error'. Running again works normally.

Steve
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 12:00pm 04 Jan 2021
Copy link to clipboard 
Print this post

  Quote  Just installed the beta, if I double click on any filename to run, I get an 'IC2C not open error'. Running again works normally.


What options? what type of mouse and how connected?
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1327
Posted: 12:22pm 04 Jan 2021
Copy link to clipboard 
Print this post

  thwill said  ... though looking at the underside magnified to such an extent I'm less pleased with my soldering now.

Hmmm.... no comment Tom, though I have to say mine are like silken drawers compared to yours.  

Greg
 
yock1960
Senior Member

Joined: 18/08/2020
Location: United States
Posts: 167
Posted: 12:54pm 04 Jan 2021
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Just installed the beta, if I double click on any filename to run, I get an 'IC2C not open error'. Running again works normally.


What options? what type of mouse and how connected?


options:

VGA mode 800x600 RGB332
display 50,100
USBKeyboard US

Hobbytronics wired for channel 2

Steve
 
yock1960
Senior Member

Joined: 18/08/2020
Location: United States
Posts: 167
Posted: 01:51pm 04 Jan 2021
Copy link to clipboard 
Print this post

  yock1960 said  
  matherp said  
  Quote  Just installed the beta, if I double click on any filename to run, I get an 'IC2C not open error'. Running again works normally.


What options? what type of mouse and how connected?


options:

VGA mode 800x600 RGB332
display 50,100
USBKeyboard US

Hobbytronics wired for channel 2

Steve


Old wired logitech USB mouse.
 
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 430
Posted: 02:14pm 04 Jan 2021
Copy link to clipboard 
Print this post

  yock1960 said  Peter,

Just installed the beta, if I double click on any filename to run, I get an 'IC2C not open error'. Running again works normally.

Steve


I get the same thing sometimes for programs that have previous mouse support HT.
I have PS/2 mice several on OPTION MOUSE 0,8.  If I OPTION MOUSE OFF it will work again. I have tried to edit some of the program's mouse statements like changing to the right port but that does not work. I think the file manager leave the IC2C open.  Also, did you see my comment that if you use CONTROL S to sort the mouse just stops working and the cursor disappears?  Thanks.
 
Rado
Regular Member

Joined: 27/11/2020
Location: Croatia
Posts: 59
Posted: 07:08pm 04 Jan 2021
Copy link to clipboard 
Print this post

@thwill - I ran the code directly from the filemanager. I'll upload the new beta firmware and see if it will fix some of the issues I have with the old beta. Anything found will be reported in that beta thread.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5905
Posted: 09:14pm 04 Jan 2021
Copy link to clipboard 
Print this post

This is an update to Peters mouse test program.
It includes the wheel, double click and a QUIT button.
I have added some code at the exit to hopefully turn everything off gracefully. This should prevent the occasional error message on exit.
 'mouse and cursor test
 dim integer quit, mp
 CLS
 MODE 1,8
 
 mp = mm.info(option mouse)
 if mp = -1 then ' no mouse set
   mp = 0 ' assume PS/2 mouse - change to suit
 else
   print "Mouse port ";mp
 endif
 
 GUI CURSOR ON
 
 CONTROLLER MOUSE OPEN mp, leftclick, rightclick
 
 PRINT "Mouse found is type ",MOUSE(t,0)
 if MOUSE(t,0) = 3 then PRINT "Mouse has a wheel!"
 PAUSE 2000
 CLS
 PRINT @(750,10,2)"QUIT"
 'I2C2 WRITE 41,1,2,28,10
 SETTICK 50, myint
 DO : LOOP UNTIL quit = 1
 SETTICK 0, myint
 CONTROLLER MOUSE CLOSE mp
 pause 20
 GUI CURSOR OFF
END
 
SUB myint
 GUI CURSOR MOUSE(x,mp),MOUSE(y,mp)
 PRINT @(10,10)MOUSE(x,mp);"  ";MOUSE(y,mp);"  s";MOUSE(s,mp);"  w";MOUSE(w,mp);"  "
 IF MOUSE(D,mp) THEN
   PRINT @(10,50)"Doubleclick"
 ELSE
   PRINT @(10,50)"            "
 ENDIF
END SUB
 '
SUB leftclick
 STATIC INTEGER n
 LOCAL INTEGER x=MOUSE(x,mp),y=MOUSE(y,mp)
 GUI CURSOR OFF
 GUI CURSOR ON 1,x,y, RGB(RED)
 n=n+1
 PRINT @(100,100)"left",n
 if x > 750 and y < 25 then quit = 1
END SUB
 '
SUB rightclick
 STATIC INTEGER n=0
 LOCAL INTEGER x=MOUSE(x,mp),y=MOUSE(y,mp)
 GUI CURSOR OFF
 GUI CURSOR ON 0,x,y
 n=n+1
 PRINT @(200,100)"Right",n
END SUB


Jim
VK7JH
MMedit   MMBasic Help
 
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 430
Posted: 09:22pm 04 Jan 2021
Copy link to clipboard 
Print this post

  Quote  This is an update to Peters mouse test program.
It includes the wheel, double click and a QUIT button.
I have added some code at the exit to hopefully turn everything off gracefully. This should prevent the occasional error message on exit.


Jim, You should have updated your 3D mouse test program as that thing is beautiful and I have not been able to get it working. I used to just play with it.  I will try this one as well. Thank you.  I was wondering if the scroll wheel was clickable.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5905
Posted: 09:36pm 04 Jan 2021
Copy link to clipboard 
Print this post

  mclout999 said  
Jim, You should have updated your 3D mouse test program as that thing is beautiful and I have not been able to get it working. I used to just play with it.

Working on it but this is a busy time in the garden for us southerners.
Too busy picking strawberries, raspberries and now the cherry trees are calling...

Jim
VK7JH
MMedit   MMBasic Help
 
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 430
Posted: 12:05am 05 Jan 2021
Copy link to clipboard 
Print this post

  Quote  Working on it but this is a busy time in the garden for us southerners.
Too busy picking strawberries, raspberries and now the cherry trees are calling...
 

Cool. Sounds like heaven to me. I can still have berries(Type 2 Diabetes) but not the cherries.  Enjoy.
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1327
Posted: 01:26am 05 Jan 2021
Copy link to clipboard 
Print this post

  TassyJim said  This is an update to Peters mouse test program.
It includes the wheel, double click and a QUIT button.

All working nicely on my 10yo Porto USB mouse Jim, including wheel and wheel click.

I'm jealous of your fresh berries and cherries, we had them at our place on the Tamar every year. My mother grew up on a berry farm in Hobart.

Greg
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1421
Posted: 03:34pm 05 Jan 2021
Copy link to clipboard 
Print this post

  TassyJim said  
Working on it but this is a busy time in the garden for us southerners.
Jim


It is a toasty 38 degrees here. Unfortunately, that is Fahrenheit.
Micromites and Maximites! - Beginning Maximite
 
mkopack73
Senior Member

Joined: 03/07/2020
Location: United States
Posts: 261
Posted: 09:04pm 05 Jan 2021
Copy link to clipboard 
Print this post

Anybody test out this firmware with the USB keyboard interface on Piotr's CMM2 Deluxe model? Working ok? (I would assume if the firmware still supports the Hobbytron usb interface then the answer is yes).
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1082
Posted: 07:45pm 06 Jan 2021
Copy link to clipboard 
Print this post

I just flashed 7b2.
The old Logitech USB mouse I have works fine in PS/2 mode.

I notice with TassyJim's test program above that double clicks are registered even if the mouse is moving fast. Ideally a double click should only happen if the mouse has moved less than some threshold between clicks. Note this threshold should not be too close to zero or jittery hands will not be able to double click!

Also, the test program works very poorly if you change line 20 to "CLS rgb(white)"
The combination of OPTION MOUSE 0 and OPTION COLOURCODE REVERSE does work almost perfectly in the editor. A mouse pointer with a solid center instead of a transparent one might help. I don't see how to specify a user loaded mouse pointer in FILES or EDITOR.

Looks like I have a bunch of my programs to add mouse functionality to ...
Visit Vegipete's *Mite Library for cool programs.
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1082
Posted: 11:32pm 06 Jan 2021
Copy link to clipboard 
Print this post

As others have discovered, stopping a mouse enabled program with Ctrl-C leaves the mouse port in a confused state. A solution to this is to disable Ctrl-C and add a Ctrl-C trap routine to end the program gracefully:
' Put these two lines near the start,
' just before GUI CURSOR ON and CONTROLLER MOUSE OPEN <chan#>
option break 24      ' change ^C to ^Y
on key 3, CtrlCQuit  ' trap ^C

' Add this routine anywhere convenient
sub CtrlCQuit  ' trap ^C
  CONTROLLER MOUSE CLOSE <chan#>
  pause 20
  GUI CURSOR OFF
  option break 3  ' restore ^C
  end
end sub
Just be careful changing the break character - you can loose the ability to stop a running program, requiring a reset or more to get control back.

Also, I see weird mouse cursor glitches if the user loaded sprite is bigger than 16x16 pixels. Could the user loaded mouse pointer be changed to function exactly like the sprite load commands? Or even better, let the mouse cursor BE (any) one of the sprites? Is there a limitation to how many colours a mouse pointer can be?
Edited 2021-01-07 11:57 by vegipete
Visit Vegipete's *Mite Library for cool programs.
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1327
Posted: 05:55am 09 Jan 2021
Copy link to clipboard 
Print this post

In the spirit of my now redundant effort with the PS2 connector made further back in this thread, I have now produced a nice neat USB connector! Check this out.



This is on the standard Silicon Chip CMM2 board. It nicely fits into a slot filed into the standard case.



Holes drilled for the PCB socket in a track-free side area (right hand side, close to the front). Make sure you mark the position on the board carefully before drilling.



Connections made to socket pins. Not much room there but it helps that switched 5v is close-by (main switch) and base plane is ground. I scraped a little resist off to make the ground connection and a solid soldered base for the socket cover pins. 5v and ground connections only end up about 2cms long - the leads for the D+/D- control signals go to the soldered connections of pins 31 and 33 of the 44 pin socket. I used solid insulated hook-up wire which lays pretty flat on the board.



The last one is the mouse lead (optical mouse, 10yr old) modded in-line with 4K7 pullups. I put the pullups in-line so that the control pins (31 and 33) are standard CMM2 when the USB plug is removed. They can then be used for other I/O.
I confess I don't consider this last part terribly "neat" - even so it took up about 80% of the total modding time! It would have been easier if I'd had a bare-bones plug but I had to use the original after cutting the lead.

Greg
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 10:20am 10 Jan 2021
Copy link to clipboard 
Print this post

Please find attached V5.07.00b3

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

This improves the tidy up of programs that exit when using the mouse and/or cursors. In addition it implements a debounce algorithm for PS2 mice button interrupts
 
Rado
Regular Member

Joined: 27/11/2020
Location: Croatia
Posts: 59
Posted: 02:32pm 12 Jan 2021
Copy link to clipboard 
Print this post

Oh, the mighty Guru, Lord Protector of Modern Retronostalgia, this here but a mere worm would like to ask you for a divine favor and a benefit for the whole population who basks in your Glory of Swift Development of New-and-exciting Features: if you could put new beta firmware releases in new threads with a short changelog? - it will be much easier to track the releases than seeking in old threads.  
 
RetroJoe

Senior Member

Joined: 06/08/2020
Location: Canada
Posts: 290
Posted: 04:26pm 12 Jan 2021
Copy link to clipboard 
Print this post

Rado, arguably this is that 5.07 Beta thread, except it got flooded by PS/2 wiring diagrams and mouse test programs :)

Thanks, everyone for the liberal sharing of information on the "Lost Art of PS/2 Interfacing", and for Peter coming up with an elegant solution for native mouse support on the CMM2.

I've tried every USB mouse in the house with one of the passive "green adapters" I had lying around, but no luck, so I ordered a real PS/2 wired mouse and some green PS/2 jacks, so hope to get this working soon.

For future reference, is there a way to determine if a USB mouse supports the PS/2 protocol, besides the "try it and see" method? I'm thinking there has to be some way the mouse determines at power-up if it should run in USB or PS/2 mode, and that this discovery phase is observable e.g. on an oscilloscope.

But, I have to think this mode-switching capability was only prevalent for a small number of years, before "legacy-free" motherboards became the norm.
Edited 2021-01-13 03:17 by RetroJoe
Enjoy Every Sandwich / Joe P.
 
     Page 3 of 5    
Print this page
© JAQ Software 2024