Larswad / sd2iec_mega2560

SD2IEC adapted to work with Arduino mega 2560, with some other nice additions.
GNU General Public License v2.0
35 stars 14 forks source link

Cant seem to relocate PB0 and PB1 (20 and 21) #7

Closed xlar54 closed 2 years ago

xlar54 commented 2 years ago

Im wanting to use a RTC module which relies on pin 20 and 21, so Im trying to relocate the CLOCK and SRQ lines. I think this is done in arch-config.h:

// Pins assigned for the IEC lines

define IEC_PIN_ATN PD3

define IEC_PIN_DATA PD2

define IEC_PIN_CLOCK PD1

define IEC_PIN_SRQ PD0

but changing them to anything else doesnt seem to work. I would like to shift all the lines up the header just by two (so PD0 becomes PD2, etc). Doing so, the device is no longer recognized. Any ideas?

xlar54 commented 2 years ago

Nevermind - figured it out. In addition to the pin #s, you also have to change the IEC signals line for the specific port, aka:

/ IEC signals /

define IEC_INPUT PINA

define IEC_DDR DDRA

define IEC_PORT PORTA

// Pins assigned for the IEC lines

define IEC_PIN_ATN PA4 // digital pin 26

define IEC_PIN_DATA PA5 // digital pin 27

define IEC_PIN_CLOCK PA6 // digital pin 28

define IEC_PIN_SRQ PA7 // digital pin 29

For someone's future reference, this page tells what pins are refered to above: https://www.arduino.cc/en/Hacking/PinMapping2560

xlar54 commented 2 years ago

While this allowed the clock to operate, i was unable to read from it (T-RA). It reports DSrtc not found to the uart. Unusual since it works fine with a clock test sketch in this configuration.

xlar54 commented 2 years ago

Disregard. I found another 3231 library and it works now.