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: ItalyPosts: 55 |
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. |
||||
boss Senior Member Joined: 19/08/2011 Location: CanadaPosts: 268 |
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: SwedenPosts: 15 |
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: AustraliaPosts: 1328 |
Very clever Raros - we'll be going to the moon with the Maximite before long! |
||||
Raros Regular Member Joined: 06/02/2012 Location: ItalyPosts: 55 |
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 KingdomPosts: 278 |
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: ItalyPosts: 55 |
Thank you cosmic frog New idea: 'Micro MMPaint' in progress...... Stay tuned. Raros |
||||
boss Senior Member Joined: 19/08/2011 Location: CanadaPosts: 268 |
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: AustraliaPosts: 447 |
Serial Mice don't cost much more on ebay than the adaptors VK4MU MicroController Units |
||||
boss Senior Member Joined: 19/08/2011 Location: CanadaPosts: 268 |
You are right, I found a few. Thanks |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5911 |
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: ItalyPosts: 55 |
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. |
||||
Raros Regular Member Joined: 06/02/2012 Location: ItalyPosts: 55 |
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 |
||||
MM_Wombat Senior Member Joined: 12/12/2011 Location: AustraliaPosts: 139 |
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: AustraliaPosts: 139 |
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... 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 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: ItalyPosts: 55 |
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: AustraliaPosts: 139 |
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: ItalyPosts: 55 |
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: AustraliaPosts: 1593 |
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: AustraliaPosts: 1593 |
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 |