Page 35 of 60

Re: TF CD32 Riser Revision 2 Design Complete

Posted: 20 Oct 2020 23:04
by arkadiusz.makarenko
And mouse is working now :) (can't add movie to show)

Sort off... still gliches on overflow as I have X and Y in 16bit int, need to guard it better (I have done it for Atari ST I think, so will grab it from there)

EDIT
...ST takes uses 2x 16bit ... I need to have a look at SmallyMouse2

Re: TF CD32 Riser Revision 2 Design Complete

Posted: 21 Oct 2020 08:46
by terriblefire
Those two 8 bit registers are signed registers that the chipset adds offsets obtained from the mouse to (I think).

Well done on the reading. I had a feeling this whole exchange between the CPLD and the ARM would be trickly to get right.

In other news the new revision is built by JLCPCB and should ship today.

EDIT: my code example had working mouse x y with the spi path.

Re: TF CD32 Riser Revision 2 Design Complete

Posted: 21 Oct 2020 10:35
by arkadiusz.makarenko
Mouse issue was caused by too high mouse DPI, simply by dividing X/Y by 2 makes it nicely usable.

This change fixed one thing and broke another one.
Writes do not work correctly any more, anyway it was needed only for setting RTC (and rtc detection)... will fix it later.

Next mouse button clicks and joypad support.

Re: TF CD32 Riser Revision 2 Design Complete

Posted: 21 Oct 2020 11:20
by terriblefire
excellent.

One thing we will need to do eventually is only take over a function if the device is plugged in... e.g. only PUNT for mouse access if mouse is plugged in. Similarly for joypads.. should be just a case of using 2 x INTSIG for this.

Keyboard pins should probably also go tristate when a keyboard is not plugged in.

Can be done last though.

Re: TF CD32 Riser Revision 2 Design Complete

Posted: 21 Oct 2020 22:42
by arkadiusz.makarenko
joypad, left mouse button and fire now is working...
RTC write issues solved. Still need to learn how rtc do wake up from battery supply.

right and middle buttons to go...

Re: TF CD32 Riser Revision 2 Design Complete

Posted: 21 Oct 2020 23:57
by terriblefire
arkadiusz.makarenko wrote: 21 Oct 2020 22:42 joypad, left mouse button and fire now is working...
RTC write issues solved. Still need to learn how rtc do wake up from battery supply.

right and middle buttons to go...
Sweet. I really need to try this.

Re: TF CD32 Riser Revision 2 Design Complete

Posted: 22 Oct 2020 10:39
by arkadiusz.makarenko
Why nothing can be easy like toggling a bit on register? :D

When I only override POTGOR and flip bits on presses Amiga and Diagrom on boot still thinks that right button is clicked.
When eventually I manage to boot to workbench right click feels sticky, but ATK I can see that those tests are working as expected.

When I run tests in Diagrom I can see that except bits in POTGOR - POT0DAT POT1DAT counters are incrementing on button clicks, so I guess I need to replicate this and see what will happen.

Edit:
Or I will try to use POTGO address first. <- No....

Re: TF CD32 Riser Revision 2 Design Complete

Posted: 22 Oct 2020 15:48
by arkadiusz.makarenko
Got it working on normal Workbench and I have normal OS start with ability to get to Boot screen etc. Everything seems to be fine. Unfortunately diagrom doesn't start on boot screen - goes to pink'ish screen.
There might be some more meaningful output via serial, but can't connect it to check why it is complaining. I have the same issue when I connect Amiga/Atari mouse to the port 1.

Edit.
ARM is messing with boot somehow. It must be one of GPIO setups of one of pins.

Edit2:
...and changing PushPull to Open drain on Fire1 and Fire0 pins solved boot issue.

Need to tidy up the code and will push it to github.

Todo
1.Add enable/disable
2.Debug and add init/deinit section to usb middleware
3. Optimize it, especially interrupt routines.

Re: TF CD32 Riser Revision 2 Design Complete

Posted: 22 Oct 2020 19:46
by terriblefire
Dont forget CD32 joypad buttons :)

Re: TF CD32 Riser Revision 2 Design Complete

Posted: 22 Oct 2020 20:14
by arkadiusz.makarenko
terriblefire wrote: 22 Oct 2020 19:46 Dont forget CD32 joypad buttons :)
...yes... can we move it to phase 2 ? :D

I don't even know how to test it now.