How to set B0_MAT state manually?

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

How to set B0_MAT state manually?

582 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jookie on Thu Apr 04 05:58:38 MST 2013
Hello,

I'm trying to handle some bus with LPC1343, see picture:
[IMG]https://dl.dropbox.com/u/50798228/lpc_signals.png[/IMG]

...and it goes like this:
1. I need to put signal A in low level (at time t1)
2. signal B then arrives at time t2 and I need to take signal A back to high level

The signal B lasts only 250 ns, my LPC1343 is running at 72 MHz and I don't want to miss it, so I'm using CT32B0_CAP0 to capture the presence of low level (falling edge) on signal B, this can also change the state of generated signal A on CT32B0_MAT to high level (by setting TMR32B0EMR to 'Set the corresponding External Match bit/output to 1').

The question now is: how to set the CT32B0_MAT signal to low level at time t1 manually?

I could do something like:
1. set match register MR0 to 0
2. set External Match Control EMR0 to clear on match
3. start timer, which would probably trigger the match on 0
4. turn off timer, set march register MR0 to 1 and action to set on match
5. wait for t2

...but this seems to be bit complicated, and I could also miss the event at t2 because of reconfiguration of the registers just to make MAT go low. So, is there any other simpler way how to initialize MAT signal to low when needed?

Miro
0 Kudos
Reply
1 Reply

573 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jookie on Thu Apr 04 06:21:36 MST 2013
OK, I got another option, this time using 2 pins - MAT0 and MAT1 connected together using OR gate. MAT0 would match on 0 and switch to L, MAT1 would match on 1 and switch to H; this would produce logical 0 on starting the counter and when signal B arrives on CAP pin, it would switch to logical 1.

The problem still remains, because I need to set MAT0 to H and MAT1 to L before starting the timer. Or after each arrival of signal B I could swap their actions and match values so they would swap their roles for the next action, but this doesn't solve the state of MAT0 and MAT1 before first timer run. So still need to set at least MAT0 somehow manually for the 1st time.
0 Kudos
Reply