s_d_a_i wrote:I don't know exactly the maple documentation so I'm not sure if this is right or not.
00 00 - L R shift (not used in arcade)
FF 5F - buttons, pressed RIGHT+DOWN
80 80 80 80 - two sticks, 80 is center (not used in arcade)
Re: Adapter for MAPLE (Release)
Posted: Sun Oct 11, 2020 6:37 pm
by s_d_a_i
Ok I see, I used as guide the page https://bookstack.kairohm.dev/books/dre ... n-catchall the document E_MapleBus_Peri_HW_Spec.7z has a PDF called 05_Svs090e.pdf, there is the oficial documentation but seems the table with the read format is wrong.
Re: Adapter for MAPLE (Release)
Posted: Sun Oct 11, 2020 6:59 pm
by megavolt85
s_d_a_i wrote:there is the oficial documentation but seems the table with the read format is wrong.
that's right, you just didn't take into account that MAPLE has a different byte order
turn every four bytes and everything will become clear
Re: Adapter for MAPLE (Release)
Posted: Mon Oct 12, 2020 12:41 am
by mstar
Following with interest
Great project - i wonder, could we use this to somehow (not sure on the hardware-side) create a twinstick?
I mean, that'd be awesome, considering they're pretty pricey and would be a boon to have for some games
Re: Adapter for MAPLE (Release)
Posted: Mon Oct 12, 2020 3:32 am
by megavolt85
mstar wrote:
Great project - i wonder, could we use this to somehow (not sure on the hardware-side) create a twinstick?
the most difficult thing is to make the case itself
it takes no more than half an hour to change the firmware for Twin Stick
Re: Adapter for MAPLE (Release)
Posted: Mon Oct 12, 2020 8:56 am
by megavolt85
Twin Stick
Hot keys:
X + Y + D + lLeft / lRight - Prev/Next VMU bank
hello! i have the stm32xxxxxxx! but i dont know how upload the ".bin" from PC. I need the usb to serial adaptor? please guys, could you help me with a "step by step"?
Re: Adapter for MAPLE (Release)
Posted: Tue Oct 13, 2020 3:44 pm
by megavolt85
you can use ST-LINK V2
or USB-UART
Re: Adapter for MAPLE (Release)
Posted: Wed Oct 14, 2020 3:38 am
by s_d_a_i
Hi Alexislight,
You have to download https://www.st.com/en/development-tools ... t-software if you want to program the pill with the st-link (I recommend you this way), this software installs the driver required for the st-link in order to work properly and even allows you to debug your code.
The first time you open it with the st-link on your usb port, go to "ST-LINK->Firmware update" so you have the latest firmware version on your ST-link, then "File->Open File" and load the .bin file, once loaded go to "Target->Connect" and then to "Target->Program & Verify", and now if you see no error it should be working.
(Flashing times are way worse on the clones).
Hi megavolt85,
The errors I'm having are due to the 3.3 LDO and the bad quality capacitors on the LDO prefiltering and postfiltering, the problem are the rising edges mostly, it takes a while to get to the 3.34v level and I've got a lot of packet error, this is why it has this behavior on the menu, I guess.
As I can see you have to answer before 1ms so the bus doesn't reset the device, but I think it is not mandatory to answer with 2Mbps, a response at a lower rate like 1Mbps will be accepted by the bus as well isn't it?
Re: Adapter for MAPLE (Release)
Posted: Wed Oct 14, 2020 2:34 pm
by s_d_a_i
Tested on the black pill (the one with the 5v regulator) and it is working as well.
The EMI noise problem is solved, it was the SMPS I'm using with the monitor, the ground noise was propagated to the video ground to the controller.
I have some shots comparing the "clean" signals from the Dreamcast taking control of the bus and the STM32.
This is the Dreamcast using the bus:
And this is the STM32 using the bus:
STM32 zoomed to 200ns:
What I've learned about the SMPS problem was the following, with some random noise there are 2 problems, one can be solved, the other not:
1- With some noise the edges are overlapping on some bits triggering some buttons, this may be solved lowering the speed on the returned messages maybe, but I think it cannot be solved and it only happens during noise.
2- If there is too much peak noise and the DC resets the bus the blue pill never reconnects again and the controller is lost, this doesn't happen with the real hardware.