Other Parts Discussed in Thread: HALCOGEN
Hi
Im working with 12 Quadrature encoders and 12 PWMs, using TMS570LS1224PGE
To read the encoders Im using all the available N2HET1pins left, because the PWM pins. The problem is that I had no option but to also use the N2HET2 and the problem is that one of my encoders is ammm sharing channels... and Im also using two ECAP pins...
;---------------------Input Encoder Channel 5: Pin Configuration----------------
Pin_A5 .equ 0 ; Signal A from QEP encoder -> N2HET2[0]
Pin_B5 .equ 22 ; Signal B from QEP encoder -> N2HET1[22]
Here is the part of the code... As you can see, I have channel A on the N2HET2 and channel B on N2HET1... (this code is just to show) and I was wondering how could I use that encoder... I already have the code (almost done) for the other 10 encoders... Im just missing this part but I dont know what to do...
Update:
Here is the code Im using. There are some thing I need to solve before testing it on the application
;---------------------------------Start Channel 5-------------------------------
;---------------------------------Test Case 1-----------------------------------
;----Check: Pin_A5 Fall and Pin_B5 Low or is Pin_A5 Fall and Pin_B5 High----
;-------------------------------------------------------------------------------
AFE5 BR { next = ARE5, cond_addr = AFL5, event = Fall, pin = Pin_A5}
AFL5 BR { next = BAC5, cond_addr = FOR5, event = Low, pin = Pin_B5}
;---------------------------------Test Case 2-----------------------------------
;----Check: Pin_A5 Rise and Pin_B5 Low or is Pin_A5 Rise and Pin_B5 High----
;-------------------------------------------------------------------------------
ARE5 BR { next = BFE5, cond_addr = ARL5, event = rise, pin = Pin_A5}
ARL5 BR { next = BAC5, cond_addr = FOR5, event = high, pin = Pin_B5}
;---------------------------------Test Case 3-----------------------------------
;----Check: Pin_B5 Fall and Pin_A5 Low or is Pin_B5 Fall and Pin_A5 High----
;-------------------------------------------------------------------------------
BFE5 BR { next = BRE5, cond_addr = BFL5, event = Fall, pin = Pin_B5}
BFL5 BR { next = BAC5, cond_addr = FOR5, event = high, pin = Pin_A5}
;---------------------------------Test Case 4-----------------------------------
;----Check: Pin_B5 Rise and Pin_A5 High or is Pin_B5 Rise and Pin_A5 High---
;-------------------------------------------------------------------------------
BRE5 BR { next = AFE4, cond_addr = BRL5, event = rise, pin = Pin_B5}
BRL5 BR { next = BAC5, cond_addr = FOR5, event = low, pin = Pin_A5}
;----------------------------Turn Forward---------------------------------------
FOR5 CNT { next = AFE4, reg = NONE, max = ENCODER_MAX_STEPS_VALUE}
;----------------------------Turn Backward--------------------------------------
BAC5 MOV32 { next = LIM5, remote = FOR5, type = REMTOREG, reg = A}
LIM5 ECMP { next= SSUB5, cond_addr= HIL5, hr_lr=LOW, en_pin_action=off, pin=CC0, reg= A, data=0}
HIL5 ADM32 { next = AFE4, remote = FOR5, type = IM®TOREM, reg = A, data = ENCODER_MAX_STEPS_VALUE}
SSUB5 ADM32 { next = AFE4, remote = FOR5, type = IM®TOREM, reg = A, data = ENCODER_MINUS_ONE_STEP}
;---------------------------------End Channel 5---------------------------------
The board is a custom board.
Thanks a lot!!!