Author Topic: PreenFM2 SMD version  (Read 1515 times)

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: PreenFM2 SMD version
« Reply #45 on: January 16, 2018, 08:31:59 AM »
I haven't done any more testing but I've taken some pictures of the soldered boards. A few things I've noticed: the buttons caps that I have are way too low (they dont reach the screen base). Only one DIN connector fits comfortably at the back; a second will have to have its pins trimmed to fit in the back. but I have 2 more so I think I'll put all the DIN5 connectors on the sides.
The boards are still covered in flux; I haven't cleaned them yet.

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: PreenFM2 SMD version
« Reply #46 on: January 19, 2018, 07:56:38 AM »
After another 10 hours of coding I want to report some good progress:

I've got the inter processor communication working. This was tricky because the F4 is the SPI master and the F1 raises an interrupt wire when any of the switches or encoders change state. For the F4 this transfer is transparent, everything is done by the DMA at both ends and after the 32bit transfer it can process the new input whenever it likes. There are also some commands which change parameters like the max volume and interrogation commands like the firmware version. So the F1 must start a DMA receive but if a key/encoder is pressed it must abort the current DMA (because the first word is already loaded in the SPI register) and start a new one with the new info. This allows the information exchange in just one 32bit transfer.

My encoders can send +/- 7 steps but regardless of how fast I turn them the max was +/- 2 steps. Also the detection algorithm for the encoders should be improved (now I'm basing this on just one sample) because I get the occasional step in the opposite direction.

Also my note generation works. I get sine waves on all outputs but I have a horrible super-imposed noise in my headphone amplifier. I have to admit that I haven't put a scope yet on my boards and my only detection method was a pair of headphones. I can also hear the microcontroller running in my headphones so this is bad. I hope that the only culprit is the headphones amp which was a bit of an afterthought. This is powered by the general 5V line and connected to the digital ground (instead of the analog ground as the rest of the audio path) while it has a 39db gain! I might have to scrap this and use only the jack outputs.

The wave generation is using 48KHz sample rate on all 4 channels and all transfers are DMA. I get a half way transfer interrupt and I'm filling the other half of the buffer based on a precomputed sine wave table and the desired frequency.

What's not working is the digital volume (haven't investigated why), haven't checked the purity of the sine waves with a scope and I get a very rare hangup of the surface processor so there's still a bug in there. Another bug is also lurking in my F4 code which manifest itself only when I'm compiling as a release, the debug version works fine. So programming still required.

All in all I'm very pleased so far because all the audio chains are working at least up the output of the DACs and the processor spends most of the time sleeping in the main loop.

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: PreenFM2 SMD version
« Reply #47 on: January 19, 2018, 06:46:38 PM »
I can confirm that there is no noise at all on the jack outputs; I'll make some scope captures during the weekend.

The headphones amplifier needs a redesign. The idea of mixing 2 channels and then amplifying it almost 100 times with no proper dedicated supply is bad. Probably the best way is to choose only 2 channels instead of 4 and reduce the voltage gain considerably. Other option is to use a cheap LM324 to mix them and then use another phones amplifier IC and use a dedicated power rail for it.

For the current boards the headphones schematic is compromised and I'll have to desolder that part of the circuit.

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: PreenFM2 SMD version
« Reply #48 on: January 20, 2018, 05:18:53 AM »
More problems fixed:

I've solved the digital volume and now it works beautifully with a logarithmic scale. I was sending the potentiometer bytes in the wrong order.

One of the audio channels was bearly audible. I've traced that to 2 mislabeled references of 2 caps. I've switched those and everything is fine.

I'm thinking of redesigning the headphones amplifier for a further revision. Separate 78L05 supply, MC33204 OpAmps (couldn't use LM324 because it's not rait-to rail) for mixing the 4 channels and provide proper separation and LM4880 as 200mW/channel amplifier. I've already done the simulation.

I haven't tested MIDI yet but I don't expect any surprises there.

I'm still struggling with the encoders. I can't get rid of that extra step in the wrong direction when they are turned fast. If I mask the inputs longer than 15ms then I'm missing steps, shorter and I have the jump backwards. The question is do I have some particularly noisy encoders or are my algorithms bad? Right now I'm triggering on the falling edge of one input, masking further interrupts with times and I'm examining the state of the second input for the last 15ms. How is your experience with the encoders on the current design? The switches on the other hand are perfectly debounced.

alien_brain

  • Team Member
  • **
  • Posts: 91
    • View Profile
Re: PreenFM2 SMD version
« Reply #49 on: January 20, 2018, 07:27:08 PM »
all pretty exciting!  hey do you think you could find out why the white oleds are not shining as bright when swapped in and do the necessary changes?  im very excited to use one of these when you have them ready.

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: PreenFM2 SMD version
« Reply #50 on: January 21, 2018, 09:39:01 AM »
hey do you think you could find out why the white oleds are not shining as bright when swapped in and do the necessary changes?

OLEDs are a vanity thing, I'm just interested in functionality. Yellow ones are always much brighter than the white ones - it's a construction feature. All the ones I'm building use plain green-yellowinsh LED backlight. The difference is the price 5$ compared to 35$. The screen can be swapped with ease anyways.

alien_brain

  • Team Member
  • **
  • Posts: 91
    • View Profile
Re: PreenFM2 SMD version
« Reply #51 on: January 21, 2018, 02:11:46 PM »
golly thanks for that i guess.  btw white oleds are just as bright.  im not a technical guy but my tech has white oleds in his yamaha fm synths like tx802 and tx81z that are just as bright as any other color i have seen anywhere.  so...  nows your chance to be vain i guess.  whats wrong with white oleds?  it would certainly make a statement.  what a pity that you dont care.  oh well,  i guess the only thing your design has that i want is 4 outputs.  but even then im not sure that means very much unless you cant afford a second synth...

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 1281
    • View Profile
Re: PreenFM2 SMD version
« Reply #52 on: January 21, 2018, 02:25:26 PM »

Impressive soldering skills !!!  :o
Nice pictures....

matrix12x

  • Team Member
  • **
  • Posts: 61
    • View Profile
Re: PreenFM2 SMD version
« Reply #53 on: January 22, 2018, 01:18:47 AM »
I'm really excited by the progress.

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: PreenFM2 SMD version
« Reply #54 on: January 26, 2018, 01:57:48 AM »
I have updated my project's page with real oscilloscope captures from the DAC and the line output if anyone is interested.

I've also redesigned the headphones amplifier for an eventual future version.

The PCM5102 performs very well and with its dynamic range of 112dB it has effectively 19 bits of precision (so I'm sending 24bits in 32bit frames per channel). If we compare this with the MCP4922 we can already see a big improvement. The 12 bits of the MCP4922 have a typical cumulative nonlinear error of +/-2LSb but this can go up to +/-12LSb. Then there is an abrupt nonlinearity when the 2 DACs are connected together; even with the  1% tolerance for the 1.8K resistor, 1% is equivalent with another resistor of 180K injecting current into the node, and that's almost as the entire contribution of the second DAC via the 155K resistor.