This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

N2HET1 and N2HET2

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&REGTOREM, reg = A, data = ENCODER_MAX_STEPS_VALUE}

SSUB5 ADM32 { next = AFE4, remote = FOR5, type = IM&REGTOREM, reg = A, data = ENCODER_MINUS_ONE_STEP}

;---------------------------------End Channel 5---------------------------------

The board is a custom board. 

Thanks a lot!!!

  • Hi Miguel,

    I don't really understand the question and/or problem. 

    Are you saying that you are trying to split the quadrature inputs A,B from one encoder, across 2 N2HET?   I don't think that this is a good idea - very difficult. I won't say impossible but while doable it would have some speed limitation. 

    Or, are you just trying to put one or more complete encoder functions in each N2HET? 

    If the latter then what is the issue you are having?

  • Are you saying that you are trying to split the quadrature inputs A,B from one encoder, across 2 N2HET?   I don't think that this is a good idea - very difficult. I won't say impossible but while doable it would have some speed limitation. 

    Yes. split the channels of the encoder... I thought the same so I will just change some cables to adequate the pins of the N2HET and then change the layout to match the pins and have a nice wiring. 

    I already double checked and saw that I can use one of the pins on N2HET2 instead of N2HET1 and make possible to have one full encoder (channel A and channel B) on N2HET2. I just need to change the wire. But... how do I say to the module that that code is for N2HET2 or for the N2HET1??

    Is it done in Halcogen with this section?