c0pperdragon / Amiga-Digital-Video

Add a digital video port to vintage Amiga machines
294 stars 30 forks source link

Reason for R1 #32

Closed hansliss closed 3 years ago

hansliss commented 3 years ago

I've searched the code for references to GPIO pin 18, and as far as I can see it's never set as an input pin. It's used to signal something to the adapter card. So why is R1 there on the Denise adapter? All it does is to pull this output pin to ground, right?

I have by mistake used a far too small resistor, so I'm wondering if I can simply remove it.

IanSB commented 3 years ago

No, you can't remove the R1 resistor on GPIO18 because it is used to detect the Amiga board (Simple mode). If it is missing the software assumes it is running on the CPLD board instead. The relevant code is in init_hardware() which sets GPIO18 (VERSION_PIN) to an input and reads back the level. If the resistor is fitted it reads back as low, if not it reads back as high due to a weak internal pullup on the Pi. It is then set as an output to control the CPLD board.

hansliss commented 3 years ago

No, you can't remove the R1 resistor on GPIO18 because it is used to detect the Amiga board (Simple mode). If it is missing the software assumes it is running on the CPLD board instead. The relevant code is in init_hardware() which sets GPIO18 (VERSION_PIN) to an input and reads back the level. If the resistor is fitted it reads back as low, if not it reads back as high due to a weak internal pullup on the Pi. It is then set as an output to control the CPLD board.

Ah, ok. Thanks for the info! It turns out I didn't use the wrong resistor after all, anyway.