Problems with converting Arduino Nano code over to Maple Mini. Help needed.

Buleste
Posts: 43
Joined: Sun Nov 06, 2016 12:19 pm

Re: Problems with converting Arduino Nano code over to Maple Mini. Help needed.

Postby Buleste » Tue Jan 31, 2017 5:33 pm

victor_pv wrote:What's the TimerOne library for? I haven't used it before.
A note of advice, when working on my port of the TMRPCM library I found HardwareTimer provides only the most basic features of the timers, but there are some core functions that can do more, and then all registers and bits are defined in the core, so for anything advanced other than generate PWM output and trigger an interrupt, you should go and have a good read on the stm32f1 reference manual and learn how the timer peripherals work, then you can go setting registers as you need.

BTW, there is a thread called something like "My maple mini just let go of the magic smoke" that shows some issues with the hardware, and some could be corrected. I started it when I thought I had burnt the MCU, and found out it was just the voltage regulator and a diode and was able to replace them.

Timer one is similar to HardwareTimer for the Maple Mini.

Best example of what it does can be found here http://playground.arduino.cc/Code/Timer1 Although we use Paul Stoffregen's modified TimerOne library which is faster and works on more boards.

We use it to help generate the sound pulses required to convert TZX/TAP/CAS files into noise that the computers can detect.

victor_pv
Posts: 947
Joined: Mon Apr 27, 2015 12:12 pm

Re: Problems with converting Arduino Nano code over to Maple Mini. Help needed.

Postby victor_pv » Tue Jan 31, 2017 7:58 pm

Buleste wrote:Timer one is similar to HardwareTimer for the Maple Mini.

Best example of what it does can be found here http://playground.arduino.cc/Code/Timer1 Although we use Paul Stoffregen's modified TimerOne library which is faster and works on more boards.

We use it to help generate the sound pulses required to convert TZX/TAP/CAS files into noise that the computers can detect.


So those files don't have PCM samples like the wav do?

victor_pv
Posts: 947
Joined: Mon Apr 27, 2015 12:12 pm

Re: Problems with converting Arduino Nano code over to Maple Mini. Help needed.

Postby victor_pv » Wed Feb 01, 2017 3:57 am

This is an earlier version of the sketch, it doesn't use set module, instead it uses SPI1 for the sdcard, and SPI2 is a new object of the spi class declared in the tft cpp file

Code: Select all

SPIClass tftSPI(2);


This was an earlier test, I believe this one just played some file or files, but did not react to any button.
Anyway, here it is in case it helps.

coos_display_blink_wav.zip
(15.84 KiB) Downloaded 3 times

User avatar
BennehBoy
Posts: 386
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Problems with converting Arduino Nano code over to Maple Mini. Help needed.

Postby BennehBoy » Wed Feb 01, 2017 7:45 am

victor_pv wrote:
Buleste wrote:We use it to help generate the sound pulses required to convert TZX/TAP/CAS files into noise that the computers can detect.


So those files don't have PCM samples like the wav do?


Those files are just the data that would normally be loaded by the tape system, most emulators use similar, C64 also for example.

See here -> http://faqwiki.zxnet.co.uk/wiki/TAP_format
-------------------------------------
https://github.com/BennehBoy

Buleste
Posts: 43
Joined: Sun Nov 06, 2016 12:19 pm

Re: Problems with converting Arduino Nano code over to Maple Mini. Help needed.

Postby Buleste » Wed Feb 01, 2017 11:31 am

victor_pv wrote:
Buleste wrote:Timer one is similar to HardwareTimer for the Maple Mini.

Best example of what it does can be found here http://playground.arduino.cc/Code/Timer1 Although we use Paul Stoffregen's modified TimerOne library which is faster and works on more boards.

We use it to help generate the sound pulses required to convert TZX/TAP/CAS files into noise that the computers can detect.


So those files don't have PCM samples like the wav do?

In their simplest forms no.
The most extensive information for one of those file formats can be found here. http://www.worldofspectrum.org/TZXformat.html

Those files are just the data that would normally be loaded by the tape system, most emulators use similar, C64 also for example.

See here -> http://faqwiki.zxnet.co.uk/wiki/TAP_format
That's actually for the Spectrum TAP file format which is surprisingly different to the C64 TAP file format. There are also several CAS file formats for different machines too. It's a fun old world. Lol

User avatar
BennehBoy
Posts: 386
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Problems with converting Arduino Nano code over to Maple Mini. Help needed.

Postby BennehBoy » Wed Feb 01, 2017 11:49 am

Buleste wrote:That's actually for the Spectrum TAP file format which is surprisingly different to the C64 TAP file format. There are also several CAS file formats for different machines too. It's a fun old world. Lol


Yup I was pointing out the speccy tape format, probably just my wording that could be read as it being for c64.
-------------------------------------
https://github.com/BennehBoy

Buleste
Posts: 43
Joined: Sun Nov 06, 2016 12:19 pm

Re: Problems with converting Arduino Nano code over to Maple Mini. Help needed.

Postby Buleste » Thu Feb 02, 2017 6:21 pm

I've managed to get bot TZXMaple and CASMaple compiling. I had to // out some of the EEPROM lines for the moment whilst I figure them out but I can't test anything just yet to see if it works as it should. Hurry up AliExpress.

victor_pv
Posts: 947
Joined: Mon Apr 27, 2015 12:12 pm

Re: Problems with converting Arduino Nano code over to Maple Mini. Help needed.

Postby victor_pv » Fri Feb 03, 2017 4:16 am

Buleste wrote:I've managed to get bot TZXMaple and CASMaple compiling. I had to // out some of the EEPROM lines for the moment whilst I figure them out but I can't test anything just yet to see if it works as it should. Hurry up AliExpress.


The stm32f1 doesn't have an integrated EEPROM. There is a library as part of the core that can emulate an eeprom from a page of flash memory. Thats fine if it will hold values that very rarely change, otherwise the flash page may wear out, since it can be rewritten like 1000 times vs hundreds of thousands for an eeprom.

Buleste
Posts: 43
Joined: Sun Nov 06, 2016 12:19 pm

Re: Problems with converting Arduino Nano code over to Maple Mini. Help needed.

Postby Buleste » Fri Feb 03, 2017 11:21 am

victor_pv wrote:
Buleste wrote:I've managed to get bot TZXMaple and CASMaple compiling. I had to // out some of the EEPROM lines for the moment whilst I figure them out but I can't test anything just yet to see if it works as it should. Hurry up AliExpress.


The stm32f1 doesn't have an integrated EEPROM. There is a library as part of the core that can emulate an eeprom from a page of flash memory. Thats fine if it will hold values that very rarely change, otherwise the flash page may wear out, since it can be rewritten like 1000 times vs hundreds of thousands for an eeprom.

Yeah I found the EEPROM library and I'm just getting to grips with it. I may need to consider an external EEPROM though.

User avatar
BennehBoy
Posts: 386
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Problems with converting Arduino Nano code over to Maple Mini. Help needed.

Postby BennehBoy » Fri Feb 03, 2017 11:25 am

Can't you write to the SD? (not withstanding the level shifting issues on your existing reader, but I mean as an alternative to having to incorporate a physical eeprom)
-------------------------------------
https://github.com/BennehBoy


Return to “Maple mini”

Who is online

Users browsing this forum: No registered users and 1 guest