Jump to content

Make a A10C's CDU Display


flashtom

Recommended Posts

i use a piece of 3.5 TFT (ILI9327) and a UNO R3 to achieve a basic dispaly.

 

But it is still have something need to be optimized.

 

1> data's reflash have some delay;

 

2> special character on display;

 

3> Font's color and backgrond color;

 

IMG_0513.jpg

Link to comment
Share on other sites

That is exactly what I am planning to try, keep us posted!

I've just finished testing CDU keyboard running on TCA8418 and UNO R3.

Up to 80 keys on 3 wires only :)

It is so much fun to build panels with DCS-BIOS :)

Link to comment
Share on other sites

That is exactly what I am planning to try, keep us posted!

I've just finished testing CDU keyboard running on TCA8418 and UNO R3.

Up to 80 keys on 3 wires only :)

It is so much fun to build panels with DCS-BIOS :)

 

Hi,dear

 

how can you support 80 keys by only 3 wires/pins on UNO R3?

 

i considered, 1 key need 2/3 wires/pins.

Link to comment
Share on other sites

I am using keypad scanner chip TCA8418 over I2C bus, with interrupt option - http://www.ti.com/lit/ds/symlink/tca8418.pdf

Very easy to use, only few registers to read/write from.

The only pain is the size of the chip, its QFN24, very tiny, hard to solder without hot air.

Two wires are for I2C communication and one is interrupt.

I hate wires spaghetti ;), I am trying to connect everything using I2C bus.

Link to comment
Share on other sites

Hi,dear

 

how can you support 80 keys by only 3 wires/pins on UNO R3?

 

i considered, 1 key need 2/3 wires/pins.

 

Consider using a shift register. You can daisy chain these to control large amounts of outputs or receive from large amounts of inputs.

 

Much easier using a shield or breakout board, but not as much fun :lol:

 

Smirks

Cheers,

 

Smirkza

Link to comment
Share on other sites

Let's take a look at two different options to add 16 additional inputs. Price estimations are based on a quick eBay search (looking at ordering quantities of 5 to 10 pieces for the ICs and 100 pieces for the resistors):

 

  • 2 8-bit 74HC165 shift registers (about 2x $0.20) plus 16 pull-up resistors (about $0.20):
    total cost about $0.60
  • 16-bit port expander: The MCP23017 (available in I2C and SPI versions) costs about $1.00. Each pin can be configured as an output or input (with optional internal pull-up resistor) just like the GPIO pins on your ATMega.

 

Both ICs are available in DIP packages.

If the time it takes you to solder in 16 pull-up resistors is worth more than $0.40 to you, consider using the port expander instead of shift registers.

 

If you want to go with a keyboard matrix approach but don't want to solder small packages, consider delegating the keypad scanning to a second Arduino Pro Mini board.

 

There are many ways to skin this cat. If you were designing a product for a 500,000 unit production run, you'd simply minimize cost and be done with it.

For a single-unit hobby design, there are many individual considerations that can influence that decision, for example software development time, how easy you can source the parts, what tools and test equipment you have, and assembly time. You may also want to deliberately choose an option you know will take you longer to implement just to learn how it works :)

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 2 weeks later...

If you dont need backlight - i had good result (i think) with my cheap UFC and photo printed letters. Drew a picture with white lettering on gray background and sent to wallgreens 20min photo print. Took 3 attempts to find the exact shade of grey at which the compression artifacts are not noticeable and edges of letters stay sharp. Then cut and stuck them on regular keyboard keycaps.

http://forums.eagle.ru/showpost.php?p=1413505&postcount=12

 

If you do want backlit buttons then the only option as I see it is engrave on transparent and then painted cap

http://forums.eagle.ru/showpost.php?p=2317634&postcount=16

Anton.

 

My pit build thread .

Simple and cheap UFC project

Link to comment
Share on other sites

If you dont need backlight - i had good result (i think) with my cheap UFC and photo printed letters. Drew a picture with white lettering on gray background and sent to wallgreens 20min photo print. Took 3 attempts to find the exact shade of grey at which the compression artifacts are not noticeable and edges of letters stay sharp. Then cut and stuck them on regular keyboard keycaps.

http://forums.eagle.ru/showpost.php?p=1413505&postcount=12

 

If you do want backlit buttons then the only option as I see it is engrave on transparent and then painted cap

http://forums.eagle.ru/showpost.php?p=2317634&postcount=16

 

Hi, Agrasyuk

 

how do u resolve 80+ key as input on arduino ?

 

Waitting for your reply, thanks.

Link to comment
Share on other sites

You have to use a scanning matrix. If you use 8 row input pins and 8 column input pins you can scan 64 inputs. It takes little more planning and more complicated wiring but it's not to bad. A google search in "arduino input matrix" should turn up a few tutorials.

Link to comment
Share on other sites

  • 5 weeks later...
You use Arduino Due or Mega? What display use? Library for display UTFT?

 

Hi Patriot

 

My arduino board is Mega2560, it has 53 digital i/o and 16 analog i/o.

 

It was just fit for CDU's key.

 

And my LCD is not Arduino Library, it's TFT screen package, include : 4 inch LCD + Driver Board.

 

I had attach a picture for this package.

11.png.516f4da293a7655f393e67358a36e12d.png

Link to comment
Share on other sites

  • 1 year later...

I've seen right now (after I wrote my post): This Thread is one year old.... Found it by searching for a related Topic.

Maybe it's helpful if someone find it someday.

 

Hi, Agrasyuk

 

how do u resolve 80+ key as input on arduino ?

 

Waitting for your reply, thanks.

You have to use a scanning matrix.

 

Did you already tryed the keypad library?

I use it with one MEGA for two MFDs and some other Gismos on my Front Shield.

 

Here follows the promised code. It is actually written to drive two MFDs. I show you (Topic is CDU) just a part of the code.

As you'll see, it is based on Ian's example code.

I tryed to comment each significant line, so you'll can adopt it to your special matters.

 

// an attempt to realize ButtonMatrix in DCS-BIOS by Tekkx :)
// this is just an example on how I solved the button-matrix-problem :)
// send proposals, cheers and booohs to tekkx@dresi.de.

#include <Keypad2.h>
#include <DcsBios.h>
#include <Servo.h>

/**** Make your changes after this line ****/ 
const byte ROWS = 8; // quantity of rows (later 8)
const byte COLS = 9; // quantity of columns (later 9)

char OSB[ROWS][COLS] = {  
// Define the Keymap / upper and lower cases MATTER
// D2, D3, D4 , 5,  6,  7,  8,  9, D10
 {'1','2','3','4','5','6','7','8','9'}, // A0
 {'0','q','w','e','r','t','z','u','i'}, // A1
 {'o','p','a','s','d','f','g','h','j'}, // A2
 {'k','l','(','%','#','<','y','x','c'}, // A3
 {'v','b','n','m','Q','W','E','R','T'}, // A4
 {'Z','U','I','O','P','A','S','D','F'}, // A5
 {'G','H','J','K','L','Ö','Ä','>','Y'}, // A6
 {'X','C','V','B','N','M',';',':','+'}  // A7
};
// Connect MFD Rows and Columns to these Arduino pins.
byte rowPins[ROWS] = { A0, A1, A2, A3, A4, A5, A6, A7 };
byte colPins[COLS] = { 2, 3, 4 , 5, 6, 7, 8, 9, 10 }; 

// Create the Keypad, initialize an instance of class NewKeypad
Keypad MFD = Keypad( makeKeymap(OSB), rowPins, colPins, ROWS, COLS );
/* Instantiate a ProtocolParser object to parse the DCS-BIOS export stream */
DcsBios::ProtocolParser parser;

// all other Non-Matrix-Buttons and rotarys follows here
DcsBios::LED lcpAnticollision(0x1144, 0x0080, flashLightPin);
DcsBios::Switch2Pos masterCautionBtn("UFC_MASTER_CAUTION", MCB);
DcsBios::LED masterCaution(0x1012, 0x0800, 24); // just for debugging
// MFD-PWR
DcsBios::Switch3Pos lmfdPwr("LMFD_PWR", 25, 23); // LeftPWR-RotSwitch
DcsBios::Switch3Pos rmfdPwr("RMFD_PWR", 29, 27); // RightPWR-RotSwitch

void setup() {
MFD.addEventListener(keypadEvent); //add an event listener for this leftMFD
Serial.begin(115200); // this value is subject to change???
MFD.setDebounceTime(50); // maybe needless
} // end void setup

/*
Your main loop needs to pass data from the DCS-BIOS export stream to the parser object you instantiated above.
It also needs to call DcsBios::PollingInput::pollInputs() to detect changes in the state of connected controls and
pass them on to DCS. */

void loop() {
char OSB = MFD.getKey(); // weist OSB den Wert der gedrückten Taste zu

while (data > -1) {
     parser.processChar(data);
     data = Serial.read();
   }
 
 // poll inputs
DcsBios::PollingInput::pollInputs();
}

/// ---------------------------	
void keypadEvent(KeypadEvent OSB){	
switch (MFD.getState()) {	// gives PRESSED, HOLD or RELEASED
case PRESSED:	// If someone finds a better solution as switch - case: Let me know, please :)
  switch(OSB) { // following commands are fired unique if PRESSED
    // LMFD
	case 'w': sendDcsBiosMessage("LMFD_01", "1"); break; // L_OSB_1
	case 'q': sendDcsBiosMessage("LMFD_02", "1"); break; // L_OSB_2
	case '0': sendDcsBiosMessage("LMFD_03", "1"); break; // L_OSB_3
	case 'r': sendDcsBiosMessage("LMFD_04", "1"); break; // L_OSB_4
	case 'e': sendDcsBiosMessage("LMFD_05", "1"); break; // L_OSB_5
	
	case '4': sendDcsBiosMessage("LMFD_DSP", "2"); break; // L_DSP_+up
	case '2': sendDcsBiosMessage("LMFD_DSP", "0"); break; // L_DSP_-dn
	
	case '6': sendDcsBiosMessage("LMFD_06", "1"); break; // L_OSB_6
	case '7': sendDcsBiosMessage("LMFD_07", "1"); break; // L_OSB_7
	case '8': sendDcsBiosMessage("LMFD_08", "1"); break; // L_OSB_8
	case '9': sendDcsBiosMessage("LMFD_09", "1"); break; // L_OSB_9
	case '5': sendDcsBiosMessage("LMFD_10", "1"); break; // L_OSB_10
	
	case '3': sendDcsBiosMessage("LMFD_BRT", "2"); break; // L_BRT_+up
	case '1': sendDcsBiosMessage("LMFD_BRT", "0"); break; // L_BRT_-dn
	
	case 'x': sendDcsBiosMessage("LMFD_SYM", "2"); break; // L_SYM_+rt
	case 'y': sendDcsBiosMessage("LMFD_SYM", "0"); break; // L_SYM_-lft
	
	case '<': sendDcsBiosMessage("LMFD_11", "1"); break; // L_OSB_11
	case 'c': sendDcsBiosMessage("LMFD_12", "1"); break; // L_OSB_12
	case '#': sendDcsBiosMessage("LMFD_13", "1"); break; // L_OSB_13
	case '%': sendDcsBiosMessage("LMFD_14", "1"); break; // L_OSB_14
	case '(': sendDcsBiosMessage("LMFD_15", "1"); break; // L_OSB_15
	// PWR_Switch outside the Matrix
	case 'j': sendDcsBiosMessage("LMFD_CON", "0"); break; // L_CON_-dn
	case 'h': sendDcsBiosMessage("LMFD_CON", "2"); break; // L_CON+up
	
	case 'o': sendDcsBiosMessage("LMFD_16", "1"); break; // L_OSB_16
	case 'p': sendDcsBiosMessage("LMFD_17", "1"); break; // L_OSB_17
	case 'a': sendDcsBiosMessage("LMFD_18", "1"); break; // L_OSB_18
	case 's': sendDcsBiosMessage("LMFD_19", "1"); break; // L_OSB_19
	case 'd': sendDcsBiosMessage("LMFD_20", "1"); break; // L_OSB_20

	case 'g': sendDcsBiosMessage("LMFD_ADJ", "0"); break; // L_ADJ_-dn
	case 'f': sendDcsBiosMessage("LMFD_ADJ", "2"); break; // L_ADJ_+up
	// RMFD comes here, is deleted in this example sketch
	/*
	*/		
}}
   switch (MFD.getState()){	// gives PRESSED, HOLD or RELEASED
case RELEASED: // LMFD 
	switch(OSB) { // Released OSBs or Neutral Rockers signal is sent
	case 'w': sendDcsBiosMessage("LMFD_01", "0"); break; // L_OSB_1
	case 'q': sendDcsBiosMessage("LMFD_02", "0"); break; // L_OSB_2
	case '0': sendDcsBiosMessage("LMFD_03", "0"); break; // L_OSB_3
	case 'r': sendDcsBiosMessage("LMFD_04", "0"); break; // L_OSB_4
	case 'e': sendDcsBiosMessage("LMFD_05", "0"); break; // L_OSB_5
	
	case '4': sendDcsBiosMessage("LMFD_DSP", "1"); break; // L_DSP_+up
	case '2': sendDcsBiosMessage("LMFD_DSP", "1"); break; // L_DSP_-dn
	
	case '6': sendDcsBiosMessage("LMFD_06", "0"); break; // L_OSB_6
	case '7': sendDcsBiosMessage("LMFD_07", "0"); break; // L_OSB_7
	case '8': sendDcsBiosMessage("LMFD_08", "0"); break; // L_OSB_8
	case '9': sendDcsBiosMessage("LMFD_09", "0"); break; // L_OSB_9
	case '5': sendDcsBiosMessage("LMFD_10", "0"); break; // L_OSB_10
	
	case '3': sendDcsBiosMessage("LMFD_BRT", "1"); break; // L_BRT_+up
	case '1': sendDcsBiosMessage("LMFD_BRT", "1"); break; // L_BRT_-dn
	
	case 'x': sendDcsBiosMessage("LMFD_SYM", "1"); break; // L_SYM_+rt
	case 'y': sendDcsBiosMessage("LMFD_SYM", "1"); break; // L_SYM_-lft
	
	case '<': sendDcsBiosMessage("LMFD_11", "0"); break; // L_OSB_11
	case 'c': sendDcsBiosMessage("LMFD_12", "0"); break; // L_OSB_12
	case '#': sendDcsBiosMessage("LMFD_13", "0"); break; // L_OSB_13
	case '%': sendDcsBiosMessage("LMFD_14", "0"); break; // L_OSB_14
	case '(': sendDcsBiosMessage("LMFD_15", "0"); break; // L_OSB_15
		// PWR_Switch outside the Matrix
	case 'j': sendDcsBiosMessage("LMFD_CON", "1"); break; // L_CON_-dn
	case 'h': sendDcsBiosMessage("LMFD_CON", "1"); break; // L_CON+up
	
	case 'o': sendDcsBiosMessage("LMFD_16", "0"); break; // L_OSB_16
	case 'p': sendDcsBiosMessage("LMFD_17", "0"); break; // L_OSB_17
	case 'a': sendDcsBiosMessage("LMFD_18", "0"); break; // L_OSB_18
	case 's': sendDcsBiosMessage("LMFD_19", "0"); break; // L_OSB_19
	case 'd': sendDcsBiosMessage("LMFD_20", "0"); break; // L_OSB_20

	case 'g': sendDcsBiosMessage("LMFD_ADJ", "1"); break; // L_ADJ_-dn
	case 'f': sendDcsBiosMessage("LMFD_ADJ", "1"); break; // L_ADJ_+up
	// RMFD released --------------
	// RMFD comes here, is deleted in this example sketch
/* 
*/
	}} 
} ;  // end void
	
/// ----------------------------  

void sendDcsBiosMessage(const char* msg, const char* arg) {
 Serial.write(msg);
 Serial.write(' ');
 Serial.write(arg);
 Serial.write('\n');
} 

void onDcsBiosWrite(unsigned int address, unsigned int value) { 

} // end void onDcsBiosWrite

Do NOT copy and paste it. I have still to work on it due to the amount of buttons and no time for do it right now.

The keymap is defined for TWO MFDs, switch-case-monster is still just for the LFMD.

Maybe I did some coding since last successful test and this semi-finished code won't work.

So don't blame it to me, if it happen ;)

 

But you can copy some hints.

 

Also my SWITCH-CASE-construction is not a very elegant solution. Maybe :)

Strange order of case ' ' -values came caused by listing them clockwise from OSB_1 and the strange wireing of the button matrixes. It's a hard job to wire 25 buttons and a 3-position-knob + backlite-LEDs on a 20-mm-wide (even double sided) PCB-frame even without to try to make a clean matrix.

Designing the keypad matrix of a CDU should be more easy.


Edited by Tekkx
  • Like 2

Manual for my version of RS485-Hardware, contact: tekkx@dresi.de

Please do not PM me with DCS-BIOS-related questions. If the answer might also be useful to someone else, it belongs in a public thread where it can be discovered by everyone using the search function. Thank You.

Link to comment
Share on other sites

Cheers Hans.

Thanks for coming by.

 

Thow this project is paused ATM (bezels and front panel lie arround catching dust) I did some thinking:

To manage this switch-case-monstrousity (I'm not really happy with that) it should be possible to make somewhat like a function (in Turbo-Pascal I'd call it procedure) what catches the output of the

- MFD.getState() and

- switch(OSB) expressions

and spits out what happened.

 

I'm not a real coder (every second command I have to look at the manual or an example - I do the same if I write english texts). So this will take some time. :/


Edited by Tekkx

Manual for my version of RS485-Hardware, contact: tekkx@dresi.de

Please do not PM me with DCS-BIOS-related questions. If the answer might also be useful to someone else, it belongs in a public thread where it can be discovered by everyone using the search function. Thank You.

Link to comment
Share on other sites

  • 1 year later...

Hansolo has achieved many things in his thread he is still very active here.

https://forums.eagle.ru/showpost.php?p=3441642&postcount=212

https://www.shapeways.com/shops/a-10c-warthog-supplies

https://forum.dcs.world/topic/133818-deadmans-cockpit-base-plans/#comment-133824

CNCs and Laser engravers are great but they can't do squat with out a precise set of plans.

Link to comment
Share on other sites

Hi Hans.

Are you still on this site, just wanted to know if you managed to build a CDU and UFC.

Kind regards.

Terry

 

Yes sir very much alive and kicking. And yes got the CDU (not exactly the A-10 one though) up and running; https://forums.eagle.ru/showpost.php?p=3236594&postcount=159

 

Cheers

Hans

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...