tzxduino firmware

sP1d3r
Posts: 118
Joined: Mon May 16, 2022 9:20 am

Re: tzxduino firmware

Post by sP1d3r »

jojo wrote: Thu Jun 09, 2022 8:23 pm
ide 1.8.20
and about 3 a4 sheets full of errors ( all libraries are present )
I've noticed that you don't seem to have configured the firmware properly for your screen, the compiler thinks that you have a 16x2 LCD display and it also looks like you might have the wrong libraries installed.

Where did you get the libraries, I downloaded a .rar file from the arduitape blog with all the necessary libraries in it, your SDFat library maybe the wrong one.
Alleged_Geek
Posts: 12
Joined: Thu Sep 30, 2021 7:50 am
Location: Aberdeen, UK
Contact:

Re: tzxduino firmware

Post by Alleged_Geek »

Hi all, just noticed this thread and thought I would try to help out a wee bit with those struggling to write the firmware to the Arduino nano.

There are a couple of options available to you; the first one is fool proof but it doesn’t boast the latest firmware update for the TZX Duino.

I have a Youtube clip and blog entry for this process (which I did for my Acorn Electron) you can download the software written by the very talented rickyelqasem from the link below

https://github.com/rickyelqasem/TZX_Tools

then if you follow my guide on YouTube or my blog

https://alleged-geek.blogspot.com/2021/ ... epair.html

https://www.youtube.com/watch?v=cOlcmH9q0UQ&t=3s

all you would have to do would be change the firmware to the TZXDuino firmware then write to the Arduino Nano.

For uploading the latest firmware, this can be tricky as there are several libraries and user configurations which need to be correct before writing to the Arduino Nano.

* there is also another issue with some cloned Arduino Nano PCB’s where you will have to download and install the following programme in order to get the Arduino Nano to be recognised

https://sparks.gogo.co.nz/ch340.html



For the firmware update Mark Fixes Stuff has put up a good clip of the process in which he uses an older TZX Duino PCB design with a basic LCD screen.

If you follow his instructions about installing Arduino IDE, and downloading the latest firmware for the TZX Duino, I can then advise you how to get it working with the OLED screen I am using with my design.

The links for the YouTube clip and the Firmware update are below

https://www.youtube.com/watch?v=kcOVnLOHpYY

http://arduitape.blogspot.com/2020/09/t ... dated.html

Be careful to install the 1.1.2 version of SdFat when you search for it in the Arduino IDE libraries
The other two libraries required can be installed using the latest versions.

Once you have installed the required libraries, click on the userconfig.h tab in the Arduino IDE window then change the code to suit whichever screen you have.

Here is the original code for the userconfig.h

/////////////////////////////////////////////////////////////////
/* */
/* */
/* Configure your screen settings here */
/* Delete the // of the lines appropriate to your device */
/* */
/* */
/////////////////////////////////////////////////////////////////


//#define SERIALSCREEN 1 /*For Testing purposes only */

#define LCDSCREEN16x2 1 /*Set if you are using a 1602 LCD screen */
#define LCD_I2C_ADDR 0x27 /*Set the i2c address of your 1602LCD usually 0x27 or 0x3f*/

//#define RGBLCD 1

//#define OLED1306 1 /*Defines if you are using a 128x64 or 128x32 OLED screen */
//#define OLED1306_0.91 1 /*Defines if you are using a 0.91" 128x32 screen.*/
//#define OLED1306_1.3 1 /* Use this line as well if you have a 1.3" OLED screen */
//#define SPECFONT 1 /* Use this line if you want to use the Spectrum Font by Brendan Alford

//#define P8544 1 /*Set if you are using an 84x48 PCD8544 screen */

//#define TZXDuino_Logo 1


//#define LCD_USE_1602_LCD_MODULE 1 /*Not used at the moment */

And you should change it to the following

/////////////////////////////////////////////////////////////////
/* */
/* */
/* Configure your screen settings here */
/* Delete the // of the lines appropriate to your device */
/* */
/* */
/////////////////////////////////////////////////////////////////


//#define SERIALSCREEN 1 /*For Testing purposes only */

//#define LCDSCREEN16x2 1 /*Set if you are using a 1602 LCD screen */
//#define LCD_I2C_ADDR 0x27 /*Set the i2c address of your 1602LCD usually 0x27 or 0x3f*/

//#define RGBLCD 1

#define OLED1306 1 /*Defines if you are using a 128x64 or 128x32 OLED screen */
//#define OLED1306_0.91 1 /*Defines if you are using a 0.91" 128x32 screen.*/
//#define OLED1306_1.3 1 /* Use this line as well if you have a 1.3" OLED screen */
#define SPECFONT 1 /* Use this line if you want to use the Spectrum Font by Brendan Alford

//#define P8544 1 /*Set if you are using an 84x48 PCD8544 screen */

//#define TZXDuino_Logo 1


//#define LCD_USE_1602_LCD_MODULE 1 /*Not used at the moment */


I unchecked the //#define SPECFONT as I wanted to use the spectrum font with my firmware.



I hope this helps; again, if you have any problems or queries then please feel free to get in touch.

Best regards,

Steve AKA Alleged-Geek
sP1d3r
Posts: 118
Joined: Mon May 16, 2022 9:20 am

Re: tzxduino firmware

Post by sP1d3r »

Alleged_Geek wrote: Fri Jun 10, 2022 3:18 am Hi all, just noticed this thread and thought I would try to help out

I hope this helps; again, if you have any problems or queries then please feel free to get in touch.

Best regards,

Steve AKA Alleged-Geek
Thanks Steve, I hope that jojo can get his TZXDuino working.
Mine uses an Arduino Pro Mini so it's a bit different.

I bought it from eBay some time ago and it seemed like a great deal, it had the amplifier fitted and a nice 3D printed case and wasn't much more than £25 but because it didn't work properly I put it away because I had a lot to do.
Recently I had another look at it and found that the PCB was soldered terribly, there was far too much solder on it and also one of the capacitors had a resistor in place of it.

I was able to resolder it and fit the correct part and now it works a treat, it took some time to do this but I still think that it's well worth it.
Alleged_Geek
Posts: 12
Joined: Thu Sep 30, 2021 7:50 am
Location: Aberdeen, UK
Contact:

Re: tzxduino firmware

Post by Alleged_Geek »

Hi there, I hope so too, programming Arduinos can be a pain if you don't know which libraries you require, there is also the problem with the configuration for the different types of display.

I thought about using a pro mini with my design but decided against it for a couple of reasons; the first being although it is smaller and takes up less space, I needed the whole width of my design for the switches. The other reason is that the pro mini is more awkward to programme as you need another piece of hardware to programme it.

Glad you managed to get yours working; it must have been very frustrating for you!

Best regards,

Steve
sP1d3r
Posts: 118
Joined: Mon May 16, 2022 9:20 am

Re: tzxduino firmware

Post by sP1d3r »

Alleged_Geek wrote: Fri Jun 10, 2022 11:58 am the pro mini is more awkward to programme as you need another piece of hardware to programme it.
Yes, I think I used an FTDI USB to serial adapter, but because the Pro Mini was soldered in place it's a bit more awkward, took a bit of holding the reset button 'till the right moment to upload the firmware.
Alleged_Geek wrote: Fri Jun 10, 2022 11:58 am
Glad you managed to get yours working; it must have been very frustrating for you!

Best regards,

Steve
The strange thing was the smell of the solder, it was awful!

Thanks again & kind regards
jojo
Posts: 129
Joined: Mon Mar 16, 2020 5:25 pm

Re: tzxduino firmware

Post by jojo »

Steve and all others ,

unit is working as it should with tzxduino 1.15.3 , but i would like to get it to 1.17 or 1.18 and even to 1.19 ( as i found that on the internet too ) .

But no way to get the sketch to work ,
keeps moaning about endif's not assigned properly , loads of defenitions not declared and so on .......

i followed the youtube explanation , adapted the userconfig.h for oled 1306 .

but no luck .

must be my age ;-)
Zx81-16k exp.- Spectrum 48 - Spectrum 128- Interface 1 - DIVide - Zx flashcard- Zx printer - Ram turbo-Velleman interface system-Currah microspeech -Ql - 512k exp.- Ql printer - Cst floppy interf.- Double 3.5 floppy- Minerva - Qimi-and much more .
sP1d3r
Posts: 118
Joined: Mon May 16, 2022 9:20 am

Re: tzxduino firmware

Post by sP1d3r »

jojo wrote: Fri Jun 10, 2022 5:31 pm but i would like to get it to 1.17 or 1.18 and even to 1.19 ( as i found that on the internet too )
Have you seen url;

https://arduitape.blogspot.com/2020/09/ ... dated.html

There are links to the firmware and the libraries to use, might be worth trying the most recent Arduino IDE, deleting all your libraries and installing the recommended ones.

Edit: see also this url:

https://tzxduino.wordpress.com/tzxduino/
Last edited by sP1d3r on Fri Jun 10, 2022 7:54 pm, edited 1 time in total.
jojo
Posts: 129
Joined: Mon Mar 16, 2020 5:25 pm

Re: tzxduino firmware

Post by jojo »

And THAT ( deleting and starting all over ) did the trick !!

Thank you to all members who tried to help me !!

now for the next question , version 1.18 and 1.19 anyone experience with those ?

jojo
Zx81-16k exp.- Spectrum 48 - Spectrum 128- Interface 1 - DIVide - Zx flashcard- Zx printer - Ram turbo-Velleman interface system-Currah microspeech -Ql - 512k exp.- Ql printer - Cst floppy interf.- Double 3.5 floppy- Minerva - Qimi-and much more .
Alleged_Geek
Posts: 12
Joined: Thu Sep 30, 2021 7:50 am
Location: Aberdeen, UK
Contact:

Re: tzxduino firmware

Post by Alleged_Geek »

Hi jojo,

Glad you got it working!

I have just installed ver 1.18 on my TZXDuino (I couldn’t find 1.19)

To get this to work, you will need to change the code in the very last line of the userconfig.h (as well as the same OLED1306 modifications you did earlier on the 1.17 code)

I downloaded the 1.18 firmware from the following github

https://github.com/sadken/TZXDuino

below is a listing of my modified code which selects the screen and SD Card type. To change the settings, look for the display type lines (about the middle of the code) and the SD card type line is the very last line in the code.

I have just tested it out on my ZX Spectrum +2 and all looks good; I am hoping to test it out on my Oric 1 at some point during the weekend.

/////////////////////////////////////////////////////////////////
/* */
/* */
/* Configure your screen settings here */
/* Delete the // of the lines appropriate to your device */
/* */
/* */
/////////////////////////////////////////////////////////////////


// which device/platform are you building.

#if defined(__AVR__)
#define outputPin 9 // Audio Output PIN - Set accordingly to your hardware.
#define LowWrite() {PORTB&=(~(1<<PORTB1));}
#define HighWrite() {PORTB|=(1<<PORTB1);}
#define chipSelect 10 //Sd card chip select pin
#elif defined(__SAMD21__)
#define outputPin 7 // Audio Output PIN - Set accordingly to your hardware.
#define LowWrite() {digitalWrite(outputPin, LOW);}
#define HighWrite() {digitalWrite(outputPin, HIGH);}
#define chipSelect 2 //Sd card chip select pin
#endif

//#define BUTTONS_ADC
//#define BUTTONS_ADC_PIN A3 // buttons on single ADC input pin
// set ADC ranges here (used if BUTTONS_ADC is defined). Set your resistors so that the voltage divider falls in the middle of the bands.
// each #define is the 'lower bound', the upper bound is the next level after it.
// no action triggered when ADC reading between 0 and the level for UP
#define BUTTONS_ADC_UP_LOW 200 // UP action triggered when ADC reading anywhere between this level and the next level (DOWN)
#define BUTTONS_ADC_DOWN_LOW 400 // DOWN action triggered when ADC reading anywhere between this level and the next level (ROOT)
#define BUTTONS_ADC_ROOT_LOW 700 // ROOT action triggered when ADC reading anywhere between this level and the next level (STOP)
#define BUTTONS_ADC_STOP_LOW 900 // STOP action triggered when ADC reading anywhere between this level and the next level (PLAY)
#define BUTTONS_ADC_PLAY_LOW 980 // PLAY action triggered when ADC reading anywhere between this level and 1023 (= upper limit)

// set button GPIO pins (used if BUTTONS_ADC is NOT defined)
#define btnPlay 17 //Play Button
#define btnStop 16 //Stop Button
#define btnUp 15 //Up button
#define btnDown 14 //Down button
#define btnRoot 7 //Return to SD card root

// define HAVE_MOTOR if you want to add support for motor control (requires an extra GPIO)
#define HAVE_MOTOR
#define btnMotor 6 //Motor Sense (connect pin to gnd to play, NC for pause)

// define HAVE_EEPROM if your device has an eeprom compatible with <EEPROM.h>
#define HAVE_EEPROM


//#define SERIALSCREEN 1 /*For Testing purposes only */

//#define LCDSCREEN16x2 1 /*Set if you are using a 1602 LCD screen */
//#define LCD_I2C_ADDR 0x27 /*Set the i2c address of your 1602LCD usually 0x27 or 0x3f*/

//#define RGBLCD 1

#define OLED1306 1 /*Defines if you are using a 128x64 or 128x32 OLED screen */
//#define OLED1306_0.91 1 /*Defines if you are using a 0.91" 128x32 screen.*/
//#define OLED1306_1.3 1 /* Use this line as well if you have a 1.3" OLED screen */
#define SPECFONT 1 /* Use this line if you want to use the Spectrum Font by Brendan Alford

//#define P8544 1 /*Set if you are using an 84x48 PCD8544 screen */

//#define TZXDuino_Logo 1

//#define LCD_USE_1602_LCD_MODULE 1 /*Not used at the moment */

// filesystem options
#define maxFilenameLength 100 //Maximum length for long filename support (ideally as large as possible to support very long filenames)
#define nMaxPrevSubDirs 20 //Number of parent directories to hold i.e. maximum depth of being able to navigate 'back up' through parent folders (ideally as large as possible to support deep file trees)

// Test with reduced SPI speed for breadboards. SD_SCK_MHZ(4) will select
// the highest speed supported by the board that is not over 4 MHz.
// Change SPI_SPEED to SPI_FULL_SPEED or SD_SCK_MHZ(50) for best performance.
//#define SPI_SPEED SD_SCK_MHZ(4)
#define SPI_SPEED SPI_FULL_SPEED

// support exFat?
// SD_INCLUDE_EXFAT_SUPPORT
// set to 1 to include exfat, 0 to exclude exfat (fat16/fast32 only), or undefine to just automatically choose for you - based on available ram
#define SD_INCLUDE_EXFAT_SUPPORT 0 // 0 or 1 . 0 means 'do not include exfat support', which will make the smallest firmware
// SD_FAT_TYPE
// Using the SD_INCLUDE_EXFAT_SUPPORT is preferred but if you want to use the SdFatConfig.h approach (as documented in sdfat docs)
// or you want to hardcode the support type yourself (e.g. if you want ONLY exfat and no fat32 support) you can #define SD_FAT_TYPE directly
#define SD_FAT_TYPE 0 // 0 or 1 or 2 or 3 , see sdfat docs


After changing this, I simply uploaded it to my TZXDuino and it works a treat.

I hope this helps

Best regards,

Steve
jojo
Posts: 129
Joined: Mon Mar 16, 2020 5:25 pm

Re: tzxduino firmware

Post by jojo »

Thanks steve ,

does yours now also indicate tzxduino 1.20 ??

buttons behave rather erratic , you need to push double ?


jojo
Zx81-16k exp.- Spectrum 48 - Spectrum 128- Interface 1 - DIVide - Zx flashcard- Zx printer - Ram turbo-Velleman interface system-Currah microspeech -Ql - 512k exp.- Ql printer - Cst floppy interf.- Double 3.5 floppy- Minerva - Qimi-and much more .
Post Reply