Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - zelea2

Pages: 1 [2] 3
16
preenfm2 and preenfm3 / Re: PCB ready
« on: January 13, 2018, 06:57:35 AM »
[Anyways I have 10pcs now and by the end of this week I plan to solder and run my test programs on one.

I've managed to solder 2 boards. On my first try each processor was working on the other board. Quickly traced this to a short and some passives soldered to one end only. Now I have both uP blinking LEDs on both boards but I haven't done any more testing.

Unfortunately I've over-estimated my soldering. It took me a total 6 hours to solder these 2 board (so 3h/board).
All the ICs went very fast, probably an hour for both boards. The switches, encoders and electrolytic  caps another half an hour. What's killing the rest of the time are the passives. There are 144 passives per board with 2 ends each ;-)  and you have to pay attention to all the different values. That comes to about 1 minute per passive.

With this time consuming experience in mind I probably won't solder anymore boards any time soon. I'll have to forget about all those 0603's first. For my future testing I won't need any more anyways.

The good news is that I haven't found anything wrong (yet) with my design like unmatched footprints or schematic faults. The next few days I'll prove all the audio chain and then I'll be ready to install the real software.

This is how I've spent my Friday evening and night ...

17
preenfm2 and preenfm3 / Re: PCB ready
« on: January 07, 2018, 08:59:08 AM »
I did get an great deal. 37$ delivered for 10 PCB (green mask only). I could have got a stainless steel stencil for just another 13$. Crazy prices from EasyEDA.

After a quiet period I'm back. My boards arrived in the post 42 days after I've ordered them. I was hoping to get them before XMAS so I can do some work over the break but no luck. It took EasyEDA 25 days to manufacture them and another 17 days to get them shipped. This was the first time I've used them and I am not very happy about this delay. In the past I've used "ITEAD Studio" "Seeed Studio" and "Dirty PCBs" which were also cheap and I've received boards in about 3 weeks time instead of 6. This time I've cheapened  and got EasyEDA  as the first entry from  http://pcbshopper.com . Lesson learned not to use them again unless I don't care about the delivery time.

Anyways I have 10pcs now and by the end of this week I plan to solder and run my test programs on one. To test the functionality I will just use 4 encoders to generate sine waves with all the piano notes on all 4 output channels.

18
preenfm2 and preenfm3 / Re: PreenFM2 SMD version - F1 firmware
« on: November 29, 2017, 01:05:26 AM »
I plan to use all the available 4 timers in a round robin scheme  to start a one-shot count when a switch/encoder is pressed and ignore any following presses until the timers elapse. With 4 timers I can keep track of 4 simultaneously pressed switches/encoders.

I've added the timer filtering and 2 new commands to interrogate the F1 firmware date/version and to get a configuration word which says how many audio channels are soldered on the board. Presumably the F1 will be only programmed once when the board is soldered so it makes sense to hold this configuration word.

The code can be compiled now with both CrossStudio and a makefile. I've briefly tested the code on one of those chinese STM32F103 boards and the surface controller code seems to work fine.

19
preenfm2 and preenfm3 / Re: PreenFM2 SMD version - F1 firmware
« on: November 25, 2017, 02:35:20 AM »
I have finished a rough version of the STM32F103 firmware
If anyone wants to have a look it's here http://uglyduck.ath.cx/PreenFM2_SMD/SurfaceControl_F103.tar.gz

The processor sleeps most of the time, it's only awaken by the systick interrupt every milisecond or by a surface event or a SPI command. I have 5 encoders + 5 encoder switches + 7 switches so that's 17 and the processor only has 16 EXTI lines. So switch 6 has to be separately scanned every milisecond.

At the start a LED is flashed 6 times so you can see the processor is alive. A second LED near encoder5 shows the function of this encoder - if it's lit then the encoder acts as a global volume knob and doesn't generate a surface event. The volume is adjusted by the F1 alone.

Every time a surface event occurs the F1 raises an interrupt line. The main processor can read the entire surface status with two 16bit SPI transfers whenever it has time. Each encoder can memorize up to 7 steps. A second SPI interface controls the digital potentiometers. Both SPIs are at 2Mbit/s which is maximum for its internal 8MHz clock. All SPI transfers are handled by the DMA.

One command also allows the F4 just to read the switches status in real time (maybe useful to detect long-presses). I have so far 7 commands from F4 that I handle. Is there anything missing?

The volume scale is logarithmic. The F1 initializes the number of volume steps with a default value. The F4 can also change the number of steps. Each of the 4 audio channels have a maximum volume fixed at 255 at the start. The F4 can also change the top value for each channel at any time.  The global volume acts as a fraction of this top volume value.

I've split the flash memory in half and I'm using the last part to store some non-volatile local variables. So far I only have the current volume position and the volume number of steps.

For now I'm relying on the external caps for the debouncing but what I plan to do is to use all the available 4 timers in a round robin scheme  to start a one-shot count when a switch/encoder is pressed and ignore any following presses until the timers elapse. With 4 timers I can keep track of 4 simultaneously pressed switches/encoders.

Any suggestions are welcomed.

20
preenfm2 and preenfm3 / Re: PCB ready
« on: November 24, 2017, 08:36:12 PM »
I'll send it tomorrow to be manufactured and maybe I'll even get a black Friday deal.

I did get an great deal. 37$ delivered for 10 PCB (green mask only). I could have got a stainless steel stencil for just another 13$. Crazy prices from EasyEDA.

21
preenfm2 and preenfm3 / Re: PreenFM2 SMD version
« on: November 24, 2017, 05:44:27 PM »
one question, when one would want to build this, without smd soldering experience, would you sell preassembled boards with the stm32's on and burned firmware for the stm32f1? or what is the plan?

I might sell 1-3 of the 5 units I'll build presuming everything works fine and I haven't made any mistakes but don't count on me for getting into manufacturing these units.

People are soldering SMD parts all the time, it's not an impossible task. These are actually easy to solder SMD packages.
My only goal is to make this SMD version work and then publish all the files and firmware modifications so anyone can build them (or even start selling pre-soldered kits if they want to) .

22
preenfm2 and preenfm3 / PCB ready
« on: November 23, 2017, 11:44:02 PM »
I've added capacitors to all encoders and switches to eliminate contact debouncing in hardware rather than software. Also one pull-down resistor on pin D2 which is not currently used will be able to distinguish this board from stock (enable port D clock, input with pull-up D2, after 1ms read pin2: 1-stock 0-mine, disable port D clock).

The board is now finished and I've published the Gerbers and all the design files. I'll send it tomorrow to be manufactured and maybe I'll even get a black Friday deal.

I can now turn my attention to firmware until the boards arrive in 3 weeks time.

23
preenfm2 and preenfm3 / Re: PreenFM2 SMD version
« on: November 21, 2017, 01:45:25 AM »
With solution1 mono cable will be possible but we'll need 2 PCM5102 even for 2 mono channels, right ?
So the difference is small, i don't have a strong opinion.

True, but I'm leaning more to second case because then you can stop one PCM5102, save some power and CPU cycles.
The PCM5102 shuts the audio channel down when it detects several consecutive samples of 0 on both channels.
I'll probably split the SoftMute signal to each PCM5102 to have extra control. The XSMT input also monitors the 5V supply
through the R35/R37 divider and shuts the audio down when the 5V supply drops. This will prevent pop noises at power-down or power loss.

I don't know the PCM5102 so i don't know what is best for it.

Sample rates are here :
https://github.com/Ixox/preenfm2/blob/master/src/synth/Common.h#L43
I have a firmware (with o suffix) which overclock the F4 to 192Mhz which allows a higher sample rate.

Thanks for all the clarifications.

The reason I'd rather not send I2S MCK clocks to PCM5102 is to reduce EMI (those clocks are 256*fs so 11MHz traces on the board).
If the PCM5102 doesn't detect a system clock then it switches to its internal PLL which samples the BCK frequency and generates internal clocks for its miniDSP.
It is not clear from the documentation how wide is the capture range of this PLL but it will definitely work for standard sampling frequencies like 32, 44.1, 48KHz etc.

The F4 has its own PLL for the I2S interfaces and those can be configured with very fine grain to almost any sample rate with less than 1% error.

With the PCM5102 we don't need interrupts to send the samples; each time a couple of new samples become available we test the DMA in progress bit and if it's not set we just configure a new DMA transfer over all available samples. Another way of doing this is to get a interrupt at the end of a DMA transfer and set a new one with the available samples.

Is there any reason you've chosen a non standard sampling rate? Instead of 42031.52 (1142 ticks) you could have gone for 44117.65 with 1088 systicks.
In any case 42KHz is just 5% away from 44.1KHz so I expect the internal PCM5102 PLL to lock.

24
preenfm2 and preenfm3 / Re: PreenFM2 SMD version
« on: November 20, 2017, 08:11:05 PM »
I have a few issues to clarify:

- what is the crystal you are using for the F4? I've put a 12MHz one, it needs to be a divisor of 48MHz because of the USB

- right now I've connected Channel1 Left/Right to one stereo jack AF1 and Channel2 Left/Right to AF2
  would it be better to have Channel1 connected to both AF1/AF2 tips and Channel2 connected to both AF1/AF2 rings? This second configuration will allow the use of only one PCM5102 and allow the use on mono cables as before.

- because I'm mixing the 2 lefts and the 2 rights for the headphones amp there is a small (-43dB) signal crosstalk between the before mentioned channels. If one doesn't want this if should replace R30/R38 with 0 ohm resistors and not solder the TDA2822M and its capacitors.

- a very important issue is the output sample frequency. The PCM5102 has its own PLL which locks to the WS signal. If the F4 isn't able to provide a constant stream of data this might be a problem. The F4 can also generate instead the system clock and send it to PCM5102 (just 2 extra pins of F4).

- there is an error between the desired sample rate and what the F4 can provide with the current crystal - for example instead of 44KHz the real audio frequency is 43.4KHz (an error of 1.35%). A 6% error is already a semitone. I haven't studied yet the current firmware - is the software able to compensate for this? what is the sampling rate you are using now?

- 24 and 32 bit samples need to be loaded in the SPI data register twice because that's only 16bit wide in I2S mode so the best way would be to DMA the data from the memory and let the MCU do something else in this time

25
preenfm2 and preenfm3 / Re: PreenFM2 SMD version
« on: November 20, 2017, 07:29:05 PM »
And you will solder all these SMD components by hand ?  :o

Well, yes, about an hour of work per board. The LQFP and TSSOP chips have .5 and .65mm pitches and those are the easiest to solder. The secret is the flux that I'm using which is almost liquid and I'm using lots of it. I usually solder a whole row of pins with one touch of the iron. The most annoying parts are the 0603 because I'll have to pick each with the tweezer, solder one end, then apply flux to all passives, solder the other end and then come back and touch the first end again.

It works but i read from several olde display manual that we should avoid sending 3.3v data to a 5v powered display.
Do you think it would be better to convert the LCD_* lines to 5v (with a 5v inverter or anything else)?

There's no need for level translating the display. The HD44780 equivalent chip is itself powered at a lower voltage and we are not reading from the display so all the F4 connections to the display are outputs. It will only stress the F4 clamp diodes if we would need to interface an output signal which is higher than 3.6V.


26
preenfm2 and preenfm3 / Re: PreenFM2 SMD version
« on: November 20, 2017, 08:41:00 AM »
I've placed all components manually and trial-routed the board with some huge vias. It has routed to 100% in less than a minute. For the final board I need to write all kind of rules, change widths, add planes etc.

If you spot any kind of error in the schematic or in the placement please let me know in the following days.

27
preenfm2 and preenfm3 / Re: PreenFM2 SMD version
« on: November 19, 2017, 07:27:13 PM »
Is there still the JMP3 to flash the STM32F4 through USB ?
Will the STM32F1 flashing require the ST-LINK programmer ?

Would be great to have also a led for the STM32F1, so that we can make it blink a little when the board is switched on to check it's correctly flashed and working.

The jumper is J2 in my design.
Yes, the F4 can be programmed via USB or via SWD and F1 only via SWD.
I'll add a SMD LED to F1.

28
preenfm2 and preenfm3 / Re: PreenFM2 SMD version
« on: November 19, 2017, 10:17:29 AM »
I've made some progress and I have finished the schematic and footprints: https://uglyduck.ath.cx/ep/archive/2017/11/PreenFM2_SMD_Version.html
I will sit on it for a few more days waiting for input and then I'll route it and send it to manufacture.

Is a headphones jack really usefull on the preenfm2 ?
I understand it is for sound modules with sequencer, but i wonder here if it's worth the effort here.
Where the jack will be ?

Must be on the midi out only. If plugged on the midi in, there will be a shared ground with the midi device that sends midi.
Would be great to be mistake proof and having it just on the midi output.

Separate Leds or more leds are not usefull. The current ones are not even visible on all preenfm2 with metal case (the majority).
The 20x4 LCD is big enough to contain all usefull info.

I would prefer P3 than separated encoder switches. There might be a Eurorack version using them in the future (not from me).

Ouch... another firmware to write/maintain/flash... That would make the development and upgrade process much more complicated.

Ground is now on MIDI out only.

The headphones jack is squeezed on the back. For existing cases it's just a 6mm drill. Probably it's not at all useful as you say but the components can be left unsoldered. In the end it's just some board space.

With the separate STM32F1 we can have all of the above. I've started a quick CubeMX project and I will also write the code for it. It shouldn't take me more than an hour in Rowley Crossstudio. The uP is cheaper than the port expanders and is so much more flexible. It can store previous encoder values, it can send direction and several number of steps in one go.  It handles the global volume independently and encoder5 can be reused for data entry. Once I've decided on a data format there won't be any need to touch this firmware. How often do you modify the Encoders.cpp file from the PreenFM2 repository? The main board needs to be programmed with a bootloader first so using the same connector and the same programming tool this STM32F1 is flashed as well.

Now I have about 5 free pins on both STM32F4 and STM32F1 (I know I don't have to use them all) - any other usage?

29
preenfm2 and preenfm3 / Re: PreenFM2 SMD version
« on: November 18, 2017, 01:49:30 AM »
i think if you go down the route of the 42010 to control volume you might as well integrate that into the firmware as well, so that one can store the volume of patches. that way you would not need an extra encoder but control the volume via menus

You can have both. The encoder changes the volume globally  and the software per channel / instrument. The MCP42010 can jump instantly to any set value. These will have to be bit-banged though because all the SPI/I2S interfaces are used.
I have started changing the schematic for 4 audio channels and I've ordered some more components. I will probably also put a TDA2822M as a headphones stereo amplifier. This is linear rather than class D because I don't want the extra switching noise and 500mW per channel is plenty for headphones.

I've changed all MIDI headers to 3 pins. The new encoder has a separate push switch connected. I will probably have to chose between separating the switches of all the other encoders and the P3 analog input header because I've started to run low on pins. Which one is better? Also is it worth having 4 separate LEDs  or more LEDs? If so maybe it's worth dropping a second MCP23S17 to handle the extra switches and LED outputs.

An even better option would be to replace the port expanders with a STM32F103 (only $1.20) running at 8MHz (internal RC clock) which can handle all the encoders, switches and LEDs independently and free a lot of extra pins in the STM32F4 and it can also keep track of the encoder values.

30
preenfm2 and preenfm3 / Re: PreenFM2 SMD version
« on: November 17, 2017, 08:26:33 AM »
a stereo out jack and a dedicated headphone out would sure be great. other than that i am pretty happy. i would wish there were 4 outputs instead of only stereo so that you could route each instrument to another channel. but that is not gonna happen without adjusting quite a lot of the firmware and i am also not sure if the stm32 would support another stereo dac for the additional outs.

I kind of have to decide between 4 outputs and headphones amp because the amp will be only stereo. Also if I will add a headphones amp it will be a Class D amplfier like the stereo 3W PAM8403.

If I go for 4 audio outputs then I'll have to replace the dual volume pot with digital control pots (let's say MCP42010) and replace the actual pot with another encoder. This extra encoder can control independently the volume on all the 4 output channels (so volume + pan times 2).

Anyone else thinks that having more audio outputs is a good idea? What other changes would you like to see in PreenFM2?

Pages: 1 [2] 3