DSO Shell , weird pin usage & rotary encoder

Buttons


The DSO Shell has a ILI9341/ST7789 LCD screen driver connected in parallel, which makes it very fast to refresh the screen.

The 8 Bits LCD data bus is using PB0..PB7.

BUT, the PB0..PB7 are also used to control the buttons & rotary encoder, as inputs this time.

The mapping is as follows :

PB0/1 => rotary encoder left/right
PB3  => rotary encoder button
PB4 => Voltage button
PB5=> Time
PB6=> Trigger
PB7=> Ok

It means PBx are constantly switching between input and output modes and that you cant do both at the same time.
It also means you cannot have hardware debouncing on the button as it would soften also the LCD signals.

That's weird, there are plenty of available pins. Some of them  ( PB13, 14, 15) are even routed to the "Spare IO header"

The problem is that each time you do a LCD access, the code blocks PBx interrupts & re-enables them afterward
It means that during long drawing, you'll lose some interrupts and thus drop some turns on the rotary encoder.

That explains why the rotary encoder is so unreliable on the DSO shell.
Might be worth rewiring it to a couple of  unused PA pins......

Test Signal


The test signal generator is mapped to the PA7 pin, used as Timer3, channel 2 timer function.
That means we can output any frequency we want and not only 1khz.

It has another pin PB12 forming a voltage divider:

PA7  --- r16 --- Output
               |
 PB12--  r31

So when PB12 is floating, output is directly PA7 i.e. 3.3v pp
When PB12 is a pulldown, and output is ~ 0.1v pp

The resistor value is 470 ohm on the schematic, but only 22 ohm on my actual board.


Comments

Popular posts from this blog

Component tester with STM32 : Part 1 ADC, Resistor

Fixing the INA3221

INA3221, weird wiring