Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

R1947: 8051 Timer/Counter can't enabled for external clock

2 posters

Go down  Message [Page 1 of 1]

royqh1979



There's a bug in 8051's timer that keep it from working with external clock.

This patch tries to fix it.

BTW: 8051's gate control for timer/counter is not implemented yet.
I add a warning message to inform users about that.

When gate control is on, pin INT0/1 is used to control on/off of the counter together with flag TR0/TR1. So extra object and config props might be needed. I'm not sure if it should be implemented in i51timer, or in the mcutimer?
Attachments
R1947: 8051 Timer/Counter can't enabled for external clock Attachmentclock.zip
patch
You don't have permission to download attachments.
(1 Kb) Downloaded 1 times
R1947: 8051 Timer/Counter can't enabled for external clock Attachment04-external-counter.zip
test circuit
You don't have permission to download attachments.
(28 Kb) Downloaded 1 times

arcachofo

arcachofo

Thanks, patch applied at Rev 1948.

When gate control is on, pin INT0/1 is used to control on/off of the counter together with flag TR0/TR1. So extra object and config props might be needed. I'm not sure if it should be implemented in i51timer, or in the mcutimer?
I think it should be in i51timer by now.
I added the very basics in I51Timer to implement gate control.

royqh1979



arcachofo wrote:Thanks, patch applied at Rev 1948.

When gate control is on, pin INT0/1 is used to control on/off of the counter together with flag TR0/TR1. So extra object and config props might be needed. I'm not sure if it should be implemented in i51timer, or in the mcutimer?
I think it should be in i51timer by now.
I added the very basics in I51Timer to implement gate control.

It seems that I51Timer only need to find and remember it's own gate pin at creation, and there's no need to check the timer number when processing?

arcachofo

arcachofo

It seems that I51Timer only need to find and remember it's own gate pin at creation, and there's no need to check the timer number when processing?
Yes, you are right.
I just added some stuff that could be useful, but I don't know much about the exact way this works.

If you are willing to implement it just change and/or add what you need.
If not let me know and I will read a little bit more about it to implement it.

royqh1979



arcachofo wrote:
It seems that I51Timer only need to find and remember it's own gate pin at creation, and there's no need to check the timer number when processing?
Yes, you are right.
I just added some stuff that could be useful, but I don't know much about the exact way this works.

If you are willing to implement it just change and/or add what you need.
If not let me know and I will read a little bit more about it to implement it.

Ok, I'll make a try.

royqh1979



Patch for 8051 Timer/Counter's gate control.

The following image is extracted from 8051 User Manual.

R1947: 8051 Timer/Counter can't enabled for external clock Snap131
R1947: 8051 Timer/Counter can't enabled for external clock Snap222
Attachments
R1947: 8051 Timer/Counter can't enabled for external clock Attachment8051gate.zip
patch
You don't have permission to download attachments.
(2 Kb) Downloaded 1 times
R1947: 8051 Timer/Counter can't enabled for external clock Attachment05-external-counter-gate.zip
test circuit
You don't have permission to download attachments.
(28 Kb) Downloaded 2 times

arcachofo

arcachofo

Great!
Patch applied at Rev 1950.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum