b3603 icon indicating copy to clipboard operation
b3603 copied to clipboard

Use the buttons

Open baruch opened this issue 10 years ago • 4 comments

Find how to make use of the buttons and integrate them into a UI that doesn't necessarily depend on the serial port.

baruch avatar Feb 24 '15 20:02 baruch

Please take a look at screenshots from oscilloscope of pressing those two strange connected buttons (OK and UP).

UsrnameTaken avatar Sep 03 '17 18:09 UsrnameTaken

Hi Baruch and others

I like to share the way the buttons work, remained a secret for 2 years now.

Howto: Default ports pd1 and pc7 are set as input and can read (primary) buttons set and down directly and are pushed when eq zero)

If no primary key is pressed, seconday keys can be scanned (up and ok buttons).

Scan button 4 (ok): Pd1 output value set to zero Pd1 define as output (set direction) Read pc7, key pressed when zero Return pd1 to input in pull-up mode

Scan button 3 (up) Then the other way around Pc7 output value to zero. Pc7 define as output Read pd1, key pressed when zero Return pc7 to input with pull-up.

I had worries on triggering the SWIM logic on pd1, but until now i did not show any reactions. You may disable it by setting in the cdg_GCR bit0 to 1

When scanning secondary keys the first line returned to pull-up needs quite some recovery time. About 10 NOP’s makes it ready for next button scan.

Wrote some test code and was able to read set,down,up and ok key reliable.

Currently called from main event loop as demo, maybe better call it from a timer with handler.

While make the implementation i had to remove random serial stuff else it didn’t flash as firmware was too big.

I can provide working demo code and scope images of key presses. Those already provided

Regards, Arjan

iafilius avatar Nov 27 '17 19:11 iafilius

@iafilius thanks!

I haven't worked on the b3603 for a while, I'll try to see if I can integrate it into the firmware. It was a pain to use the device without the buttons.

As for the firmware size, there is another fork of this project that worked on reducing the size, I'll probably try to integrate that as well to reduce the size.

baruch avatar Nov 28 '17 06:11 baruch

Hi, uploaded the tested code , easy to integrate in main event loop (or called from timer) uploaded the key scope pictures as well. buttons.c.txt buttons.h.txt ds1z_quickprint47 ds1z_quickprint48 ds1z_quickprint49 ds1z_quickprint50 ds1z_quickprint52

iafilius avatar Nov 28 '17 17:11 iafilius