CPCWiki forum

General Category => Amstrad CPC hardware => Topic started by: LambdaMikel on 19:51, 17 February 19

Poll
Question: Who thinks that SND pin on expansion port is for sound input?
Option 1: It's for mono sound output only votes: 3
Option 2: It's for mono sound input only votes: 0
Option 3: It's for mono sound input and output votes: 1
Title: LambdaDrum progress & first demo
Post by: LambdaMikel on 19:51, 17 February 19
I decided to split this of from the LambdaSpeak thread (since this is rather old and long and LambdaSpeak is basically finished), so this is where I am spending my current efforts:

https://youtu.be/k0D6YG4FTk4 (https://youtu.be/k0D6YG4FTk4)

Just another PCM sample player for the CPC? Well, yes and no - the difference being it is polyphonic, i.e., has max 3 channels that can be played simultaneously. I know I promised more channels, but this is probably the max I can squeeze out of the old ATMega 644 @ 20 MHz. Next project will use a more recent and powerful CPU.

The samples are uploaded from the CPC into an extra SPI EEPROM (128 KBytes), which is good enough for holding a drum set in decent quality, e.g., from a Boss DR 660 drum computer.

There are still some minor issues in the firmware - sometimes, the ATMega hangs. I believe that this is clock-related and will go away as soon as I have a proper PCB.

Needless to say, all the programs are written in BASIC  :P Uploading of PCM samples from MC will be much faster of course. But the BASIC programs demonstrate that it is very easy to write software for LambdaSpeak - because of its high level firmware, there is no need for complicated drivers. It'll be much nicer of course with @GUNHED (http://www.cpcwiki.eu/forum/index.php?action=profile;u=2029) 's awesome RSX commands! He will be the first who gets a final LambdaSpeak 3.0 such that he can add the new RSX commands for the LambdaDrum / PCM functionality.


Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 12:15, 18 February 19
Great video!
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 17:37, 18 February 19
Quote from: GUNHED on 12:15, 18 February 19
Great video!
Thanks! I guess with your MC code uploading new samples will be blazingly fast... max sample size is 128 KBytes = 256 pages (each page has 2*256 Bytes).

Sadly, I cannot locate any larger SPI EEPROM. 25LC1024 seems to be the max. But 128 KBytes are better than nothing  :)
Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 15:32, 19 February 19
Uploading 128 KB should only take very few seconds.  :) :) :)
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 15:36, 25 March 19
Quote from: LambdaMikel on 19:51, 17 February 19
There are still some minor issues in the firmware - sometimes, the ATMega hangs. I believe that this is clock-related and will go away as soon as I have a proper PCB.
With the PCB finalized and ready to ship, the problem indeed has vanished.
Will post a video tonight. I would claim that the PCM sounds better than on an Amiga.


Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 07:22, 26 March 19
A little pattern-based drum computer in BASIC:

https://youtu.be/BGyaB4OQniw
The polyphonous PCM mode still needs some work... but getting there.
Title: Re: LambdaDrum progress & first demo
Post by: XeNoMoRPH on 10:44, 26 March 19
Quote from: LambdaMikel on 07:22, 26 March 19
A little pattern-based drum computer in BASIC:


The polyphonous PCM mode still needs some work... but getting there.
This software will work on my Lambdaspeak v1.96?
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 15:18, 26 March 19
Quote from: XeNoMoRPH on 10:44, 26 March 19
This software will work on my Lambdaspeak v1.96?
Unfortunately not - this kind of PCM sample playing mode is a new hardware feature of LS 3.0. The PCM samples are being played from the 128 KB SPI EEPROM on the LS 3.0 board - LS 1.95 doesn't have that chip / memory. The samples are not being streamed from the CPC. The BASIC sequencer shown in the video is really just a very simple BASIC program that sends instructions to the LS 3.0 of "what to play" from the EEPROM.

LS 1.95 and LS 1.99 "only" support the Amdrum-kind of sample playing. The Amdrum software has all the PCM samples in memory, and the CPU has to stream the PCM data over the databus. That also continues to work with LS 3.0 of course.

Amdrum sounds surprisingly good considering how little memory there is available for the PCM samples, and given the low bit rates. However, LS 3.0 is able to compete with the Amiga in terms of PCM quality, at least in prinicple - IF can get the artifacts and remaining flaws in the firmware sorted out  ;) Some artifacts are still noticable in the above demo video.
Title: Re: LambdaDrum progress & first demo
Post by: XeNoMoRPH on 11:32, 27 March 19
 :(

Edited
Title: Re: LambdaDrum progress & first demo
Post by: Bryce on 12:26, 27 March 19
This is a Retro Computer Forum, not Twitter. Please don't start a trend of filling the database with useless "emotion GIF's" !!!

Bryce.
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 17:38, 27 March 19
Quote from: XeNoMoRPH on 11:32, 27 March 19
:(

Edited


I can offer a trade in when it is ready to sell. The most expensive reusable part you already own (the text 2 speech click board). If you return your old LS 1.95 (but keep the text 2 speech), and the second ATmega chip I sent you, then I can upgrade you for 20 $ (including shipping). 

Btw, due to limited part availability (it is extremely difficult to get that old big CPLD), I will not produce more than 10 LS 3.0. Of these, 4 are already gone.


If anybody has a source for the XC9572 PLCC84, please let me know. The next project will use recent hardware for sure...
Title: Re: LambdaDrum progress & first demo
Post by: XeNoMoRPH on 18:31, 27 March 19
Quote from: LambdaMikel on 17:38, 27 March 19

I can offer a trade in when it is ready to sell. The most expensive reusable part you already own (the text 2 speech click board). If you return your old LS 1.95 (but keep the text 2 speech), and the second ATmega chip I sent you, then I can upgrade you for 20 $ (including shipping). 

Btw, due to limited part availability (it is extremely difficult to get that old big CPLD), I will not produce more than 10 LS 3.0. Of these, 4 are already gone.


If anybody has a source for the XC9572 PLCC84, please let me know. The next project will use recent hardware for sure...
excellent offer, I will study it later  :)
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 15:47, 01 April 19
Spend some more time optimizing the PCM playback - I was able to add another PCM channel.
Also, I found a better compromise between PCM sample size and quality. Here is LambdaDrum with

4 PCM channels, 8 Bit, 16 kHz

and 10 Boss DR 660 sounds.

https://youtu.be/CklrKWw14GU (https://youtu.be/CklrKWw14GU)
After pre-processing, these samples are about 120 KBytes combined.
For the samples, I am using Audactity for PCM editing, then the Switch Sound File Converter for 8 Bit 16 kHz mono conversion, and then another program to remove all PCM file headers. This results in RAW PCM which can be put on a CPC disk and uploaded into LambdaSpeak's PCM EEPROM sample memory.
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 16:44, 01 April 19
The drum pattern sequencer also made some progress:

https://youtu.be/M7aI7KLEi1s
It has 10 tracks + 1 SPO256-AL2 track now, with 4 channels of PCM, same drum samples as above (8 Bit, 16 kHz, Boss DR 660)
Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 18:14, 01 April 19
Sounds really very well! A real drum computer and more!
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 18:25, 01 April 19
Thank you all!

I have the parts and capacity to build ~6 of these
(4 are already promised / allocated to other people).

In case anybody is interested in purchasing LS 3.0:

       
  • if you already own the text to speech daugherboard, the overall price INCLUDING SHIPPING is 50 $ (USD).
  • if you need the daughterboard, which costs 40 $, then the overall price including shipping is 90 $ (USD).
Please PM me if you are interested.

I will also publish the firmware and Gerbers for those that miss this opportunity. 

I will also assemble a DSK file that contains all the LS 3.0 and LambdaDrum programs shown in the videos, including the PCM samples for the drums etc.

With that being said, this is the end of this thread and also the end of the other threads about LambdaSpeak. Hope you don't mind that I'll also post this info in the other thread.

Thanks for your interest and CU in another thread,

Yours

LambdaMikel

PS No, not an April Fools Day joke :D


Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 18:32, 01 April 19
Of course I will help with software support to have an enhanced LS3 ROM (and an RAM resident RSX extensions for non-ROM CPCs).

Now is the time to request special RSX commands and features.

Time for brains storming.  :)
Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 18:32, 01 April 19
.
Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 10:22, 02 April 19
It is even better than the Amdrum!
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 18:13, 02 April 19
Quote from: zhulien on 10:22, 02 April 19
It is even better than the Amdrum!

Well, it's an unfair comparison... the Amdrum does not have the memory and CPU bandwidth available to be able to compete with LambdaDrum  ;)

But I also improved the Amdrum mode a bit... I spend a couple of days to optimize the OP amp  and audio filter section on the board, and that resulted in some changes and better Amdrum PCM quality as well. It has to do with the OP amp.

Background - unfortunately, a summing OP amp always degrades the audio signal, and the more the more inputs are summed.

So rather than mixing 3 sources with one OP amp like in LS 1.99 (Epson, SPO256-AL2, and PCM from Atmega), I now have the OP amp only sum SPO256 and PCM. The Epson board already has an amplified output anyway, so feeding it into the OP amp like in LS 1.95 and LS 1.99 required large resistors and resulted in bad audio quality and much reduced dynamics and bandwidth of the signal. So that was a bad idea.

Now, in LS 3.0, there is a 8-position DIP switch, 4 for the left output channel, and 4 for the right output channel, and you can assign the signal for the channels as follows:


DIP 1 = OP amp mixer (SPO256 and PCM)
DIP 2 = Epson output (raw)
DIP 3 = SPO256 output (raw)
DIP 4 = PCM output (raw)


And then the same schema for the right channel using DIP 5 to 8.










Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 17:05, 03 April 19
what are the different versions of LS and how do they differ?
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 17:31, 03 April 19
There were many different interim versions, but the once that I officially released are the following:


       
  • LS 1.95 - Epson text-to-speech, SSA1 emu, DKtronics emu, DECTalk, Amdrum PCM mode.
    Audio OP amp mixes PCM and Epson text-to-speech board output (of course, you do
    not have to feed in the Epson into the OP amp input, you can also leave it unconnected,
    then you will only get PCM from the output socket).
  • LS 1.99 - like LS 1.95, with additional optional SPO256-AL2 socket.
    Two more modes: real DKtronics SPO-based reimplementation, and
    real SSA1 SPO-based reimplementation (like the originals). In addition to the emulations.

    Audio OP amp mixes PCM, SPO256-AL2 (if present), and Epson (if input is used, same as above). Feeding Epson output into the OP amp is not such a good idea for reasons explained above.
  • LS 3.00 - like LS 1.99, but with additional 128 KBytes SPI EEPROM for PCM "Onboard" Sample Memory. Additional optional SPO256-AL2, like in LS 1.99.

    New LambdaDrum mode - this supports up to 4 Channels of 8 Bit hiqh quality audio (up to > 20 kHz if sample size is not a concern). These PCMs are played from the EEPROM memory and autonomously by LambdaSpeak. This produces PCM that is far superior in quality compared to Amdrum mode. Of course, there is also still the Amdrum mode in addition, and everything else that LS 1.99 offers. In principle, the EEPROM can be used to store arbitrary data, but the main use case is for onboard PCM sample memory.

    Improved Audio section. The  OP amp mixes PCM and SPO256-AL2 (if present). The Epson output always goes out RAW now, because the click board already has an onboard audio amplifier anyway. I have added a DIP switch for mixing the different audio sources:
    switches 1 to 4 for left channel of stero output, and 5 to 8 for right channel of stereo output.

    DIP 1 = OP amp mixer (SPO256 and PCM)
    DIP 2 = Epson output (raw)
    DIP 3 = SPO256 output (raw)
    DIP 4 = PCM output (raw) 
TFM's RSX software work on all three devices. And he is planning on adding new RSX commands to support the EEPROM PCM stuff.

PS  LS 2.0 to LS 2.99 were supposed to be SMD versions with @Bryce (http://www.cpcwiki.eu/forum/index.php?action=profile;u=225) , but we decided not to do this because it wasn't going to be cheaper, not so DIY-friendly, and also a bit lack of time, but maybe one day there will be an SMD version if somebody wants to make it (not me though). I'll support this by making everything public I have though (Gerbers, Firmware, ...)

Since this is the end of these threads, I wanted to thank @Bryce (http://www.cpcwiki.eu/forum/index.php?action=profile;u=225) again for guiding me through the process! Without him, I would not have started with CPLDs (I was using GALs before), would not have known how to program them, and his "come on, this is not so difficult!" attitude pushed me to use the click text to speech board which requires a large MCU in order to be able to hold the Epson / Dectalk firmware image, which gets uploaded from the MCU into the Epson chip using SPI. In earlier version, I was using the Emic 2 text to speech board, which is self-contained and does not require this (it has its own MCU); hence, earlier versions were satisfied with the  ATMega 328p, compared to the large Atmega644-20pu which 64 KBs which is now being used.

Bryce will get a fully assembled LS 3.0 from me as a thank you.
Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 17:51, 03 April 19
We need a "standard" for the DIP switches, this way it's more easy for people doing software. At the moment I'm not sure which one will be best.
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 18:53, 03 April 19
Quote from: GUNHED on 17:51, 03 April 19
We need a "standard" for the DIP switches, this way it's more easy for people doing software. At the moment I'm not sure which one will be best.


Depends a little bit on what you want to do.  Actually, I got confused by them already - but I printed them on the PCB : they are

MIX EPS AT SPO 

(AT = ATMega = PCM Output)

That means, one could start with

0100 1000

as default. That would give people Epson speech on left channel, and PCM + SPO on right channel.

Then, depending on what people want to do (or even record), then can switch to

Epson on both channels:

0100 0100

or PCM (LambdaDrum / Amdrum) on both channels:

0010 0010

Or LambdaDrum with SPO on both channels (Channel 8 is for SPO):

1000 1000

etc. However, then you don't hear Epson speech at all. BUT, if you have an external mixer, you can just use the Epson board output and mix it externally of course.



Likewise, "SPO RAW" and "PCM raw" give max quality and highest frequency bandwidth because OP amp is bypassed, but especially SPO sounds a little bit faint then. Requires higher gain setting on your amp then.

Needless to say, only one DIP switch should be on for 1 to 4 (left stereo channel), and only one should be on for 5 to 8 (right stereo channel).



Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 07:37, 04 April 19
would a dip switch be possible to connect the audio out of the LS to the audio of the bus?  of course it will be mono - i did that with my real Amdrum (which I no longer have), and the samples then come out the internal speaker - it isn't great sound of course - but it also get's amplified with the normal speaker when that is connected to a stereo system (the samples in mono still since the bus line is mono).  It means less cables - and a dip switch would give people a choice, less cables or better sound.
Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 07:42, 04 April 19

you mentioned the LS had a serial port in the other thread, perhaps one of these can plug into it so you can play mp3s?


They really are cheap (about AU$4 each) and very available on ebay.  I just can't find documentation anywhere as to what commands to send them.  It would allow games to play mp3's via the serial port (play a track, pause, continue etc) - without any CPC CPU time... meaning we can have game packs. 




https://www.ebay.com.au/itm/1X-YX5300-UART-Control-Serial-MP3-Music-Player-Module-for-Arduino-AVR-ARM-P-E7R0/253972842282?epid=9009226204&hash=item3b21f6072a:g:iWwAAOSwcWJb5pPT


I just searched serial mp3 player and found this... i wonder if they are all the same.  last time i was searching for model numbers etc, and all i got was ebay sellers.


http://geekmatic.in.ua/pdf/Catalex_MP3_board.pdf
Title: Re: LambdaDrum progress & first demo
Post by: Bryce on 07:46, 04 April 19
Quote from: LambdaMikel on 17:31, 03 April 19
Since this is the end of these threads, I wanted to thank @Bryce (http://www.cpcwiki.eu/forum/index.php?action=profile;u=225) again for guiding me through the process! Without him, I would not have started with CPLDs (I was using GALs before), would not have known how to program them, and his "come on, this is not so difficult!" attitude pushed me to use the click text to speech board which requires a large MCU in order to be able to hold the Epson / Dectalk firmware image, which gets uploaded from the MCU into the Epson chip using SPI. In earlier version, I was using the Emic 2 text to speech board, which is self-contained and does not require this (it has its own MCU); hence, earlier versions were satisfied with the  ATMega 328p, compared to the large Atmega644-20pu which 64 KBs which is now being used.

Bryce will get a fully assembled LS 3.0 from me as a thank you.

Very kind words LambdaMikel, thank you. I'm glad I was able to motivate you to expand your knowledge and possibly effect future projects of yours too.

Bryce.
Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 07:52, 04 April 19
i am imagining playing with a LS3.1? with serial port enabled and mp3 playback daughterboard - it sings a robotic voice with my own samples and drum arrangements playing over the top of the mp3 as well as AY beeps here and there, all coming through the CPC speaker (optionally) or through an Amp...  damn, the only missing thing is MIDI, but that's another possible use of the serial.  mp3 is more fun to imagine, and perhaps possible to patch Roland In Space to use actual Doctor'n the Tardis music.
Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 12:57, 04 April 19
IMHO LS3 is for anything related to speech, drum-kit stuff and samples. MP3 requires another technology - which is embedded very nice in the SF3 board. They can be used in team.  :)
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 15:08, 04 April 19
Right, LS 3.0 is really final though... I am not making any changes anymore.

Regarding MP3 and Serial etc. - I thought about that. Problem for serial is that I would need another CPC port for receive port, and I do not have a single ATmega pin left! Otherwise I could just add it to the firmware and add RX, TX, GND to the PCB. But I won't.

If anything, for a next probject I would use the

https://www.mikroe.com/mp3-click (https://www.mikroe.com/mp3-click)
and use SPI, not serial.
In the other thread

http://www.cpcwiki.eu/forum/amstrad-cpc-hardware/cpc-hardware-tinkering-platform/ (http://www.cpcwiki.eu/forum/amstrad-cpc-hardware/cpc-hardware-tinkering-platform/)
I was musing about the idea of having a "mikrobus CPC hat" card for the CPC, with 3 or 4 mikro bus slots.

With at least two slots, one could also add some memory

https://www.mikroe.com/microsd-click (https://www.mikroe.com/microsd-click)

to the SD card. With three slots, one could add the text to speech module as well. But would require a large MCU again because of firmware image, adding a lot of complexity, and I don't want to go there. So how about the "blue pill" MCU STM32 board. I think that will be the next project, if any.

There is also a serial click board with proper DB9.

https://www.mikroe.com/rs232-click (https://www.mikroe.com/rs232-click)

And then, there must be a way to write SPI drivers and upload them to the firmware.

I think such a "mikrobus card" (with SPI and I2C support) and a controll MCU (STM32 blue pill) would be very fun. With plug in play of these little modules, people could easily reconfigure it for anything they need / like. OK, you must write a driver for the blue pill. But still - hardware development becomes plug and play from a hardware development point of view then, and hardware development turns into driver programming
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 15:18, 04 April 19
PS And wrt to "singing via DECtalk and PCM drumming at the same time" - thought about that as well, and this is in principle doable with the current LS 3.0 hardware, BUT it is not trivial from a software point of view. Playing high quality PCM put a huge load on the CPU, and communicating via SPI with the Epson speech board over SPI in parallel would be tricky. But doable in principle... for now, there is in addition to the 4 PCM channels the channel 8, which is for the SPO256-AL2. It is easy to communicate with it whilst playing PCM samples, but it cannot sing obviously.

So, it is not impossible that it will "drum and DECtalk sing" at some point. But not this year.

Thanks for the idea though!!  :)
Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 15:25, 04 April 19
Quote from: GUNHED on 12:57, 04 April 19
IMHO LS3 is for anything related to speech, drum-kit stuff and samples. MP3 requires another technology - which is embedded very nice in the SF3 board. They can be used in team.  :)


I am sure the SF3 will be great, but for $4 to play mp3's on a CPC (if you already have an LS or MiniBooster) is pretty sweet.
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 15:27, 04 April 19
Quote from: zhulien on 15:25, 04 April 19

I am sure the SF3 will be great, but for $4 to play mp3's on a CPC (if you already have an LS or MiniBooster) is pretty sweet.
... but why not get John's Usifac for that... then you can do it.

Btw, with the module above you gave the link, there is no way to upload MP3s to the card from the CPC!I have  bought a couple of these 3 to 4 $ cheap ones, and they all lack that capability AFAIK.

So, the CPC is just becoming a remote control for a cheap crap MP3 player  ;)

If the card plays the music from its own storage / memory this is fine of course (and LS 3.0 also does that for PCM!), but AT LEAST it should be possible to upload into the card memory from the CPC. Here, you need to remove the SDcard and put it into your PC  :) Of course, even better would be if you could IN ADDITION to being able to send files to it from the CPC, also STREAM MP3 data from the CPC as well.

Also notice the title - UART *Control* Serial MP3 Music Player, it does not claim to be a UART SERIAL MP3 Music Playe.... 

Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 15:39, 04 April 19
This we could support with LS 3.0 - remove the databus segment bar (it has a socket!), and connect the remote control button to any databus from D7  to D0... then put it into "port echo mode", and turn the bit on with out &fbee,<byte>  :)
https://www.ebay.com/itm/REMOTE-CONTROL-FART-MACHINE-Whoopee-Cushion-Noise-Maker-Box-Joke-Prank-Sound-Toy/173770003817?hash=item28757fd569:g:fHAAAOSww5pbYfyU:sc:USPSFirstClass!94306!US!-1 (https://www.ebay.com/itm/REMOTE-CONTROL-FART-MACHINE-Whoopee-Cushion-Noise-Maker-Box-Joke-Prank-Sound-Toy/173770003817?hash=item28757fd569:g:fHAAAOSww5pbYfyU:sc:USPSFirstClass!94306!US!-1)
(Actually, if you bitbang TX in that way using some databus bit / pin, then it might be possible to control that MP3 serial module as well; the only drawback is that you cannot read its replies with LS 3.0... maybe doesn't matter that much - I can try that for curiousity). So at least one could send serial data to it, but not receive any. As I said, we should be uing John's card for that.

And, to bitbang serial @ 9600 BPS or what such a MP3 module requires minimally also requires machine code... can't test that from BASIC.

PS Just thinking of it - you might just try to connect this MP3 module to the CPC printerport, and bit bang for serial TX control... that should also work, should it not?
Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 16:36, 04 April 19

Quote from: LambdaMikel on 15:27, 04 April 19
Btw, with the module above you gave the link, there is no way to upload MP3s to the card from the CPC!I have  bought a couple of these 3 to 4 $ cheap ones, and they all lack that capability AFAIK.


So, the CPC is just becoming a remote control for a cheap crap MP3 player 


That is correct but it isn't too bad, you have full control of playback and volume so with the games currently released on disc with bundled sdcard, wack the sdcard into the mp3 player.  Games can start the appropriate track at the appropriate time, can fade the music in and out by controlling the volume.  Easy to program, no CPU time.  For sure it has limited functions but it is supposed to work with existing MiniBooster and similar serial ports.


Quote from: LambdaMikel on 15:27, 04 April 19
you need to remove the SDcard and put it into your PC  Of course, even better would be if you could IN ADDITION to being able to send files to it from the CPC, also STREAM MP3 data from the CPC as well.


Yes, and my megadrive should be able to automatically change cartridges also.  Still it is a very cheap option to add some nice musics to a CPC game even BASIC without any overheads.

Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 17:40, 04 April 19
Oh, that is interesting, I had no idea people are doing this... SDCards being released with Games.
(Since I am not that big in gaming - I backed the "Cosmic Force Cartridge" @ Kickstarter though,
for the first time!!)


I can think about serial a little bit more... okay, thinking aloud here... on a second thought, it *might* be possible with the current board... there are 2 ATmega controlled LEDs (RDY and TR). These could in principle become TX and RX for serial, when the "serial mode" is turned on (via a LS 3.0 control byte / command, as usual). One has to pull the 12 Bar LED Segment then (it is socketed). Stick 2 Dupont Wires in there.


One challenge is to do this without having to decode a second port. John's Usifac has a second control port. I am wondering if I could just design a "protocol" using the current LS "control byte" approach. I.e., to initiate serial transfer, send a control byte, number of bytes to transmit, and then the bytes. The bytes get buffered and transmitted via TR LED pin (line). Bits / bytes get received via RDY  at the same time and are being buffered by the ATmega for "later retrieval by the CPC". Then, a couple of control bytes / commands could be used to inquire the buffer status - how many bytes are available, and a command / control byte that initiates   flushing the bytes from the buffer to the CPC (using the same &FBEE port). Well, I really wish I had 2 more pins available on the ATmega, but I don't!


So yes, I think this would be possible with the current board, but I haven't tried it yet.

That scheme would only support half-duplex communication with the CPC though (internally with the serial, it could be full duplex).

It would be easy to add PIN headers for GND, RX, TX to the board (currently, one would need to pull the 12 LED Segment Bar, which is socketed).

Not sure I am going to do this though, but thanks for the suggestion!

And, @zhulien (http://www.cpcwiki.eu/forum/index.php?action=profile;u=58) , a BIG THANKS to you again as well for suggesting the AMDRUM MODE!! I didn't even know about this.
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 18:56, 04 April 19
Quote from: zhulien on 07:52, 04 April 19...  all coming through the CPC speaker (optionally) or through an Amp... 


That was discussed before though, and the conclusion was that the SND pin is not meant to be force-fed with audio. So all cards that do that are doing something potentially harmful to the CPC if I understood correctly.


The SND pin is for (mono) output only, not for input. And for output, it is useless anyway, because of the audio jack, so no idea what that was meant for.


I added a Poll for that  :D
Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 05:04, 05 April 19
i would use that if you had a feature at my own risk.
Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 05:17, 05 April 19

documentation says "Sound (Mono Audio; Output from PSG). This is a mono audio signal generated by mixing the 3 PSG audio channels together."  - Does that mean it is a general sound line for any source that wants it but PSG for now is using it, or it is for PSG use only?


I read the documentation as just stating the fact that the output for the PSG is going to it.  There is no mention of exclusivity, not explicit or implied.

Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 13:59, 05 April 19
Quote from: LambdaMikel on 18:56, 04 April 19
The SND pin is for (mono) output only, not for input. And for output, it is useless anyway, because of the audio jack, so no idea what that was meant for.


Well, first of all they had that pin, so they used it.  ;D  I assume that the SND out pin is for expansions which plug to the expansion port and produce their own sound / speech. This way there would be one common output. The disadvantage is that the great stereo feature of the CPC gets lot that way. Other computers are not that lucky anyway. *


* Quote from the Dictionary of the 'systems which suxx': In contrast to the wonderful ColorPC's from Amstrad - capable of playing stereo and using the PlayCity even Pink Floyds quadrophony other so called home computers are not equipped that well. The worst example regarding sound is the Commodore 64 which has only one sound channel and all his poor SID chip produces sounds like a chainsaw in liquid metal. Oh lord!

Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 15:36, 05 April 19
There is indeed still some space for a little header... and to my surprise, I still had 4 yet unassigned  CPLD pins. Now there is only one CPLD pin left. It is not that simple... the CPLD has to do some signal routing. RX and TX from the new 3-pin header go into the CPLD. Depending on the mode in which LambdaSpeak is, these get either routed to PD0 and PD1 (for RX0 and TX0) when in serial mode, or disconnected (High-Z). Since the pins PD0 - PD7 on the ATMega are usually already used for communication of CPLD -> ATMega (they are inputs), there is a clash between output for PD1 and input for TX0 when in serial mode. Hence, when in serial mode, the CPLD disconnects its PD0 to PD7 outputs completely (High-Z), and routes PD0 and PD1 via 2 more CPLD PINs internally to its 2 output PINs... And vice versa, these two more pins get disconnected when not in serial mode.
So, ATmega's PD0 / TX0 and PD1 / RX0 are being fed into 4 CPLD pins now, and CPLD has 1 more output (TX) and one more 1 input (RX).

So, for the protocol, the ATMega has to receive its "start serial input / output" control byte, buffer all bytes that have to be transmitted, then turn on the serial mode to tell the CPLD to change its internal signal routing, then the 2 TX and RX pin headers can be used for standard ATMega RX0 TX0 serial port. After all bytes have been transmitted or received, the ATMega turns of serial mode, and normal PD0 - PD7 port operation as inputs (outputs from CPLD) continues. I hope that the externally connected USART devices don't mind that TX / RX get disconnected (High-Z'ed) in between transmittions.

I haven't tested that yet. The board required some changes and it routes, and the equations also stil fit into the CPLD. Now I have to try it.
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 20:54, 05 April 19
PS I will also try the SND input idea...
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 09:22, 06 April 19
Thanks to @zhulien (http://www.cpcwiki.eu/forum/index.php?action=profile;u=58) for being persistent in these issues.

https://youtu.be/E_u7NzCXM1k

Audio input into the CPC speaker indeed works. The final version will have 2 more DIP switches (so a 10 DIP instead of an 8 DIP); the 2 new switches allow to turn on and off routing the left resp. right channel into SND. I had to add 10 k Ohm resistors though. I checked the schematics, and this is also the resistor that is being used for the 3 channels for the AY internally. So it seems that these signal are simply being summed within the CPC (with the AY output), like in a standard summing OP amp. 

Next, I also tried the serial interface option - and that also worked, so I will also add the serial headers. I have implemented the new "serial" mode in the CPLD as described above, and as a test, I have connected the Emic 2 which is a USART device to that interface. The video shows that this works. Only transmission at 9600 BAUD tested so far, but I have no reason to believe the recieve and higher BAUD rates should not work. After all, this is the hardware USART in the ATMega, not software USART, so it should be pretty darn fast (up to 115 kbps as well). Good that the soldering iron hasn't gotten cold yet  :)

The PCB has already been rerouted and I should have a batch of new PCBs soon. In the meantime, I finish the firmware for serial transmissions using the control byte and buffering approach described above.
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 17:24, 06 April 19
I'll test the MP3 board next.
Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 12:04, 07 April 19
The PlayCity also used the SND pin of the expansion port as entry. However it does not work with 464/6128 Plus computers. Only with the CPCs.
Maybe it could be helpful to see how Tot0 used this idea and which resistor he uses. But I guess you all know that already.  :)
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 15:43, 07 April 19
I didn't look at the PlayCity, I just looked at the 464 schematics and the resistors in there. They are using 10k resistors, and that looks like a familiar summing op amp configuration (maybe there is an op amp in the cassette recorder).


The resistor values are still subject to some optimization, because the quality and distortation and gain etc. gets worse the more inputs are summed, and the resistor values in the CPC were calculated for 3 inputs to sum. Specifically the epson output is quite loud already and might need a bit larger resistor.


It is quite simple - as long as you have decoupling capacitors it is also safe (and LambdaSpeaks audio outputs have that obviously), and finding the right resistors works best with trial and error.

I don't have CPC PLus here, so I can't try that. I guess for that case it is good that you can disconnect the audio from SND with the 2 more DIP switches.
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 17:35, 08 April 19
Update - the serial interface is working now, and the firmware is almost done.

I can communicate with with Emic 2 @ 9600 bps, 8N1, in both directions. I am using this as a test USART device. I have also ordered one of those FTDI cables for PC terminal test.

Looking forward to receiving the PCBs next week.



The interface will support up to 115 kps; there is also a 2x speed setting, more might be possible.

Since this is an "intelligent" interface, I will add commands / control bytes such as

- read bytes from USART until <bye> encountered (<byte> is an argument, might be CR or LF or... )
- read <n> bytes from  USART
- read bytes for <ms> milliseconds

etc. These commands, once invoked, are executed by the LambdaSpeak firmware, autonomously, and results get buffered, hence no CPU load at all for the CPC. The CPC then needs to retrieve the answer of course.

After that, the bytes are in a buffer, and one can retrieve the bytes from the buffer one by one by calling a control byte /command that puts it on the databus if there is still one available (there is also a control command for checking this).

Transmission work as follows: send the content you want to transmit, that gets buffered in the receive buffer. Then send the "start usart transmission" control byte / command, and the USART transmission is started.

It only uses on port, &FBEE.


Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 18:38, 08 April 19
Here ist a good find for all that wish to connect DB9-based legacy RS232 hardware to USART TTL:


https://www.amazon.com/gp/product/B07GP9SLCH/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1 (https://www.amazon.com/gp/product/B07GP9SLCH/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1)


Finally LambaSpeak can talk to my DECtalk...  :)
Title: Re: LambdaDrum progress & first demo
Post by: TotO on 18:45, 08 April 19
Yes, I have offered this adapter with the MiniBooster.
Your link looks to point an unavaliable item.
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 19:07, 08 April 19
Quote from: TotO on 18:45, 08 April 19
Yes, I have offered this adapter with the MiniBooster.
Your link looks to point an unavaliable item.



Upps, maybe I just bought the last one??

There are different options though:

https://www.amazon.com/NulSom-Inc-Ultra-Compact-Converter/dp/B00OPU2QJ4/ref=sr_1_2?keywords=NulSom+Inc.+Ultra+Compact+RS232+to+TTL+Converter+with+Female+DB9+%283.3V+to+5V%29&qid=1554746808&s=electronics&sr=1-2-catcorr (https://www.amazon.com/NulSom-Inc-Ultra-Compact-Converter/dp/B00OPU2QJ4/ref=sr_1_2?keywords=NulSom+Inc.+Ultra+Compact+RS232+to+TTL+Converter+with+Female+DB9+%283.3V+to+5V%29&qid=1554746808&s=electronics&sr=1-2-catcorr)


https://www.amazon.com/gp/product/B0088SNIOQ/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1 (https://www.amazon.com/gp/product/B0088SNIOQ/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1)


As long as they have

MAX3232
they should be good, right?

I am curious to learn if this will really work with my legacy hardware, since RS232 levels can be in range of -25 to 25 V... I hope that most devices will be fine with what that adapter can produce (is 5 V the max?)


I'll try this with my Amstrad NC100, the Tandy TRS80 Model 100, and of course my DECTalk.

Anybody knows more about voltage levels of existing DB9 CPC Serial Interfaces? Not TTL ones of course...

Title: Re: LambdaDrum progress & first demo
Post by: TotO on 19:12, 08 April 19
You can find it for around 1$ (https://www.ebay.com/itm/MAX232CSE-Transfer-Chip-RS232-To-TTL-Converter-Module-COM-Serial-Board-AD/112071858489?epid=1586990854&hash=item1a1800d939&enc=AQADAAAC8FjVrDbVsZ8oH%2F8PNHtt9VX4%2Fw7FZcmMuqsX8uaFEduV4RglonfTejVaG0G7N7ocvCkUjZOEcHdxFuSVhHeT85PrHwnEcBSeYVtmtExLAKLoy5CAPTl%2FWDz%2FcSK605dEKaHU5J2X%2BWC4JNpe38jScujZjoO3OzACeKh5PC3HrfxoNvT4DEUXLWvPseJP%2F%2FwAFML%2Fbq1TiKS0MWnfHinobu4WXFZZnUvTv%2F6dLUnK4Wt0ZfIcQ6xT87GyDhhqqZclCqdBadJ6PW3IU7hyvgMPG22mFaj7CAm%2FKAXKLq%2BLu%2B2wF9rEf8mVPnv2vhV%2FANzRzbqaX3HHLVQAx%2Bquf2mRm2vq%2Fz6oy7xAsSuckHKAYbV9aGPbu42m6aBLkSjrVHU6q8RoL0QM3qAcvmwbkyaUKPqvNiVRRWno3Ffi4D%2B8z%2FBk7a%2FHtZ4MjDhQpIMH6zmmhh%2F1TsLBBUMVewVPKQESyS9TgEw%2F10vmnDl7ReFwA64eL7gSyVrfGDEb8xQtZ6Ss09XCEEq62In5BrFRY65P7zXBW8LWkzuU%2BFb0CGp7YonYybwkmHQT2X0fvBAHz06h087aTPf0ouQismJxAjsjPSqJirbG9DpbWgYxZSGPIyHbvz43JG9iScP99Odg6z8Dfgf%2BRDT3RVRKOCdCMZMgSizNzIs4NRcljdRCxow5uv%2BtUgfWS3eNz1vITGKbEYyaT49DM55rF57Aiwmo1HJMMwFi1CwMHpuG6sbqsYCoGjPZIuA1Dfho4QsCdDMSB1Ua8%2BzfsgQsxxDYe8IOMmgmmAG0PyQN3M1EzObheNJotHpynP2B%2BvqUtwbhS%2FfNAWvfAvpiGkf3p3C0oU4YIzEShJstPRK7HggmqFne7DU7Cco7OYNkvbFVmuq8iMGQ4i%2F8chfR2WALTCyWUbJTSyAfAukOYv1iZkhWq8g85jW7i6D2n0ELTd32%2B7I9rF6iOekObXjIDZ37cmwqdCnVh%2F6aYKtg%2Fr43IRWcz0Snavpp8UtV&checksum=11207185848928ee9c09e2e845268c448e849b727fdd) on eBay... I have bought close to hundred of them.
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 19:17, 08 April 19
Quote from: TotO on 19:12, 08 April 19
You can find it for around 1$ (https://www.ebay.com/itm/MAX232CSE-Transfer-Chip-RS232-To-TTL-Converter-Module-COM-Serial-Board-AD/112071858489?epid=1586990854&hash=item1a1800d939&enc=AQADAAAC8FjVrDbVsZ8oH%2F8PNHtt9VX4%2Fw7FZcmMuqsX8uaFEduV4RglonfTejVaG0G7N7ocvCkUjZOEcHdxFuSVhHeT85PrHwnEcBSeYVtmtExLAKLoy5CAPTl%2FWDz%2FcSK605dEKaHU5J2X%2BWC4JNpe38jScujZjoO3OzACeKh5PC3HrfxoNvT4DEUXLWvPseJP%2F%2FwAFML%2Fbq1TiKS0MWnfHinobu4WXFZZnUvTv%2F6dLUnK4Wt0ZfIcQ6xT87GyDhhqqZclCqdBadJ6PW3IU7hyvgMPG22mFaj7CAm%2FKAXKLq%2BLu%2B2wF9rEf8mVPnv2vhV%2FANzRzbqaX3HHLVQAx%2Bquf2mRm2vq%2Fz6oy7xAsSuckHKAYbV9aGPbu42m6aBLkSjrVHU6q8RoL0QM3qAcvmwbkyaUKPqvNiVRRWno3Ffi4D%2B8z%2FBk7a%2FHtZ4MjDhQpIMH6zmmhh%2F1TsLBBUMVewVPKQESyS9TgEw%2F10vmnDl7ReFwA64eL7gSyVrfGDEb8xQtZ6Ss09XCEEq62In5BrFRY65P7zXBW8LWkzuU%2BFb0CGp7YonYybwkmHQT2X0fvBAHz06h087aTPf0ouQismJxAjsjPSqJirbG9DpbWgYxZSGPIyHbvz43JG9iScP99Odg6z8Dfgf%2BRDT3RVRKOCdCMZMgSizNzIs4NRcljdRCxow5uv%2BtUgfWS3eNz1vITGKbEYyaT49DM55rF57Aiwmo1HJMMwFi1CwMHpuG6sbqsYCoGjPZIuA1Dfho4QsCdDMSB1Ua8%2BzfsgQsxxDYe8IOMmgmmAG0PyQN3M1EzObheNJotHpynP2B%2BvqUtwbhS%2FfNAWvfAvpiGkf3p3C0oU4YIzEShJstPRK7HggmqFne7DU7Cco7OYNkvbFVmuq8iMGQ4i%2F8chfR2WALTCyWUbJTSyAfAukOYv1iZkhWq8g85jW7i6D2n0ELTd32%2B7I9rF6iOekObXjIDZ37cmwqdCnVh%2F6aYKtg%2Fr43IRWcz0Snavpp8UtV&checksum=11207185848928ee9c09e2e845268c448e849b727fdd) on eBay... I have bought close to hundred of them.


Wow! How cheap can you get... that's a great price!!  :D
Thanks for sharing!
I must say at that price I feel bad for the environment... no way that thing is 1 $ in production cost. Consider all the resources that were spent making that thing. That is great... and terrible at the same time. Like seeing one of these 1 $ calculators at Walmart with solar cells. Makes my heart bleed. The environmental costs are way higher than 1 $... But anyhow.


Do they work well with legacy hardware? Any devices where they wouldn't work?
Title: Re: LambdaDrum progress & first demo
Post by: TotO on 19:33, 08 April 19
I think they have built more than 10000 of them and the production cost is more close to 10cts.

Wrote into the MAX232CSE datasheet:

Supply Voltage (VCC) ...............................................-0.3V to +6V
V+ (Note 1) ..................................................(VCC - 0.3V) to +14V
V- (Note 1) .............................................................+0.3V to +14V

Input Voltages
TIN..............................................................-0.3V to (VCC - 0.3V)
RIN (Except MAX220) ........................................................±30V
RIN (MAX220).....................................................................±25V
TOUT (Except MAX220) (Note 2) .......................................±15V
TOUT (MAX220) ...............................................................±13.2V

Output Voltages
TOUT...................................................................................±15V
ROUT .........................................................-0.3V to (VCC + 0.3V)
Title: Re: LambdaDrum progress & first demo
Post by: TotO on 19:41, 08 April 19
About your Amazon links. Those guys buy them for 1$ in China to resell them 10 times the price.
May be some of them order in China and ship to the buyer address and never seen the items.  :laugh:

Sometime, it is useless to build an expansion module if it already exist with a price that we can not compete, because a giant industrial production versus you.  ;D
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 19:56, 08 April 19
Quote from: TotO on 19:41, 08 April 19
About your Amazon links. Those guys buy them for 1$ in China to resell them 10 times the price.
May be some of them order in China and ship to the buyer address and never seen the items.  :laugh:

Sometime, it is useless to build an expansion module if it already exist with a price that we can not compete, because a giant industrial production versus you.  ;D


Agree with all of that. Still, the real environmental costs of these items is much higher unfortunately. 


Still, would be nice to have a real DB9 on board of a CPC serial interface.


And, not everything we do must be a cheap as possible... the CPC is a hobby, and it is ok to spend some extra money for a thing you love.


Now I ordered also 5 of these 1 $ adapters  :D
Title: Re: LambdaDrum progress & first demo
Post by: TotO on 20:04, 08 April 19
Sure. When you embed it into a part of a full design, the price it is not a real problem compared o the functionnalities.
Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 20:40, 08 April 19
Amazing! Guys take your time to make the final product really awesome!  :) :) :)
Title: Re: LambdaDrum progress & first demo
Post by: Bryce on 21:18, 08 April 19
Quote from: TotO on 19:12, 08 April 19
You can find it for around 1$ (https://www.ebay.com/itm/MAX232CSE-Transfer-Chip-RS232-To-TTL-Converter-Module-COM-Serial-Board-AD/112071858489?epid=1586990854&hash=item1a1800d939&enc=AQADAAAC8FjVrDbVsZ8oH%2F8PNHtt9VX4%2Fw7FZcmMuqsX8uaFEduV4RglonfTejVaG0G7N7ocvCkUjZOEcHdxFuSVhHeT85PrHwnEcBSeYVtmtExLAKLoy5CAPTl%2FWDz%2FcSK605dEKaHU5J2X%2BWC4JNpe38jScujZjoO3OzACeKh5PC3HrfxoNvT4DEUXLWvPseJP%2F%2FwAFML%2Fbq1TiKS0MWnfHinobu4WXFZZnUvTv%2F6dLUnK4Wt0ZfIcQ6xT87GyDhhqqZclCqdBadJ6PW3IU7hyvgMPG22mFaj7CAm%2FKAXKLq%2BLu%2B2wF9rEf8mVPnv2vhV%2FANzRzbqaX3HHLVQAx%2Bquf2mRm2vq%2Fz6oy7xAsSuckHKAYbV9aGPbu42m6aBLkSjrVHU6q8RoL0QM3qAcvmwbkyaUKPqvNiVRRWno3Ffi4D%2B8z%2FBk7a%2FHtZ4MjDhQpIMH6zmmhh%2F1TsLBBUMVewVPKQESyS9TgEw%2F10vmnDl7ReFwA64eL7gSyVrfGDEb8xQtZ6Ss09XCEEq62In5BrFRY65P7zXBW8LWkzuU%2BFb0CGp7YonYybwkmHQT2X0fvBAHz06h087aTPf0ouQismJxAjsjPSqJirbG9DpbWgYxZSGPIyHbvz43JG9iScP99Odg6z8Dfgf%2BRDT3RVRKOCdCMZMgSizNzIs4NRcljdRCxow5uv%2BtUgfWS3eNz1vITGKbEYyaT49DM55rF57Aiwmo1HJMMwFi1CwMHpuG6sbqsYCoGjPZIuA1Dfho4QsCdDMSB1Ua8%2BzfsgQsxxDYe8IOMmgmmAG0PyQN3M1EzObheNJotHpynP2B%2BvqUtwbhS%2FfNAWvfAvpiGkf3p3C0oU4YIzEShJstPRK7HggmqFne7DU7Cco7OYNkvbFVmuq8iMGQ4i%2F8chfR2WALTCyWUbJTSyAfAukOYv1iZkhWq8g85jW7i6D2n0ELTd32%2B7I9rF6iOekObXjIDZ37cmwqdCnVh%2F6aYKtg%2Fr43IRWcz0Snavpp8UtV&checksum=11207185848928ee9c09e2e845268c448e849b727fdd) on eBay... I have bought close to hundred of them.

I have a handful of these lying around somewhere too. They are really handy for quickly slapping together a custom debugger or programmer in just a few minutes.

Bryce.
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 15:30, 11 April 19
Next "milestone" passed - the serial interface is working in both directions, and I have "control command API". So you put LS 3 into Serial Mode using out &fbee,&f1, and then it runs a "serial mode" listener loop which allows you to talk to the USART, RX received USART bytes get buffered using interupts and


ISR(USART0_RX_vect)


and the received bytes can retrieved from the buffer using a "read cursor" which can be positioned, moved forward and backward through the buffer, etc. Below screenshots show a terminal program in BASIC.

Usingthe Emic 2 as test USART at 9600 bauds / 8N1, I can make it speak and also retrieve results from query commands, such as "I" and "C" (user for retrieving "Information" and "Settings" of the Emic 2 over USART).

I can post a video later.

Next - try to connect to the MP3 module and, the PC, and Amstrad NC100 using the FTDI cables and RS232 level shifters with DB9 socket.

Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 16:48, 11 April 19
Oh, that's amazing!!!  :) :) :)


Do you already know specifications like:
- baudrate
- number of stop bits
- Parity?
- bits / transferred unit (5,6,7,8?)
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 16:54, 11 April 19
Quote from: GUNHED on 16:48, 11 April 19
Oh, that's amazing!!!  :) :) :)


Do you already know specifications like:
- baudrate
- number of stop bits
- Parity?
- bits / transferred unit (5,6,7,8?)
So far, I have only "talked" to the Emic 2 USART - 9600 / 8 N 1.
But there should be no problem with the following ATmega USART hardware
settings, I just haven't tried them yet - you can specify all these via serial command bytes.

void usart_on0(uint8_t rate, uint8_t width, uint8_t parity, uint8_t stop_bits) {

  SERIAL_BAUDRATE = rate;
  SERIAL_WIDTH = width;
  SERIAL_PARITY = parity;
  SERIAL_STOP_BITS = stop_bits;

  UBRR0H = 0;   
  switch (rate) {
  case 0 : UBRR0H = ( 520 >> & 0xFF; UBRR0L = 520 & 0xFF; SERIAL_RATE = 2400; break; // 2400
  case 1 : UBRR0H = ( 259 >> & 0xFF; UBRR0L = 259 & 0xFF; SERIAL_RATE = 4800; break; // 4800
  case 2 : UBRR0L = 129; SERIAL_RATE = 9600; break; // 9600
  case 3 : UBRR0L = 86; SERIAL_RATE = 14400; break;  // 14400
  case 4 : UBRR0L = 64; SERIAL_RATE = 19200; break;  // 19200
  case 5 : UBRR0L = 42; SERIAL_RATE = 28800; break;  // 28800
  case 6 : UBRR0L = 32; SERIAL_RATE = 38400; break;  // 38400
  case 7 : UBRR0L = 21; SERIAL_RATE = 57600; break;  // 57600
  case 8 : UBRR0L = 15; SERIAL_RATE = 76800; break;  // 76800
  case 9 : UBRR0L = 10; SERIAL_RATE = 115200; break;  // 115200
  case 10 : UBRR0L = 4; SERIAL_RATE = 250000; break;  // 250000

  default :  UBRR0L = 129; SERIAL_RATE = 9600; // 9600
  }

  UCSR0C = 0;

  switch (parity) {
  case 0 :                                         break; // no parity
  case 1 : UCSR0C |= (1 << UPM01) | (1 << UPM00) ; break; // odd parity
  case 2 : UCSR0C |= (1 << UPM01)                ; break; // even parity
  default : break;
  }

  switch (stop_bits) {
  case 2 :                         break; // 1 stop bit
  case 1 : UCSR0C |= (1 << USBS0); break; // 2 stop bit
  default : break;
  }


  switch (width) {
  case 8 : UCSR0C |= (1 << UCSZ00) | (1 << UCSZ01); break; // 8bit
  case 7 : UCSR0C |=                 (1 << UCSZ01); break; // 7bit
  case 6 : UCSR0C |= (1 << UCSZ00)                ; break; // 6bit
  case 5 :                                          break; // 5bit

  default : UCSR0C |= (1 << UCSZ00) | (1 << UCSZ01);       // 8bit 

  }

  UCSR0B = (1 << TXEN0) | (1 << RXEN0) | (1 << RXCIE0); 

}



Will try 115 k and 250 k bauds soon  :)
Btw, I am quite hopeful for strong and decent signal quality, since the ATmega RX0 TX0 USART outputs are passed through the CPLD, which will result in some signal amplification. So, even with long serial cables, I expect little noise on the lines.

Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 17:12, 11 April 19
Thanks! That already helps to prepare future software.  :)
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 18:40, 11 April 19
Quote from: GUNHED on 17:12, 11 April 19
future software.  :)


future software from TFM is always a thing of the future!  :D

Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 04:33, 12 April 19
Quote from: LambdaMikel on 18:40, 11 April 19

future software from TFM is always a thing of the future!  :D


Hopefully it doesn't stay there.  ;) :) :laugh:
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 05:31, 12 April 19
...nah... TFM brings you the FUTURE TODAY!
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 06:26, 12 April 19
Quote from: zhulien on 07:42, 04 April 19
you mentioned the LS had a serial port in the other thread, perhaps one of these can plug into it so you can play mp3s?

They really are cheap (about AU$4 each) and very available on ebay.  I just can't find documentation anywhere as to what commands to send them.  It would allow games to play mp3's via the serial port (play a track, pause, continue etc) - without any CPC CPU time... meaning we can have game packs. 


https://www.ebay.com.au/itm/1X-YX5300-UART-Control-Serial-MP3-Music-Player-Module-for-Arduino-AVR-ARM-P-E7R0/253972842282?epid=9009226204&hash=item3b21f6072a:g:iWwAAOSwcWJb5pPT (https://www.ebay.com.au/itm/1X-YX5300-UART-Control-Serial-MP3-Music-Player-Module-for-Arduino-AVR-ARM-P-E7R0/253972842282?epid=9009226204&hash=item3b21f6072a:g:iWwAAOSwcWJb5pPT)


I just searched serial mp3 player and found this... i wonder if they are all the same.  last time i was searching for model numbers etc, and all i got was ebay sellers.


http://geekmatic.in.ua/pdf/Catalex_MP3_board.pdf (http://geekmatic.in.ua/pdf/Catalex_MP3_board.pdf)
Here you go - it works well for 4 $, no complaints  :D

http://www.cpcwiki.eu/forum/amstrad-cpc-hardware/cpc-4- (http://www.cpcwiki.eu/forum/amstrad-cpc-hardware/cpc-4-)$-mp3-player-over-usart/

Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 09:52, 12 April 19
So now just need a cpuple of rsx for basic programmers. Playtrack. Fade in track. Fade out track. Pause track. Restsrt track.


No need for skip or back as play does that if you track the track you are playing.
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 15:31, 12 April 19
Quote from: zhulien on 09:52, 12 April 19
So now just need a cpuple of rsx for basic programmers. Playtrack. Fade in track. Fade out track. Pause track. Restsrt track.


No need for skip or back as play does that if you track the track you are playing.
Right, even though these are quite specific... It is not difficult to control the module. You need to send 6 cryptic bytes over serial, and there are a dozen commands or so.

However, it might be better to create an RSX extension which is more generic and would work for all kinds of serial equipment, for example, it might allow you to define "macros" for commands. So , rather than having an RSX |mp3play  command that is specific to this module, I would suggest to have a more generic set of RSX serial commands, for example, |serialmacrodef, "mp3play", "ff 7e 06 .... " (all the control bytes required for play) and then |serialmacrosend,"mp3play" or similar.

Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 15:46, 12 April 19
Quote from: LambdaMikel on 15:31, 12 April 19
Right, even though these are quite specific... It is not difficult to control the module. You need to send 6 cryptic bytes over serial, and there are a dozen commands or so.

However, it might be better to create an RSX extension which is more generic and would work for all kinds of serial equipment, for example, it might allow you to define "macros" for commands. So , rather than having an RSX |mp3play  command that is specific to this module, I would suggest to have a more generic set of RSX serial commands, for example, |serialmacrodef, "mp3play", "ff 7e 06 .... " (all the control bytes required for play) and then |serialmacrosend,"mp3play" or similar.


I agree on that one.  Basically from an mp3 point of view, it is like a midi patch for samples, but rather a song patch for games.  but not really limited to that.  I hope some of the game developers start using it.  Not only on the lambda speak, but also on the minibooster and the other cheaper dedicated serial boards.  Have music options, None, AY-3-8912, PlayCity (if possible), SerialMP3 Lambda, SerialMP3 MiniBooster etc.  99% the same code for all the serial boards so not really an excuse.  The current games on SD Card (physical releases), they do use the SD Card for additional material, but why not add music usable in here too - like Pier Solar does on the Mega CD + Cart.
Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 15:46, 12 April 19
Pier Solar using the included CD Audio CD - https://www.youtube.com/watch?v=EhrC1iJg1TU (https://www.youtube.com/watch?v=EhrC1iJg1TU)
Title: Re: LambdaDrum progress & first demo
Post by: zhulien on 15:51, 12 April 19
Could you imagine playing a patched Turrican with the Amiga music?
Title: Re: LambdaDrum progress & first demo
Post by: TotO on 17:17, 12 April 19
Quote from: zhulien on 15:46, 12 April 19
Pier Solar using the included CD Audio CD - https://www.youtube.com/watch?v=EhrC1iJg1TU (https://www.youtube.com/watch?v=EhrC1iJg1TU)
Go to the credits, you will see my name. :-\

Sure, using MP3 you can have Pinball Dreams musics on CPC too...
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 19:19, 12 April 19
@TotO (http://www.cpcwiki.eu/forum/index.php?action=profile;u=290) in the other thread you said MiniBooster had SPI external interface.
Now was it SPI or is it USART?


A big burden towards using SPI is an external API... nobody wants to flash  / program the ATmega with a driver in order to use a SPI or USART device. So the API and intelligent firmware is the key to such "multi function" devices IMHO. That's why I spend a lot of time programming the firmware and testing with different devices and making it usable from BASIC, such that using the device is as simple as possible. I also have the paradigm that it should be possible without MC. LambdaSpeak firmware is quite a bit of code by now. The ATmega is basically full... I am at 63 KBs of flash ROM. MiniBooster had plenty of empty space in the ATmega and people were suppose to program it, but nobody did it seems.


Sorry for questions, don't know anything about MiniBooster.
Title: Re: LambdaDrum progress & first demo
Post by: TotO on 22:04, 12 April 19
Quote from: LambdaMikel on 19:19, 12 April 19
@TotO (http://www.cpcwiki.eu/forum/index.php?action=profile;u=290) in the other thread you said MiniBooster had SPI external interface.
Now was it SPI or is it USART?
The MiniBooster can handle four slave SPI devices from its expansion connector.

16- SCK
14- SO
12- SI
10- SS0
08- SS1
06- SS2
04- SS3
Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 23:26, 12 April 19
Interesting.
Did it provide any high level API for sending SPI messages from the CPC, or did it require you to program and flash the ATmega in order to use some SPI device.
Title: Re: LambdaDrum progress & first demo
Post by: GUNHED on 15:50, 15 April 19
Quote from: LambdaMikel on 05:31, 12 April 19
...nah... TFM brings you the FUTURE TODAY!


Currently I'm working on FutureNet - the net from the day before yesterday, release date is... very far into future.  ;D
Title: Re: LambdaDrum progress & first demo
Post by: TotO on 18:40, 15 April 19
Quote from: LambdaMikel on 23:26, 12 April 19
Interesting.
Did it provide any high level API for sending SPI messages from the CPC, or did it require you to program and flash the ATmega in order to use some SPI device.
It was by using those MiniBooster ports:

$FF2D    IN/OUT  00-$FF    SPI CONTROL
$FF2E    IN/OUT  00-$FF    SPI STATUS (Read = Status | Write = SS <- bit 0)
$FF2F    IN/OUT  00-$FF    SPI DATA (R/W byte in the SPI)

Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 20:22, 15 April 19
Quote from: TotO on 18:40, 15 April 19
It was by using those MiniBooster ports:

$FF2D    IN/OUT  00-$FF    SPI CONTROL
$FF2E    IN/OUT  00-$FF    SPI STATUS (Read = Status | Write = SS <- bit 0)
$FF2F    IN/OUT  00-$FF    SPI DATA (R/W byte in the SPI)



Seems it is quite easy then to use the SPI, without needing to reflash the ATmega.
Strange that nobody used it, there are great SPI devices available.


Well, at least for devices that don't require high bandwidth.



Title: Re: LambdaDrum progress & first demo
Post by: LambdaMikel on 20:24, 15 April 19
Quote from: GUNHED on 15:50, 15 April 19

Currently I'm working on FutureNet - the net from the day before yesterday, release date is... very far into future.  ;D


Just make sure it doesn't turn into SkyNet, ok?  ??? ::)
Powered by SMFPacks Menu Editor Mod