Author Topic: Custom RGBS and Audio Switch  (Read 7806 times)

0 Members and 1 Guest are viewing this topic.

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #25 on: July 30, 2021, 10:48:55 am »
I have a headless Raspberry Pi Zero project with an 0.96" OLED display.
I use a knob to select video output format (HDMI, DGI, NTSC, various res).
One line shows the current format, another line shows knob selection.
The pushbutton "takes".
I also have "Shutdown" as a selection.
 

Offline 7th_StarTopic starter

  • Contributor
  • Posts: 24
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #26 on: July 31, 2021, 08:25:23 pm »
Made a git hub for the project to make it easier to share the latest version.

Hardware
https://github.com/7th-Star/Custom_RGBs_and_Audio_Switch/tree/main/Hardware

Software
https://github.com/7th-Star/Custom_RGBs_and_Audio_Switch/tree/main/Software

Changed the shape of the board to fit the chassis. Added some mounting holes. Found the correct power connector. Spaced the solid state relays so they can be folded down. Changed the connector to the front panel.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #27 on: July 31, 2021, 10:58:10 pm »
Normally such a ton of DB connectors would be attached to the back panel with the 4-40 (or 3 mm) male/female standoffs.
Maybe a couple of screws in the corner of the PCB and maybe one near the audio connectors.
Does the height of the audio connectors work with the DB connectors?
Do you have some CNC to cut the back panel?
 
The following users thanked this post: 7th_Star

Offline 7th_StarTopic starter

  • Contributor
  • Posts: 24
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #28 on: July 31, 2021, 11:44:47 pm »
Normally such a ton of DB connectors would be attached to the back panel with the 4-40 (or 3 mm) male/female standoffs.
Maybe a couple of screws in the corner of the PCB and maybe one near the audio connectors.
Does the height of the audio connectors work with the DB connectors?
Do you have some CNC to cut the back panel?

This looks like a good resource for me to figure out how to mount the connectors.
https://itm-components.co.uk/pages/d-subminiature-faq

With the connectors mounted to the panel then there does not need to be as many mounting holes. I will have to mount some though hole things on the back. (power front, panel connector) I will research the audio connector height relative to the db connector issue.

I do have access to CNC mills to cut the panels.
 

Offline 7th_StarTopic starter

  • Contributor
  • Posts: 24
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #29 on: August 01, 2021, 09:26:03 pm »
Made the first cable. It turned out amazing! Spellcaster on the master system to RGBS on a Sony PVM.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #30 on: August 02, 2021, 04:39:58 pm »
I will research the audio connector height relative to the db connector issue.
And while you're at it triple-check the DB9, DB15 & HDB15 to see that they all match.
 

Offline 7th_StarTopic starter

  • Contributor
  • Posts: 24
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #31 on: August 03, 2021, 01:26:39 am »
I will research the audio connector height relative to the db connector issue.
And while you're at it triple-check the DB9, DB15 & HDB15 to see that they all match.

DB connectors are 6.0mm 6.1mm 6.2mm which should be fine. 

For the audio connectors there are two styles.

10mm with plastic base.
https://www.cuidevices.com/product/resource/rcj-05x.pdf

3.8mm
https://www.cuidevices.com/product/resource/rcj-02x.pdf

Is grounding concerns the reason for the different designs. The 10mm base could stick out and the 3.8mm seems long enough the be recessed. The audio grounds are separate on the cables when possible depending on the console if that make any difference. (Xbox has separate grounds for each video, sync and audio. but some only have a single ground for everything.)
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #32 on: August 03, 2021, 12:01:37 pm »
You could use dual right angled sockets and put it on a little riser circuit board.
https://www.digikey.com/en/products/detail/rdi-inc/RH1039M040G-NL/

This is my favorite, dual vertical and enough slack in the pins to get the height right.
Also, this is the only one I've seen with an "island" for the opening.
https://www.elecbee.com/en-3379-rca-connector-solder-dual-port-rca-phono-chassis-mount-socket-audio-video-red-white-female-connector?search=EB-016-0034&description=true
 

Offline 7th_StarTopic starter

  • Contributor
  • Posts: 24
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #33 on: August 07, 2021, 11:50:14 am »
You could use dual right angled sockets and put it on a little riser circuit board.
https://www.digikey.com/en/products/detail/rdi-inc/RH1039M040G-NL/

This is my favorite, dual vertical and enough slack in the pins to get the height right.
Also, this is the only one I've seen with an "island" for the opening.
https://www.elecbee.com/en-3379-rca-connector-solder-dual-port-rca-phono-chassis-mount-socket-audio-video-red-white-female-connector?search=EB-016-0034&description=true

I think will use the 10mm long base connectors and cut a square hole in the plate and let the base stick out.

Changed the control software to use a stripe of symbols for input set (lock), output (a or b), and processor (fx).

https://youtu.be/ltRwe0AtmgU

https://github.com/7th-Star/Custom_RGBs_and_Audio_Switch/tree/main/Software/VideoSwitcher0-876b

I would like to use something like this
Code: [Select]
void fxoutunlockset(){

  if (outputselect == 0 && inputset == 1 && fx == 0) {
     fxsetnum = 1;
}

  if (outputselect == 1 && inputset == 1 && fx == 0) {
     fxsetnum = 3;
}

  if (outputselect == 1 && inputset == 0 && fx == 0) {
     fxsetnum = 4;
}

  if (outputselect == 0 && inputset == 0 && fx == 0) {
     fxsetnum = 2;

}
const char *outfxlockset[] = {"aoutlock_pic","aoutunlock_pic","boutlock_pic","boutunlock_pic"};

void playstation (){

  u8g2.firstPage();
  do {
    u8g2.setFont(u8g2_font_ncenB14_tr);
    u8g2.drawXBMP(0,0, 128,16, playstation_pic);
    u8g2.drawXBMP(0,22, 128,16, aux1_pic);
    u8g2.drawXBMP(0,49, 128,16, outfxlockset[fxsetnum]);
  } while ( u8g2.nextPage() );   

}

But everything I try returns some variation of this error.
"warning: invalid conversion from 'const char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]"
So instead I have to use this ugly bit of code for every input.

Code: [Select]
void playstation (){     

  if (outputselect == 0 && inputset == 1 && fx == 0) {
  u8g2.firstPage();
  do {
    u8g2.setFont(u8g2_font_ncenB14_tr);
    u8g2.drawXBMP(0,0, 128,16, playstation_pic);
    u8g2.drawXBMP(0,22, 128,16, aux1_pic);
    u8g2.drawXBMP(0,49, 128,16, aoutlock_pic);
  } while ( u8g2.nextPage() );
 
}

  if (outputselect == 1 && inputset == 1 && fx == 0) {
  u8g2.firstPage();
  do {
    u8g2.setFont(u8g2_font_ncenB14_tr);
    u8g2.drawXBMP(0,0, 128,16, playstation_pic);
    u8g2.drawXBMP(0,22, 128,16, aux1_pic);
    u8g2.drawXBMP(0,49, 128,16, boutlock_pic);
  } while ( u8g2.nextPage() );
 
}

  if (outputselect == 1 && inputset == 0 && fx == 0) {
  u8g2.firstPage();
  do {
    u8g2.setFont(u8g2_font_ncenB14_tr);
    u8g2.drawXBMP(0,0, 128,16, playstation_pic);
    u8g2.drawXBMP(0,22, 128,16, aux1_pic);
    u8g2.drawXBMP(0,49, 128,16, boutunlock_pic);
  } while ( u8g2.nextPage() );
 
}

  if (outputselect == 0 && inputset == 0 && fx == 0) {
  u8g2.firstPage();
  do {
    u8g2.setFont(u8g2_font_ncenB14_tr);
    u8g2.drawXBMP(0,0, 128,16, playstation_pic);
    u8g2.drawXBMP(0,22, 128,16, aux1_pic);
    u8g2.drawXBMP(0,49, 128,16, aoutunlock_pic);
  } while ( u8g2.nextPage() );
}
 
}


Making process on the board.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #34 on: August 07, 2021, 12:49:53 pm »
I would like to use something like this:
Code: [Select]
const char *outfxlockset[] = {"aoutlock_pic","aoutunlock_pic","boutlock_pic","boutunlock_pic"};
No, use this:
Code: [Select]
const uint8_t *outfxlockset[] = {aoutlock_pic, aoutunlock_pic, boutlock_pic, boutunlock_pic};Or even just:
Code: [Select]
uint8_t *bm;
if (blah-blah-blah) bm=aoutlock_pic;
else if (other-thing) bm=aoutunlock_pic;
Why are you setting font? Are you actually using them?

The point I was making about stripes is that there are 8 independent stripes to a display.
If you want to write a full stripe you don't need to consider at all what the display is showing or use a frame store.
If you use u8g2 and you write u8g2.drawXBMP(0,22, 128,16, aux1_pic) it will have to read 6 bits at the top and 10 bits from the bottom from the frame store.
If you made that my_lib.drawXBMP(0, 16, 128, 48, aux1_pic); then you could write 3 full stripes without any frame store.
Your graphic would be 128 x 48, which would involve the same amount of writing to the OLED anyway.
(Yes, I get that the 6 bits at the top and the 10 bits at the bottom in the first case are blank, but u8g2 doesn't know that.)

All these graphics are being stored in PROGMEM, right?
 
The following users thanked this post: 7th_Star

Offline 7th_StarTopic starter

  • Contributor
  • Posts: 24
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #35 on: August 07, 2021, 03:05:30 pm »
Thanks

Taking out the "" was the key. I tried const uint8_t * before but using "" and that did not work.

The bmp are stored in PROGMEM. These are stored in a separate header file lol. I got tired of scrolling past a huge wall of Hex.

That cleans up the displayinput alot. I now understand what you meant by stripes, it needs no buffer. The page buffer mode uses much smaller amount of memory than the full buffer mode. Enough that I have plenty left.

Now I use 4 bmp as rows that can allow a section to change independent of the rest, like when the monitor out changes or when the processor loop is on/off.

Code: [Select]
void displayinput(){

  fxoutunlockset();
  PORTB = PORTB & B11011111;
  u8g2.firstPage();
  do {
    u8g2.drawXBMP(0,0, 128,16, intputdis[input]);
    u8g2.drawXBMP(0,17, 128,16, intputdis2[input]);
    u8g2.drawXBMP(0,33, 128,16, switchsel[input]);
    u8g2.drawXBMP(0,49, 128,16, outfxlockset[fxsetnum]);
  } while ( u8g2.nextPage() );   
  lastdisplaychange = millis();
  dplayedinput = input;
     
}

https://github.com/7th-Star/Custom_RGBs_and_Audio_Switch/tree/main/Software/VideoSwitcher0-88b
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #36 on: August 07, 2021, 04:12:40 pm »
Don't you mean:
Code: [Select]
    u8g2.drawXBMP(0,0, 128,16, intputdis[input]);
    u8g2.drawXBMP(0,16, 128,16, intputdis2[input]);
    u8g2.drawXBMP(0,32, 128,16, switchsel[input]);
    u8g2.drawXBMP(0,48, 128,16, outfxlockset[fxsetnum]);
 

Offline 7th_StarTopic starter

  • Contributor
  • Posts: 24
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #37 on: August 08, 2021, 01:17:08 pm »
Don't you mean:
Code: [Select]
    u8g2.drawXBMP(0,0, 128,16, intputdis[input]);
    u8g2.drawXBMP(0,16, 128,16, intputdis2[input]);
    u8g2.drawXBMP(0,32, 128,16, switchsel[input]);
    u8g2.drawXBMP(0,48, 128,16, outfxlockset[fxsetnum]);


Actually I meant this. lol  ;).  I was once trying to change parameter on a piece of equipment "p50b.03 to 1" and could not figure out. Turns out you have to start with the 0th digit from the right.

Code: [Select]
    u8g2.drawXBMP(0,0, 128,32, intputdis[input]);
    u8g2.drawXBMP(0,32, 128,16, switchsel[input]);
    u8g2.drawXBMP(0,48, 128,16, outfxlockset[fxsetnum]);

Implemented all of the changes
https://youtu.be/5OEp97mux8Y

https://github.com/7th-Star/Custom_RGBs_and_Audio_Switch/tree/main/Software/VideoSwitcher0-9b
 

Offline 7th_StarTopic starter

  • Contributor
  • Posts: 24
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #38 on: August 14, 2021, 10:07:06 am »
Thinking about the chassis, I realized that taking out the Arduino the update the software would be a hassle. I would to include a way connect the Arduino to a computer while in the chassis. Isolating the USB seems like a good idea. Lots of articles and device use something like a Analog Devices 3160 but that seems like overkill and is expensive $7.92US. I assume for just the data side to communicate with an Arduino there should be a cheaper solution.

https://www.mouser.com/ProductDetail/Analog-Devices/ADUM3160BRWZ-RL?qs=WIvQP4zGaniZo3xx1fxm1A%3D%3D#.YReUqQLw67o.link

Getting close to working on the power and ground on the pcb layout.
 

Offline 7th_StarTopic starter

  • Contributor
  • Posts: 24
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #39 on: August 28, 2021, 08:58:36 pm »
Case came in, It looks great.

https://www.circuitspecialists.com/rackmount-enclosure-37-2u.html

I am unsure if the ADuM3160 is overkill or if needed for the usb isolation. But until another solution is found I am proceeding forward with it.
 

Offline 7th_StarTopic starter

  • Contributor
  • Posts: 24
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #40 on: August 29, 2021, 11:15:39 am »
Which of these BOM styles works better?

Every Ref gets it's own line or every type of component gets a line with a range of Refs?
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Custom RGBS and Audio Switch
« Reply #41 on: August 29, 2021, 11:56:20 am »
In a database world you'd have two tables: ([Project], Ref, PartNum) and (PartNum, Datasheet, [Supplier, Price...])
As a human, I like to see: 2N3904 - Q1, Q4-8, Q27, especially for resistors!
Such a report can be with a bit of effort generated from the two tables above.
Having list-like values in your raw data like "U2, U4, U6" can be difficult to work with.
Having list-like values in a report is only a sleight of hand.
In the best case, both visualizations would be possible to answer questions like "How many 2N3904 do I use?" and "What is Q34?" (if there are hundreds of parts).
This may be complete overkill for you.
« Last Edit: August 29, 2021, 11:25:08 pm by Renate »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf