| ??? 02/11/03 16:14 Read: times |
#38779 - to measure the pulse width |
the 8051 microcontroller is controlled by an oscillator running at 12 MHz. An
unknown pulse train whose pulse width is to be measured is connected to the INT0 pin. How to Write the corresponding 8051 assembly language subroutine to measure the pulse width and store the result of the registers TL0 and TH0 of the timer 0 (which in turn corresponding to the pulse width of the unknown signal) into memory address 30H and 31H respectively. I know how to write assembly but I don't know what can I do first. For example, do I need to set an unknown number let say X to be the input pulse width and then times 12M (but can I MUL 12M? I think I can't) and then DIV in half and after that change BCD to hex and to find the high byte and low byte? Or maybe my way is wrong? Well... I know how to store them into 30h and 31h. And I will use timer0 and mode 1 with respect to INT0 so that when the unknown signal is high, the timer is allowed to count. Can someone give me some ways but not assembly language code for how I can measure the pulse width? I want to write assembly language by myself. Please help! |
| Topic | Author | Date |
| to measure the pulse width | 01/01/70 00:00 | |
| RE: to measure the pulse width | 01/01/70 00:00 | |
| RE: to measure the pulse width | 01/01/70 00:00 | |
| RE: to measure the pulse width | 01/01/70 00:00 | |
| RE: to measure the pulse width | 01/01/70 00:00 | |
| RE: to measure the pulse width | 01/01/70 00:00 | |
| RE: to measure the pulse width | 01/01/70 00:00 | |
RE: to measure the pulse width | 01/01/70 00:00 | |
| RE: to measure the pulse width | 01/01/70 00:00 | |
| RE: to measure the pulse width | 01/01/70 00:00 |



