CASDuino recording functionality

Pagina 4/7
1 | 2 | 3 | | 5 | 6 | 7

Van RvS

Expert (94)

afbeelding van RvS

26-10-2021, 08:56

Danjovic][quote=RvS wrote:
Quote:

...
I still hope that using the internal reference voltage will solve the noise issue and enable a casduino with recording functionality with only 2 resistors and a capacitor.

Do not worry about adding extra components as long as they pay off their tickets to jump in the project Smile

The components for the amplifier/comparator are in, so I can start testing that on Wednesday.

Van RvS

Expert (94)

afbeelding van RvS

26-10-2021, 09:05

Hi Casduino, I saw the picture of your set-up and I have a few tweaks to increase performance.
Can you connect the black wire to the other side of the board (maybe the '-' connection)?
The resistors and the capacitor need to be mounted as close to the Arduino as possible (ideally on the pins) to minimize noise pick-up. If soldering straight to the board is no option, twisting those wires will help as well.

If you use the reference pin, please use the latest version from github. The circuit should also work with the 22k and 4.7k resistor (22k connected to Vref, 4.7k connected to gnd).
For the sd card write delay, I will try to work on a 'pre allocating' part. Maybe that will help.

Van capsule5000

Master (159)

afbeelding van capsule5000

31-10-2021, 16:25

Hi everyone, good afternoon. I'm a bit lazy about arduino programming, but I can provide a finished project of a Casduino with a MEGA2560 microcontroller, instead of the arduino nano. It is a finished project with the REC jack in an experimental way to add that function.

This project was added the REC jack experimentally until we found the arduino programming to include this new function

At the bottom of the board you can see the REC jack and two RED squares (OUT JACK REC) that would be the outputs of the REC JACK (experimental) to be able to connect it to any pin of the ARDUINO MEGA 2560.

If you want to use this finished project to add the REC function you can find it for free download from:
https://github.com/capsule5000/CASduino-MEGA.

Within the project is the firm MAXDUINO 1.54M (Maxduino for MEGA2560 microcontroller) and the necessary libraries.

Van CASDuino

Champion (339)

afbeelding van CASDuino

31-10-2021, 18:08

No thanks. Already got my own Mega 2560 setup working just need to integrate TZXDuino into it but will be working on adding the record to see if it will work first. Need to be able to adjust the pins myself for the record.

Van RvS

Expert (94)

afbeelding van RvS

10-11-2021, 11:57

I have updated the code and changed from writing bytes to writing blocks. This is a lot faster.
On github, I also added a .ino file to test sdcard write latency. Please run this to detect any issues with the card/interface/library.
Also, I have added my MSX basic test script (random.bas) that loads a 16k random file (random.bin). It will load the random.bin file and save it at 1200bps and at 2400bps (each 5 times).
I have tested 4 different arduino boards (original Arduino Uno, original Arduino nano and 2 nano clones) and 3 sdcards (128MB sd, 2GB SDHC and 32GB SDHC) and they all pass the test at 1200 and 2400 bps.

Another route to adding recording functionality is to add a bit of hardware that mimics the MSX tape input:

It amplifies the signal ~20 times and feeds it to a comparator. The output can be fed to a digital pin (input). The schematic and board are available (EAGLE_tape-in.zip). The board is now assembled and I am re-writing the routines.

Van RvS

Expert (94)

afbeelding van RvS

10-11-2021, 13:20

Quote:

If you want to use this finished project to add the REC function you can find it for free download from:
https://github.com/capsule5000/CASduino-MEGA.

I would like to see the schematic. Do you have this available?

Van CASDuino

Champion (339)

afbeelding van CASDuino

10-11-2021, 22:47

Okay. Still having issues, even with the new code.
I have a new simple PCB to rule out my bad soldering.
Using the ref to power

Signal detected, 1200bps, threshold [au]:2003
Open file time [µs]:28336
Filename:RECORD12.CAS
Write time header [µs]:29952
Error:18
Write time [µs]:160
Write time header [µs]:408
Error:18
Write time [µs]:156
Write time header [µs]:416
Error:18
Write time [µs]:156
Write time header [µs]:460
Error:18
Error:16
Write time [µs]:160
File closed

Strangely the first time there was still the 6second delay. After running the sdcard test it's 2 second.

Ran the sdcard-delay.ino and got the following

Test results
Minimum write time [us]:76
Maximum write time [us]:2228700

Tried again and this time it was back to the 6 seconds.

Signal detected, 1200bps, threshold [au]:1932
Open file time [µs]:92916
Filename:RECORD13.CAS
Write time header [µs]:6652684
Error:19
Error:16
File closed

Van RvS

Expert (94)

afbeelding van RvS

11-11-2021, 22:14

This is infuriating... I cannot reproduce the issue. In the 80's this would be the point where I would pick up my MSX stuff and my bike and visit you Smile
From what I can see, the sdcard delay is a card issue. The 3 cards I tested (formatted with the SD Memory Card Formatter, no files on the card), the maximum delay is below 100ms. From documentation for SDHC cards, 500ms is what I could find. More than 2.2s for a 64 byte write is too slow by any means (~230 bits/s). Can you try other cards?
With regard to the decoding, these could be errors in my code, noise pick-up, adc issues on the board, differences between MSX computers and plenty of others. I think the only way to solve this is by swapping parts.
I could send you a prototype to test at your side.I will also include the amplifier/comparator circuit, that should work in any case.

Van CASDuino

Champion (339)

afbeelding van CASDuino

11-11-2021, 22:40

Perhaps it's because there are files on the sd card. I'll see if I have any I can sacrifice the data on them. I should do.

Van capsule5000

Master (159)

afbeelding van capsule5000

13-11-2021, 17:14

The scheme is this. The REC jack (experimental) is not in the diagram because if you see in the previous image it is not connected to any place. There is only the jack socket and some output pins next to the MEGA2560 to make the connection bridges.

If the scheme is not well observed, I can send it to you by mail.
Greetings

Pagina 4/7
1 | 2 | 3 | | 5 | 6 | 7