Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/16/03 18:21
Read: times


 
#39164 - 10Khz square using 16 Bit Timer Mode
Hello all,
Few questions which iam unable to understand:-

1) if i want to write a program to that creates a square wave on P1.5 with a frequency of 10 Khz using timer 0 i will do the following:
i) 10Khz = 10000 Hz. = 0.0001 Seconds = 100 micro-seconds., let divide it by 2 = 50 micro-seconds.
ii) Using 16 bit timer mode = 65536-50 = 65486 micro-seconds.
ORG 00H
MOV TH0,#__A_ ( ?x256= A)
MOV TL0,#__B___ ( A+1= B)
MOV TMOD,#01
SETB TR0
LOOP: JNB TF0,LOOP
CPL P1.5
CLR TF0
MOV TH0,#__A_ ( ?x256= A)
MOV TL0,#__B___ ( A+1= B)
MOV TMOD,#01
SETB TR0
JMP LOOP

Now in above program how to calculate the values of A and B , or is there any easier way?

Next do i have to set the timer commands again to make the 100 micro-second delay or any other commands which can save these lines other than auto-reload timer mode?

How to write the above program in split timer mode like i don't need the codes i need the calculation work which programmers do before writing the actual codes?

List of 13 messages in thread
TopicAuthorDate
10Khz square using 16 Bit Timer Mode            01/01/70 00:00      
   RE: 10Khz square using 16 Bit Timer Mode            01/01/70 00:00      
      RE: 10Khz square using 16 Bit Timer Mode            01/01/70 00:00      
         How to Check the assembler for DPH?            01/01/70 00:00      
      This is the Best Forum            01/01/70 00:00      
   Problem with x51 assembler using DPH            01/01/70 00:00      
      RE: Problem with x51 assembler using DPH            01/01/70 00:00      
         RE: Problem with X51 assembler using DPH            01/01/70 00:00      
            RE: Problem with X51 assembler using DPH            01/01/70 00:00      
      RE: Problem with x51 assembler using DPH            01/01/70 00:00      
         RE: Problem with x51 assembler using DPH            01/01/70 00:00      
            RE: Problem with x51 assembler using DPH            01/01/70 00:00      
   RE: 10Khz square using 16 Bit Timer Mode            01/01/70 00:00      

Back to Subject List