EPORT GPIO on MCF5282

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EPORT GPIO on MCF5282

2,202 Views
SamNelson
Contributor I
I'm trying to use the EPORT IRQ1 pin as a general purpose input on an MCF5282, but the input is always the same when I read the EPPDR register, regardless of the physical state of my switch.  I found this thread on the forums stating that I/O gets redirected to port NQ on the 5213, but the 5282 user manual doesn't specify an address for port NQ (although it does refer to port NQ several times) and I don't see it in any header files for the 5282. 

I leave the EPORT module in its reset state, which if I understand correctly, should be configured for general purpose input on the pins, which is what I want.

Do I need to use a different register to read an input from the EPORT module?  If so, which register at what address?

Thanks!
Labels (1)
0 Kudos
3 Replies

273 Views
mccPaul
Contributor I
Hi
 
I use the 5282 edge port like this:
 
Code:
// Configure EPORT5 to be a level detecting interrupt pinMCF5282_EPORT_EPPAR = (MCF5282_EPORT_EPPAR & ~MCF5282_EPORT_EPPAR_EPPA5_BOTHEDGE)    | MCF5282_EPORT_EPPAR_EPPA5_LEVEL;MCF5282_EPORT_EPDDR = (MCF5282_EPORT_EPDDR & ~MCF5282_EPORT_EPDDR_EPDD5);

 
Then I set up an interrupt handler for it, but you could just poll it.
 
See Chapter 11 in the 5282 reference manual which explains the meaning of the registers.
 
Paul.
0 Kudos

273 Views
Arev
Contributor III

Hello,

On my MCF523x, EPORT uses 3 Registers:

MCF_EPORT_EPDDR for Configuration, MCF_EPORT_EPDR to Write output & MCF_EPORT_EPPDR to Read the Input State.

I Hope this helps..

Bye

<< Freescale MCF5234/35 with CodeWarrior 6.2 >>

0 Kudos

273 Views
SamNelson
Contributor I
Thanks Arev,

    I thought I might be doing the software right, and you seem to do it the same way (albeit with a different micro), so I'm going to take a closer look at my switch hardware and schematic.

     I was just unsure because of the other thread I found talking about redirected GPIO ports, and when the 5282 user manual mentioned port NQ, but didn't give an address for it, it confused me more.  I guess Freescale just copy-and-pasted the GPIO section of the 5282 user manual (which mentions port NQ) from a similar micro which does have port NQ.
0 Kudos