Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 07:37 04 May 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 : MOUSE for Maximite/Duinomite

     Page 1 of 2    
Author Message
Raros

Regular Member

Joined: 06/02/2012
Location: Italy
Posts: 55
Posted: 02:03am 20 Jan 2013
Copy link to clipboard 
Print this post

Hi

I made a program for the management of the old serial mouse (those with the RS-232) is very easy to manage with interrupts.





I interfaced the Maximite with a TTL-RS232 converter of the type SP3222 Sypex compatible with the MAX3222E.
I have had many problems with the converter ICL3225 because it has the "Enhanced Automatic Powerdown". So avoid the chips that have this feature or the like.

These are the connections:

SP3222E to Maximite:
pin12(T1in) to MMpin16 - pin13(R1out) to MMpin15 - power gnd/3.3v and pin11(T2in) to Gnd.

SP3222E to RS-232 Male:
pin8(T2out) to rs232pin7 - pin14(R1in) to rs232pin2 - pin15(T1out) to rs232pin3 and Gnd to rs232pin5

Maximite COM1: pin 15 and 16

The pointer is quite fast and responsive.



With the first test program, Mouse04B, you can test the mouse to be compatible with 'microsoft mode' (almost all) because only come out with 3 bytes for each event. However, you can easily change acting on a pin of the chip (see datasheet).

I used mice with chip HM8370 and HT6513B with the same results.
It important that the connections of mouse with RS-232 are 4 wires. A mouse with 5 wires did not work because he needed other signals.



The second test program, Mouse06B, load a sprite that acts as a pointer and pressing the left mouse button draw.

IMPORTANT when you run the program do not move the mouse.
I have not used the bit sync content in the first byte.

2013-01-20_120914_Mouse_Test.zip

I hope you enjoy it.





Raros.

Edited by Raros 2013-01-21
 
boss

Senior Member

Joined: 19/08/2011
Location: Canada
Posts: 268
Posted: 09:27am 20 Jan 2013
Copy link to clipboard 
Print this post

Hi,

that is great idea. I was thinking about doing the same with a PS2 mouse because I didn't remember the existence of early PC era serial mice. I hope someone with C programming capability could write a driver for PS2 or USB mice as well. Thumb up!!!
 
Sir_M
Newbie

Joined: 14/01/2013
Location: Sweden
Posts: 15
Posted: 01:40pm 20 Jan 2013
Copy link to clipboard 
Print this post

Well done Raros!

Works like a charm on my Duinomite, just tied RTS to ground and changed COM1 to COM4 and we were up and running, very close to plug n´ play .

// Jörgen
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1328
Posted: 02:53pm 20 Jan 2013
Copy link to clipboard 
Print this post


Very clever Raros - we'll be going to the moon with the Maximite before long!

 
Raros

Regular Member

Joined: 06/02/2012
Location: Italy
Posts: 55
Posted: 03:07pm 20 Jan 2013
Copy link to clipboard 
Print this post

Thank you.

He he he.... My wife always tells me: when it will start this rocket?......


Raros

 
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 278
Posted: 12:10pm 21 Jan 2013
Copy link to clipboard 
Print this post

Just seeing the mouse pointer on the Maximite screen does it for me!
Great work Raros.

Dave.
 
Raros

Regular Member

Joined: 06/02/2012
Location: Italy
Posts: 55
Posted: 01:07pm 21 Jan 2013
Copy link to clipboard 
Print this post

Thank you cosmic frog

New idea: 'Micro MMPaint' in progress......
Stay tuned.

Raros
 
boss

Senior Member

Joined: 19/08/2011
Location: Canada
Posts: 268
Posted: 04:22pm 23 Jan 2013
Copy link to clipboard 
Print this post

Hi,

unfortunatelly I have no serial mouse. But I found that they selling some PS2/Serial adapters on eBay. Anyone has experience using PS2 with such adapter?

Thanks for sharing.
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 05:06pm 23 Jan 2013
Copy link to clipboard 
Print this post

  boss said   Hi,

unfortunatelly I have no serial mouse. But I found that they selling some PS2/Serial adapters on eBay. Anyone has experience using PS2 with such adapter?

Thanks for sharing.

Serial Mice don't cost much more on ebay than the adaptors
VK4MU MicroController Units

 
boss

Senior Member

Joined: 19/08/2011
Location: Canada
Posts: 268
Posted: 07:24pm 23 Jan 2013
Copy link to clipboard 
Print this post

You are right, I found a few. Thanks
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5912
Posted: 11:38pm 23 Jan 2013
Copy link to clipboard 
Print this post

  boss said   Hi,

unfortunatelly I have no serial mouse. But I found that they selling some PS2/Serial adapters on eBay. Anyone has experience using PS2 with such adapter?

Thanks for sharing.


The adapter will only work if the mouse is compatible.

I used to sell 2 varieties and you always had to test them with the mouse.
Some mice didn't want to work with any adapter.

Same problems with USB to PS2 adapters.

Jim

VK7JH
MMedit   MMBasic Help
 
Raros

Regular Member

Joined: 06/02/2012
Location: Italy
Posts: 55
Posted: 05:09am 25 Jan 2013
Copy link to clipboard 
Print this post

Opps!!!

I accidentally put the program 'MOUSE04B.BAS' incomplete!

This is the right one:
2013-01-25_150632_MOUSE04B.zip

Pack corrected:
2013-01-25_150739_Mouse_Test1.zip



Cls
Print:Print:Print Tab(20)"View (B)inary or (D)ecimal"
Answer:
view$ = Inkey$:If view$ = "" Then GoTo Answer
view$ = UCase$(view$)

If view$ = "B" Then
Cls:Print Tab(30)"BINARY View":Print
Rem "COMn: baud, buf, int, intlevel, FC, DE, OC"
Open "COM1: 1200, 256, BINARY, 3" As #1

ElseIf view$ = "D" Then
Cls:Print Tab(30)"DECIMAL View":Print
Rem "COMn: baud, buf, int, intlevel, FC, DE, OC"
Open "COM1: 1200, 256, DECIMAL, 3" As #1

Else
GoTo Answer
EndIf

Do While Inkey$ = "" : Loop
End

BINARY:
A$ = Input$(1,#1):B$ = Input$(1,#1):C$ = Input$(1,#1)
Print Bin$(Asc(A$)), Bin$(Asc(B$)), Bin$(Asc(C$))
IReturn

' ****** MISSING ******

DECIMAL:
A$ = Input$(1,#1):B$ = Input$(1,#1):C$ = Input$(1,#1)
Print (Asc(A$) And 32)/32; Tab(10)(Asc(A$) And 16)/16;
Print Tab(20)((Asc(B$) And 63) - (32 * (Asc(A$) And 2)));
Print Tab(30)((Asc(C$) And 63) - (8 * (Asc(A$) And 8)))
IReturn




Mortified, Raros.
Edited by Raros 2013-01-26
 
Raros

Regular Member

Joined: 06/02/2012
Location: Italy
Posts: 55
Posted: 01:31am 03 Feb 2013
Copy link to clipboard 
Print this post

Hi

Updated the bit sync.
Now the mouse is synchronized.


' .......................

A$ = Input$(1,#1)
If (Asc(A$) And 192) <> 192 Then IReturn
' Sync: first byte is 11xxxxxx
B$ = Input$(1,#1):C$ = Input$(1,#1)

' .........................



2013-02-03_113055_Mouse_Test2.zip

Raros
Edited by Raros 2013-02-04
 
MM_Wombat
Senior Member

Joined: 12/12/2011
Location: Australia
Posts: 139
Posted: 05:39pm 29 Mar 2013
Copy link to clipboard 
Print this post

Raros,

Good work, but I don't have an old serial mouse..

Could the mouse be done with a serial interface , connected to a bluetooth module, and use an android app to send touch screen information to the MM / CMM / Duinomite...

I am going to try it and see....

will let you know how it turns out..

Dennis.
Keep plugging away, it is fun learning
But can be expensive (if you keep blowing things up).

Maximite, ColourMaximite, MM+
 
MM_Wombat
Senior Member

Joined: 12/12/2011
Location: Australia
Posts: 139
Posted: 06:52pm 30 Mar 2013
Copy link to clipboard 
Print this post

Raros,

Got it to work through the Bluetooth connection, and my appinventor android app.

Had to change some lines of your code (mouse06c.bas) though, because it went left and up very quickly compared to right and down...

  Quote  PointX = PointX + ((Asc(B$) And 63) - (32 * (Asc(A$) And 2)))


to

PointX = PointX + (Asc(B$) And 63) *(1-(Asc(A$) And 2))

(asc(a$) and 2) was either 0 or 2 therefore 1-0=1 or 1-2=-1

which set the direction ( using Negx from a$)

and

  Quote  PointY = PointY + ((Asc(C$) And 63) - (8 * (Asc(A$) And 8)))


to

PointY = PointY + (Asc(C$) And 63) * (1- ((Asc(A$) And 8)/4))

to achieve same multiplication solution 1 or -1 (Negy from a$)


If you would like , I can send you the details of the bluetooth connection and my android app..

Regards dennis
Keep plugging away, it is fun learning
But can be expensive (if you keep blowing things up).

Maximite, ColourMaximite, MM+
 
Raros

Regular Member

Joined: 06/02/2012
Location: Italy
Posts: 55
Posted: 01:44am 31 Mar 2013
Copy link to clipboard 
Print this post

Hi

Great. well, well .
You can send me the details of the Bluetooth connection?

Ok

Regards Raros.
 
MM_Wombat
Senior Member

Joined: 12/12/2011
Location: Australia
Posts: 139
Posted: 11:34pm 07 Apr 2013
Copy link to clipboard 
Print this post

Hello Raros,

I am using a 'RN-42-XVP-I/RM' Module by Roving Networks (Microchip).
Got mine from Little Bird Electronics, but is available from Sparkfun etc..

Pin 1 is 3.3V VCC
pin 2 is UART Tx ------- pin 16 on CMM
Pin 3 is UART Rx ------- pin 15 on CMM
Pin 10 is GND
Pin 18 has 3.3V supplied to force baud rate of 9600.(default 115200)

Once device baud rate is set, these commands are not needed..

From CMM command line I type.
>open "comm1:9600" as #1

then
>print #1,"$$$";: pause 1000

note the semi-colon after the quote. This is to stop a newline being sent.
this puts module in command mode - led on BT module flashes quickly
then
> print input$(255,1)

this should return 'CMD' to denote in command mode
then
>print #1,"SU,12": pause 1000
>print input$(255,1)

this sets the baud rate to 1200
should return AOK
then

>print #1,"R,1" : Pause 1000
>print input$(255,1)

This will reset the module with the new setting of 1200 baud
>close #1

Disconnect pin 18 from power. Module is set for 1200 baud now..

Start program Mouse06c.bas with setting for 1200 baud connection..

ANDROID PHONE APP..

Install the Phone App

Please check for virus' before installing.(just a precaution)

I uploaded .apk file to my phone. Then found file and selected. Phone asked to run app installer, and everything went from there..

Open app.

With Bluetooth Turned on, select device- Should come up as "Firefly-XXXX"
where XXXX is last four digits of device mac address..
Select Connect. Device should respond with Notifier whether connected or not.


orange area is for the mouse movement..

clicking left button toggles button on, pressing again toggles off.
clicking right while left selected turns right on/ left off. etc....

regards Dennis..
Keep plugging away, it is fun learning
But can be expensive (if you keep blowing things up).

Maximite, ColourMaximite, MM+
 
Raros

Regular Member

Joined: 06/02/2012
Location: Italy
Posts: 55
Posted: 08:33am 09 Apr 2013
Copy link to clipboard 
Print this post

Hi

Thank You Dennis

As soon as i little bit of time & the material, will try.

Regards Raros.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 11:56pm 28 Jan 2019
Copy link to clipboard 
Print this post

Raros,

Silicon Chip Magazine has introduced a project for a USB Keyboard & mouse adaptor. It will convert a USB mouse to a serial one. 'Microsoft serial mouse' is one option and I believe it will suit your program. I will build one and see. You can also use a wireless mouse.

You need two units and two serial ports for Mouse AND Keyboard.

Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 12:33am 07 Feb 2019
Copy link to clipboard 
Print this post

Well my chip FINALLY arrived yesterday. I programmed it OK and connected the unit to a PC. The setup screen confirms that it is set by default to a Microsoft 7 bit mouse at 1200 baud. It should be compatible with Raros' program out of the box. Not sure if I can test it to a Maximite before I go away but if I can I will report.

Bill

PS Does anyone have a clever way to bend the pins on a new IC to get them to plug into an IC socket or PCB without an IC insertion tool?
Keep safe. Live long and prosper.
 
     Page 1 of 2    
Print this page
© JAQ Software 2024