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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/21/06 09:02
Read: times


 
#128341 - Minor Problem in Suggestion
Responding to: ???'s previous message
Hi Russell,

Many thanks for taking the time to give me a lending hand. I've tried the below, but have 2 problems.

1. When #3 is assigned to pulse_count, the PCA does not stop after 3 pulses. It produces pulses endless.
2. Tried 4 Frequencies ( 1 ~ 4 Khz ), but the frequencies are not correct.


Any suggestions ?

The Code :

.aseg __code, code

.ORG 0000H
LJMP MAIN

.ORG 0033H
LJMP PCA_INTERRUPT

MAIN:

MOV P0,#0FFH
MOV P2,#0H
MOV P1,#0H
MOV RELOAD_INDEX,#1
ACALL PCA_INIT
SJMP $

PCA_INIT:
MOV CMOD,#02H
MOV CH,#00
MOV CL,#00
MOV CCAPM0,#04DH
MOV CCAP0L,#.LOW(1000)
MOV CCAP0H,#.HIGH(1000)
CLR P1.3
SETB EC
SETB EA
SETB CR
RET

PCA_INTERRUPT:
CLR CCF0
PUSH ACC
PUSH PSW
PUSH DPH
PUSH DPL
PUSH B
MOV A,RELOAD_INDEX
CLR C
RL A
mov dptr,#reload_table
movc a,@a+dptr
mov b,a
mov a,reload_index
clr c
rl a
inc a
movc a,@a+dptr
xch a,b
add a,CCAP0L
mov CCAP0L,a
mov a,b
addc a,CCAP0H
mov CCAP0H,a
djnz pulse_count,isr_1

mov pulse_count,#3
inc reload_index

isr_1: ;berenkat!
POP B
POP DPL
POP DPH
POP PSW
POP ACC
RETI


RELOAD_TABLE:
.DCI 3125,1563,1042,781 ;1 ~ 4 kHZ

.aseg __data,data

.org 20H

Pulse_Count .DSB
Reload_Index .DSB


List of 41 messages in thread
TopicAuthorDate
PCA Problems            01/01/70 00:00      
   Problem or deisgn feature?            01/01/70 00:00      
      PCA upsetting Servo Ramp-up            01/01/70 00:00      
         How are you doing this?            01/01/70 00:00      
            more questions            01/01/70 00:00      
            How to connect Cool Edit            01/01/70 00:00      
               does not work            01/01/70 00:00      
                  Pulses generated ok            01/01/70 00:00      
            My Code            01/01/70 00:00      
               ther is your problem            01/01/70 00:00      
               Why are you...            01/01/70 00:00      
                  Assistance Please Russell            01/01/70 00:00      
               A suggestion            01/01/70 00:00      
   Minor Problem in Suggestion            01/01/70 00:00      
      I might have a guess            01/01/70 00:00      
      More comments            01/01/70 00:00      
         Thanks Eric n Russell            01/01/70 00:00      
            A two way street            01/01/70 00:00      
            Lost communication?            01/01/70 00:00      
            not a question of intelligence            01/01/70 00:00      
   This Code Works !            01/01/70 00:00      
      Much better with the comments!            01/01/70 00:00      
      explain a bit here            01/01/70 00:00      
      Moving in the positive            01/01/70 00:00      
         Russell you comment plz !            01/01/70 00:00      
            My comments            01/01/70 00:00      
               Guess you must be right !            01/01/70 00:00      
                  does not work !            01/01/70 00:00      
                     Make it work - thats your job!            01/01/70 00:00      
      Why disable interrupts            01/01/70 00:00      
         I thought the same about the interrupts            01/01/70 00:00      
      Cool Edit            01/01/70 00:00      
         re: Cool Edit            01/01/70 00:00      
            if not square waves - what did you get?            01/01/70 00:00      
               Cool Edit vs Digital Scope            01/01/70 00:00      
                  Cool edit            01/01/70 00:00      
                     Thank You !            01/01/70 00:00      
                     sample rates!!!            01/01/70 00:00      
   Will provide feedback            01/01/70 00:00      
   please help me about visisp52            01/01/70 00:00      
      discussed ad nauseam            01/01/70 00:00      

Back to Subject List