Due port/pin : PC23 PC24 PB27 PC26 PD7 PC29 PC21 PC22 -> did not worked for me. After referring the pin-out, I corrected the code to refer
Due port/pin : PC23 PC24 PC25 PC26 PC28 PB25 PC21 PC22
After making corresponding changes, it worked!!!
The revised code is
#define write8inline(d) { \
PIO_Set(PIOC, (((d) & 0x01)<<(22-0)) | (((d) & 0x02)<<(21-1)) | (((d) & 0x08)<<(28-3)) | (((d) & 0x10)<<(26-4)) | (((d) & 0x20)<<(25-5)) | (((d) & 0x40)<<(24-6)) | (((d) & 0x80)<<(23-7)) );
PIO_Clear(PIOC, (((~d) & 0x01)<<(22-0)) | (((~d) & 0x02)<<(21-1)) | (((~d) & 0x08)<<(28-3)) | (((~d) & 0x10)<<(26-4)) | (((~d) & 0x20)<<(25-5)) | (((~d) & 0x40)<<(24-6)) | (((~d) & 0x80)<<(23-7)) );
PIO_Set(PIOB, (((d) & 0x04)<<(25-2)));
PIO_Clear(PIOB, (((~d) & 0x04)<<(25-2)));
WR_STROBE; }
#define read8inline(result) { \
RD_ACTIVE;
delayMicroseconds(1);
result = (((PIOC->PIO_PDSR & (1<<23)) >> (23-7)) | ((PIOC->PIO_PDSR & (1<<24)) >> (24-6)) |
((PIOC->PIO_PDSR & (1<<25)) >> (25-5)) | ((PIOC->PIO_PDSR & (1<<26)) >> (26-4)) |
((PIOC->PIO_PDSR & (1<<28)) >> (28-3)) | ((PIOB->PIO_PDSR & (1<<25)) >> (25-2)) |
((PIOC->PIO_PDSR & (1<<21)) >> (21-1)) | ((PIOC->PIO_PDSR & (1<<22)) >> (22-0)));
RD_IDLE;}
#define setWriteDirInline() { \
PIOC->PIO_MDDR |= 0x17E00000; /PIOC->PIO_SODR = 0x17E00000;/ PIOC->PIO_OER |= 0x17E00000; PIOC->PIO_PER |= 0x17E00000;
PIOB->PIO_MDDR |= 0x02000000; /PIOB->PIO_SODR = 0x02000000;/ PIOB->PIO_OER |= 0x02000000; PIOB->PIO_PER |= 0x02000000; }
#define setReadDirInline() { \
pmc_enable_periph_clk( ID_PIOC ) ; pmc_enable_periph_clk( ID_PIOB ) ; pmc_enable_periph_clk( ID_PIOA ) ;
PIOC->PIO_PUDR |= 0x17E00000; PIOC->PIO_IFDR |= 0x17E00000; PIOC->PIO_ODR |= 0x17E00000; PIOC->PIO_PER |= 0x17E00000;
PIOB->PIO_PUDR |= 0x02000000; PIOB->PIO_IFDR |= 0x02000000; PIOB->PIO_ODR |= 0x02000000; PIOB->PIO_PER |= 0x02000000;
PIOA->PIO_PUDR |= 0x20000000; PIOA->PIO_IFDR |= 0x20000000; PIOA->PIO_ODR |= 0x20000000; PIOA->PIO_PER |= 0x20000000; } //C26 and A29 are shorted