Welcome, Guest. Please login or register.


Author Topic: EnterMice (Joy & PS/2 mouse interface) (Read 79184 times)

Online gflorez

  • EP addict
  • *
  • Posts: 2663
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #75 on: 2015.June.02. 23:06:05 »
It seems to be good, only RTS  at the end has one more cycle than necessary.


I was meaning a high state and a low state more than necessary.

Online gflorez

  • EP addict
  • *
  • Posts: 2663
  • Country: es
  • OS:
  • Unknown Unknown
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #76 on: 2015.June.02. 23:51:08 »
Data out is spare to send a signal.

Offline pear

  • EP lover
  • *
  • Posts: 783
  • Country: pl
  • Z80 only
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #77 on: 2015.June.03. 06:37:22 »
It seems to be good, only RTS  at the end has one more cycle than necessary.
You're right. Instead of the last cycle, there should be a longer gap at RTS.
About timings or interrupts, I don't understand. The MCU has to wait for the changes on STROBE and check that the delays are correct. Then write the output register and wait again.
It is a passive task for a powerful MCU....
I do timer in interrupts to avoid having to every time count manually tacts. I do a loop and wait until interruption of the timer comes up.
Or I don't wait and I can at this time to perform another procedure, and the time check later.
About the timings: good idea also calculate up to 10MHz Z80. Will be great if can work without delays.
It is rather on the side of the drivers in the Enterprise.
Or some settings to select the Mz of the Z80 to make it easier if it can't be done automatically. May be with rapid pulses on the RTS line with a program. Or better comunicating by the serial port with the MCU.....
If still should be working the original Neos/MSX mouses, I have to stick to the original timings.
If something goes wrong (communication error) I have to set timeouts. In each transmission cycle.

Online gflorez

  • EP addict
  • *
  • Posts: 2663
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #78 on: 2015.June.03. 11:29:27 »
I think Zozo was only wishing for future enhancements of the interface.

We know already that first you must work on the original MSX protocol.

But.... it would be great to change settings to 10Mhz Z80 inside the MCU programming rather than on the driver, because that wastes less time on the MCU and on the Enterprise side. Faster  Z80 implies longer delays on the driver, and all that is lost in processing time.  

And then, I think a direct selection of the processor velocity could be made with the spare Data-Out pin at the serial port. The underused serial port loses its few use when changing the processor rate, as it changes the software fixed bit-rates.

-----------------
Now I understand you when you talk about interrupts, but sorry, I can't aid you on that. I'm not really a programmer, only a enthusiast of computers...
----------------------------


And talking about programming, the actual driver still doesn't read the additional two Bytes(four nibbles) of the wheel and spare buttons. I think that better we wait until Prodatron implements them on the Enterprise SymbOS port.

Also, the actual driver only reads and stores the value of the main(left) mouse button. The two principal buttons are on the same row, so they can be read at the same time. But the driver hasn't a system variable to store its value.

I don't know still how adding a system variable can be done... May be Zozo can fix the driver? and if so, we also need space for the three spare buttons and wheel information. The PS/2 protocol only have four bits(Z) for the wheel information, but the new MSX protocol returns a complete byte. Then we can perfectly take the four lower Z bits without losing information.

I think we only need one system variable for storing the four buttons state on 4 bits and the wheel on the remaining 4 bits.
« Last Edit: 2015.June.03. 11:47:48 by gflorez »

Offline pear

  • EP lover
  • *
  • Posts: 783
  • Country: pl
  • Z80 only
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #79 on: 2015.June.09. 12:15:37 »
Due to problems at work, I must temporarily suspend work on their projects.
I will try as soon as possible to return for them.
Please be patient.

Online gflorez

  • EP addict
  • *
  • Posts: 2663
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #80 on: 2015.June.09. 13:09:39 »
No problem, we are waiting thirty years now...

Offline pear

  • EP lover
  • *
  • Posts: 783
  • Country: pl
  • Z80 only
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #81 on: 2015.June.12. 08:34:44 »
I made measurements of waveforms (in attachments).
I have a few ideas for optimization, but for now only poorly with time.
I am looking for a new job, because at the present will soon go mad.

Offline pear

  • EP lover
  • *
  • Posts: 783
  • Country: pl
  • Z80 only
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #82 on: 2015.June.12. 11:27:41 »
In summary:
Code: [Select]
          _______        ____        ____        ____        ____________
       +12V       \      /    \      /    \      /    \      /    
RTS      0V        \____/      \____/      \____/      \____/            
                   |
           _________  ____  ____  ____  ____  ____  ____  ____  ____  ____
           +5V      \/ HX \/ LX \/ HY \/ LY \/ HB3\/ LB3\/ HB4\/ LB4\/
D0..D3      0V       \____/\____/\____/\____/\____/\____/\____/\____/
              T2-> | |                                              
              _______     _     _     _     _     _     _     _     ______
READ       +5V       \ 1 / \ 2 / \ 3 / \ 4 / \ 5 / \ 6 / \ 7 / \ 8 /      
(KB0..KB4)  0V        \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/          
               T3->  | |
Tcycle = 20ms
T1 - not important
T2+T3 = about 90us at first nibble and about 65us the other.
Nibbles of bytes B3 and B4 are optional.

For Z80 CPU clocked at 10 MHz, will be shorten the time (T2+T3) of 2.5 times.
Tcycle at 10MHz will also be shorter, or the same ? Myself I've got no chance to check that.

Online gflorez

  • EP addict
  • *
  • Posts: 2663
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #83 on: 2015.June.12. 13:08:50 »
I think it have to be shorter, at the same scale than the reading time, but also I don't have a 10 Mhz EP. You can count them by a hand, I think.

Offline pear

  • EP lover
  • *
  • Posts: 783
  • Country: pl
  • Z80 only
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #84 on: 2015.June.12. 13:28:45 »
If the status of the mouse is read in a loop, its frequency will increase with the CPU frequency.
If on the other hand the read is triggered by real-time clock, the period of the calls will remain unchanged.
It depends on how exactly is written in the mouse driver.

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13517
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
    • http://enterprise.iko.hu/
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #85 on: 2015.June.12. 13:34:42 »
It doesn't use RTC.
« Last Edit: 2015.June.25. 12:21:09 by szipucsu »

Offline pear

  • EP lover
  • *
  • Posts: 783
  • Country: pl
  • Z80 only
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #86 on: 2015.June.12. 13:59:48 »
I did not mean literally the RTC.
I had rather thought, or in EXOS is any amendment to a different frequency than 4MHz.
Is the mouse driver somehow verifies what is the CPU frequency ?

Online gflorez

  • EP addict
  • *
  • Posts: 2663
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #87 on: 2015.June.12. 15:17:33 »

Ok, you are who are developing RTCs on a expansion card...

You mean comparing Z80 frequency with the RTC. But then you are forced to have also a RTC installed.

It could be better the MCU counts the time between impulses and adapt to it.

Online gflorez

  • EP addict
  • *
  • Posts: 2663
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #88 on: 2015.June.12. 15:23:59 »
The mouse driver doesn't measures that, its timings are fixed, but as a software expansion they can be changed on the code.

I already have changed the delays from 8,5,5,5 loops  to 8,1,1,1 loops to save processor time.

Online gflorez

  • EP addict
  • *
  • Posts: 2663
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #89 on: 2015.June.12. 15:37:20 »
Prodatron have a different approach on the EP SymbOS port. He uses the CMOS check to change the read frequency. Ask Zozo how it can be done. Only for the 10Mhz processor.

Seems that the actual frequencies of the driver work on the 6Mhz and 7,12Mhz EPs(NMOS).