Author Topic: PreenFM2 SMD version  (Read 31625 times)

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: PreenFM2 SMD version
« Reply #15 on: November 17, 2017, 09:54:29 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

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2256
    • View Profile
Re: PreenFM2 SMD version
« Reply #16 on: November 17, 2017, 12:04:46 PM »
Anyone else thinks that having more audio outputs is a good idea? What other changes would you like to see in PreenFM2?

More audio outputs is something many people asked.  Two 6.3mm stereo sockets sounds good to me.
If you change the pot to an encoder, would be great to have it clickable.
The preenfm2 has not enough buttons, so having a dedicated STM32 input for each of the 5 encoder clicks woud be usefull.

Also a Ground pins is missing near the Midi output header. Midi output cable are supposed to be shielded. Never had any problem with that but it cannot hurt adding that.

Pins available for a graphical display would be great. Parallel, i2c, spi something else ? I don't know much in graphical display.

I don't know if you modified the Connectors. P3 is important for the vcIn firmware.
The jumper JMP1 is totally useless. Must be connected in all situation.


« Last Edit: November 17, 2017, 12:08:11 PM by Xavier »

solipsvs

  • Team Member
  • ***
  • Posts: 222
    • View Profile
Re: PreenFM2 SMD version
« Reply #17 on: November 17, 2017, 03:49:47 PM »
how about a joystick?   ;)

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: PreenFM2 SMD version
« Reply #18 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.

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2256
    • View Profile
Re: PreenFM2 SMD version
« Reply #19 on: November 18, 2017, 12:13:29 PM »
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.

Better DACs to allow 4 independants output is for me the most interesting part.
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 ?

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.

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).

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.

Ouch... another firmware to write/maintain/flash... That would make the development and upgrade process much more complicated.
I think we should avoid that.
« Last Edit: November 18, 2017, 12:27:43 PM by Xavier »

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: PreenFM2 SMD version
« Reply #20 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?

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2256
    • View Profile
Re: PreenFM2 SMD version
« Reply #21 on: November 19, 2017, 11:47:35 AM »
I don't get exactly how the firmwares flashing will work.

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.

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: PreenFM2 SMD version
« Reply #22 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.

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: PreenFM2 SMD version
« Reply #23 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.

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2256
    • View Profile
Re: PreenFM2 SMD version
« Reply #24 on: November 20, 2017, 09:52:22 AM »

And you will solder all these SMD components by hand ?  :o

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: PreenFM2 SMD version
« Reply #25 on: November 20, 2017, 02:32:15 PM »
If you spot any kind of error in the schematic or in the placement please let me know in the following days.

i could not find a link to a schematic.

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2256
    • View Profile
Re: PreenFM2 SMD version
« Reply #26 on: November 20, 2017, 03:26:35 PM »

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2256
    • View Profile
Re: PreenFM2 SMD version
« Reply #27 on: November 20, 2017, 04:15:54 PM »
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)?

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: PreenFM2 SMD version
« Reply #28 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.


zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: PreenFM2 SMD version
« Reply #29 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