Skip to content

Commit a507719

Browse files
committed
doc: show prototyping setup and explain phoenix-arduino-test.ino
1 parent 010d56c commit a507719

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The Phoenix contains 5 Printed Circuit Boards (PCBs)
3030
4. Wing PCB: Contains 8 buttons and 2 potentiometers to read the throttle and rudder axes. Connects to the Throttle PCB via a 4 wire ribbon cable. Uses a HC165 8-bit parallel load shift register to allow the Micro PCB to read the button states.
3131
![Wing PCB](images/wing_pcb.png)
3232

33-
5. Throttle PCB: Contains 8 buttons. I have not opened this component to map out the traces, but it's extremely likely that it's functionally the same as the Handle PCB with a different layout. This means another HC165 8-bit parallel load shift register.
33+
5. Throttle PCB: Contains 8 buttons. I did not this component to map out the traces, since it's essentially the same as the Handle PCB with a different layout. It includes another HC165 8-bit parallel load shift register. I tested both combinations of SH/!LD and CLK/RD pins in order to label the connections to the Throttle PCB on the Wing PCB.
3434
![Wing and Throttle](images/wing_throttle.png)
3535

3636
## HC165
@@ -39,3 +39,35 @@ Since the Phoenix uses 3 HC165 chips, it will be important to understand how it
3939

4040
Briefly setting the SH/!LD pin LOW will cause the HC165 to load 8 bits in parallel from pins A-H. When SH/!LD is set HIGH, values on A-H is ignored and the value from H is immediately available on Q_H. At this point, each LOW to HIGH transition on CLK/Q_H is seen by the CLK pin and causes the HC165 to make the next data bit available (G,F,...). If the button is not pressed, the signal will remain HIGH. If the button is pressed, the voltage will be forced LOW, which is ok since it won't be interpreted as a clock transition. Here is a sample oscilloscope trace of the CLK/READ wire of the Handle/Slider PCBs while connected to the Micro PCB and powered via the joystick port. In this case the 5th button was pressed, showing substantially longer LOW voltage during that time.
4141
![HC165 Clock/Read Oscilloscope Trace](images/clock_read_oscilloscope.png)
42+
43+
I used a Hantek HT6022BE Oscilloscope with the [OpenHantek Software](https://github.com/OpenHantek/openhantek) in order to collect the above traces. The oscilloscope is available for $65-70 USD and is an excellent troubleshooting tool.
44+
45+
## Prototyping with an Arduino Nano
46+
47+
The Arduino Nano is a small device which should fit inside the Phoenix with plenty of clearance. Despite its small size, it uses an ATmega328P and exposes 8 analog inputs and 12 digital pins. Mine is a clone which enumerates with USB VID:1A86 PID:7523, identifying it as a CH340 uart. This requires a [driver from the manufacturer's website](http://www.wch.cn/download/CH341SER_EXE.html) in order to use the serial monitor in the Arduino IDE.
48+
49+
The image below shows how the nano is wired to work with the [phoenix-arduino-test.ino](examples/phoenix-arduino-test/phoenix-arduino-test.ino) test program.
50+
51+
![Arduino Nano Bread Board Prototype](images/arduino_nano_bread_board.png)
52+
53+
As long as no buttons are pressed, phoenix-arduino-test.ino continuously dumps the state of the potentiometers for each axis:
54+
```
55+
axes: X: adc:548 res:87 out:127 clmp:127
56+
Y: adc:553 res:85 out:127 clmp:127
57+
R: adc:697 res:47 out:63 clmp:63
58+
T: adc:702 res:46 out:63 clmp:63
59+
```
60+
* adc: 0-1023 reading from the Analog to Digital Converter
61+
* res: resistance computed using Ohm's law from the ADC reading and the reference resistance. In the image above, note the reference resistors to the left of the Arduino near the analog input pins.
62+
* out: resistance mapped linearly to a specified output range, currently set to 0-127 for each potentiometer
63+
* clmp: the output value clamped to the output range, to ensure it is within spec
64+
65+
Each time one of the buttons' state changes, the test program dumps the button state. Below is sample output when the trigger and one of the wing buttons are pressed.
66+
```
67+
group 01234567
68+
handle .....0..
69+
wing .......0
70+
thrttl ........
71+
```
72+
73+
## Testing UnoJoy

images/.DS_Store

-8 KB
Binary file not shown.

images/arduino_nano_bread_board.png

2.08 MB
Loading

0 commit comments

Comments
 (0)