MPC5645S 32bit write to Parallel GPIO. Bits 30 & 31 not going High. STRANGE.

cancel
Showing results for 
Search instead for 
Did you mean: 

MPC5645S 32bit write to Parallel GPIO. Bits 30 & 31 not going High. STRANGE.

Jump to solution
87 Views
peteradamcik
Contributor III

Hi guys, I've setup 16 LEDS on PORTC and PORTD and have joined them both to form a full 32bit PORT. Both ports are full 16bits each.

When I turn each bit ON using GPIO PAD DATA OUTPUT REGISTER for PORTs C & D, all LEDS 0 to 31 turn ON or turn off individually.

When I write a full 32bit word to PORTC the last 2 bits (bits 30 and 31) will not turn ON but setting them individually bits 30 and 31 work fine. I find that to be pretty STRANGE. LOL. 

Here's my code, can anyone see a problem with this?

.equ base, 0xC3F90000

.equ portcd, base+0x0C04 // PORT C &D Parallel register

// I HAVE ALREADY SET ALL BITS in PORT C & D to OUTPUT.

lis r29,portcd@h // PORTC & D Parallel output address register

ori r29,r29,portcd@l

lis r28,0xFFFFFFFF@h // r28 = 32bit number.

ori r28,r28,0xFFFFFFFF@l

stw r28,0(r29) // This should turn ALL bits on PORT C & D on but Bits 30 and 31 not turning on.

Can't use PORT C & D to create a 32 bit bus if bits 30 and 31 won't turn on.

Any help here would be very much appreciated.

Thanks guys and hope to hear from you soon.

Pete

0 Kudos
1 Solution
78 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, according description it is all shifted two bits left. PCR number always fits to PDO number.

PPDO[x][y] = PDO[(x*32)+y]

PCR30-45:
x*32+y=30 => PPDO[0][30]
x*32+y=45 => PPDO[1][13]

PCR46-61:
x*32+y=46 => PPDO[1][14]
x*32+y=61 => PPDO[1][29]

davidtosenovjan_0-1632309732375.png

 

View solution in original post

0 Kudos
2 Replies
79 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, according description it is all shifted two bits left. PCR number always fits to PDO number.

PPDO[x][y] = PDO[(x*32)+y]

PCR30-45:
x*32+y=30 => PPDO[0][30]
x*32+y=45 => PPDO[1][13]

PCR46-61:
x*32+y=46 => PPDO[1][14]
x*32+y=61 => PPDO[1][29]

davidtosenovjan_0-1632309732375.png

 

View solution in original post

0 Kudos
67 Views
peteradamcik
Contributor III

Hi David, thank you for the info. 

Ahhhh, so I write directly to the PCR registers and not the Parallel registers. 

Why have the parallel registers if they don't match up to 16bits. 

Ok, I'll give that a go.

Thanks David for your support, very much appreciated.

Have a great day

Peter

 

0 Kudos