Karthikeyan.K
Newbie level 4
- Joined
- Jan 8, 2015
- Messages
- 7
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 77
Respected all,
Please anybody guide me in this. I am using C8051F120. I have enabled PCA module in High Speed Output mode. In this mode, PCA will toggle the CEXn pins when a match occurred between PCA Counter (PCA0H,PCA0L pair) and the PCA Compare Register (PCA0CPH0,PCA0CPL0 pair). So I have to the count into the PCA Compare register (PCA0CPH0, PCA0CPL0 pair) after which a toggling should happen. And I did it. PCA also working good only. But at some instance I have to manually Toggle that CEXn pins in my code. How can I Manually ON or OFF a CEX0 pin (for example) while it is used by PCA module.
ie: I have to Make that CEX0 Pin ON, and then I have to start the Counter (CR = 1).
But how can I make CEX0 Pin as ON or else OFF on my own when PCA is enabled and it uses that CEX0 Pin? In my case CEX0 Pin is routed to P1_0 Pin. So Can I do it by setting P1 = P1 | 0x01; ?
Also How to check the current status of that CEX0 Pin? By checking like if( P1 & 0x01) ?
When CEX0 Pin is routed to P1_0 Pin, Can We manually toggle or sense that P1_0 Pin?
This what my question. Please anybody guide me in this. Thanks in advance.
Please anybody guide me in this. I am using C8051F120. I have enabled PCA module in High Speed Output mode. In this mode, PCA will toggle the CEXn pins when a match occurred between PCA Counter (PCA0H,PCA0L pair) and the PCA Compare Register (PCA0CPH0,PCA0CPL0 pair). So I have to the count into the PCA Compare register (PCA0CPH0, PCA0CPL0 pair) after which a toggling should happen. And I did it. PCA also working good only. But at some instance I have to manually Toggle that CEXn pins in my code. How can I Manually ON or OFF a CEX0 pin (for example) while it is used by PCA module.
ie: I have to Make that CEX0 Pin ON, and then I have to start the Counter (CR = 1).
But how can I make CEX0 Pin as ON or else OFF on my own when PCA is enabled and it uses that CEX0 Pin? In my case CEX0 Pin is routed to P1_0 Pin. So Can I do it by setting P1 = P1 | 0x01; ?
Also How to check the current status of that CEX0 Pin? By checking like if( P1 & 0x01) ?
When CEX0 Pin is routed to P1_0 Pin, Can We manually toggle or sense that P1_0 Pin?
This what my question. Please anybody guide me in this. Thanks in advance.