Hello,
I am trying to connect a 1284P to a T6963C display using this library: http://code.google.com/p/arduino-t6963c/; I have made changes to the header files so that all the pins pf PORTA drive the data bus and four pins on PORTC - PC2, PC3, PC4 and PC5 drive the control pins.
Here is the edit:
#if (defined(__AVR_ATmega1280__) || \
defined(__AVR_ATmega1281__) || \
defined(__AVR_ATmega2560__) || \
defined(__AVR_ATmega2561__)) //--- Arduino Mega ---
// data port Arduino Mega
#define GLCD_DATA_PORT PORTL
#define GLCD_DATA_PIN PINL //Arduino Mega Pins 49-42
#define GLCD_DATA_DDR DDRL
// control port Arduino Mega
#define GLCD_CTRL_PORT PORTC
#define GLCD_CTRL_PIN PINC //Arduino Mega Pins 37-34
#define GLCD_CTRL_DDR DDRC
#elif defined(__AVR_ATmega1284P__)
// data port 1284P
#define GLCD_DATA_PORT PORTA
#define GLCD_DATA_PIN PINA //Arduino Pins 2-7
#define GLCD_DATA_DDR DDRA
#define GLCD_DATA_MASK 0xFF
// control port 1284P
#define GLCD_CTRL_PORT PORTC
#define GLCD_CTRL_PIN PINC
#define GLCD_CTRL_DDR DDRC
// control signals 1284P
#define GLCD_WR 2
#define GLCD_RD 3
#define GLCD_CE 4 //Should be able to XNOR this with WR and RD
#define GLCD_CD 5
//#define GLCD_RESET 4 //For some reason my LCD works with this pin resistored to +5
//#define GLCD_FS 5 //Use hardware solution not pin.
#else// data port other Arduino
#define GLCD_DATA_PORT1 PORTD
#define GLCD_DATA_PIN1 PIND //Arduino Pins 2-7
#define GLCD_DATA_DDR1 DDRD
#define GLCD_DATA_SHIFT1 <<2
#define GLCD_DATA_RSHIFT1 >>2
#define GLCD_DATA_MASK1 0xFC
#define GLCD_DATA_PORT2 PORTB
#define GLCD_DATA_PIN2 PINB //Arduino Pins 8,9
#define GLCD_DATA_DDR2 DDRB
#define GLCD_DATA_SHIFT2 >>6
#define GLCD_DATA_RSHIFT2 <<6
#define GLCD_DATA_MASK2 0x03
// control port
#define GLCD_CTRL_PORT PORTC
#define GLCD_CTRL_PIN PINC
#define GLCD_CTRL_DDR DDRC
// control signals
#define GLCD_WR 0
#define GLCD_RD 1
#define GLCD_CE 2 //Should be able to XNOR this with WR and RD
#define GLCD_CD 3
//#define GLCD_RESET 4 //For some reason my LCD works with this pin resistored to +5
//#define GLCD_FS 5 //Use hardware solution not pin.
# endif
What this has done is that PortA.0 goes to DB0, PortA.1 goes to DB1 etc., till PortA.7 to DB7.
In a gross oversight on my part, I designed and fabricated a few PCBs with the inverted connection - i. e., PortA.0 to DB7, PortA.1 to DB6 etc., till PortA.7 to DB0.
Now, to my question: is there a way , for lack of a better word, 'to flip' PortA in code so as to have proper transmission of data?
I am sorry if I have not used the proper terminology.
Thanks,
Madhu.