K60 Tower Module

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K60 Tower Module

1,201 Views
davidzhou
Contributor V

Hi,

I have a K60 Tower. My understanding is there is only one CAN transceiver on the peripheral board. Is it possible to plug two peripheral boards (the same types) into  the tower with the controller board, and jump both CAN ports?

Thank you,

David Zhou

8 Replies

984 Views
davidzhou
Contributor V

I made an outside transceiver for CAN0 and solved this issue.

Thank you,

David

984 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

I'm glad to hear you got a workaround.

0 Kudos

984 Views
davidzhou
Contributor V

Hi Robin,

I have an external transceiver working with CAN0 (Rx/Tx pins on PTC16/PTC17, which are also on B41/B42). Instead of using the peripheral board's transceiver, I used my external transceiver. This is to confirm that the external transceiver is working.

But I still have issues with CAN1 (Note: CAN0/CAN1 a little confusing: using PE, PTC16/PTC17 is on CAN0 ).

I tried to use PTB19/PTB18 as Rx/TX, on B66 and B72, which are used as EBI_AD15, EBI_OE_b. I am not sure that can be done?

I also tried to use PTA12/PTA13 (A25/A23) shared with ethernet. But it doesn't work.

I don't know the A47, A48 as CANRX1, CANTX1, what that means? I thought they have to be selected through PE using PTA12/PTA13, etc.

(From TWRK60F120MUM.pdf)

pastedImage_1.png

Thank you,

David Zhou

0 Kudos

984 Views
mjbcswitzerland
Specialist V

David

A4 7 refers to the back plane connections and not the chip and you need to check whether these are actually connected on the K60 tower card.

There are two possible connections (muxing at the chip) as follows:

        #if defined CAN1_ON_PE
        _CONFIG_PERIPHERAL(E, 24, PE_24_CAN1_TX);                        // CAN1_TX on PE24 (alt. function 2)
        _CONFIG_PERIPHERAL(E, 25, PE_25_CAN1_RX);                        // CAN1_RX on PE25 (alt. function 2)
        #else
        _CONFIG_PERIPHERAL(C, 17, PC_17_CAN1_TX);                        // CAN1_TX on PC17 (alt. function 2)
        _CONFIG_PERIPHERAL(C ,16, PC_16_CAN1_RX);                        // CAN1_RX on PC16 (alt. function 2)

        #endif

See also the following video for simulating dual-CAN and the K60: https://youtu.be/Ha8cv_XEvco


Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html
Kinetis K60:
- http://www.utasker.com/kinetis/TWR-K60N512.html
- http://www.utasker.com/kinetis/TWR-K60D100M.html
- http://www.utasker.com/kinetis/TWR-K60F120M.html
- http://www.utasker.com/kinetis/ELZET80_NET-KBED.html
- http://www.utasker.com/kinetis/ELZET80_NET-K60.html

For less questions and faster, cheaper developments: try uTasker for Kinetis

0 Kudos

984 Views
davidzhou
Contributor V

Hi Mark,

As you wrote:        

         _CONFIG_PERIPHERAL(E, 24, PE_24_CAN1_TX);                        // CAN1_TX on PE24 (alt. function 2)
        _CONFIG_PERIPHERAL(E, 25, PE_25_CAN1_RX);                        // CAN1_RX on PE25 (alt. function 2)

But K60 there is no pins for CAN0 if using PE, which is only allowed for Pins (PTB19/PTB18, or PTA13/PTA12).

   Note: CAN0 (by PE) is CAN1 on the document TWRK60F120MUM.pdf.

I manually coded into PE generated code:

  PORTE_PCR25 = (uint32_t)((PORTE_PCR25 & (uint32_t)~(uint32_t)(
                 PORT_PCR_ISF_MASK |
                 PORT_PCR_MUX(0x05)
                )) | (uint32_t)(
                 PORT_PCR_MUX(0x02)
                ));
    PORT_PDD_SetPinPullSelect(PORTE_BASE_PTR, 25, PORT_PDD_PULL_UP);
    PORT_PDD_SetPinPullEnable(PORTE_BASE_PTR, 25, PORT_PDD_PULL_ENABLE);
    /* initialization of CAN TX pin */
  /* PORTB_PCR18: ISF=0,MUX=2 */
    PORTE_PCR24 = (uint32_t)((PORTE_PCR24 & (uint32_t)~(uint32_t)(
                 PORT_PCR_ISF_MASK |
                 PORT_PCR_MUX(0x05)
                )) | (uint32_t)(
                 PORT_PCR_MUX(0x02)
                ));
    PORT_PDD_SetPinPullSelect(PORTE_BASE_PTR, 24, PORT_PDD_PULL_UP);
    PORT_PDD_SetPinPullEnable(PORTE_BASE_PTR, 24, PORT_PDD_PULL_ENABLE);

  On A46/A45.

Not Working.

Thank you,

David Zhou

0 Kudos

984 Views
mjbcswitzerland
Specialist V

David

For CAN 0 these are the options.

    #if defined CAN0_ON_PB_LOW
        _CONFIG_PERIPHERAL(B, 16, PB_16_CAN0_TX);                        // CAN0_TX on PB18 (alt. function 5)
        _CONFIG_PERIPHERAL(B, 17, PB_17_CAN0_RX);                        // CAN0_RX on PB19 (alt. function 5)
    #elif defined CAN0_ON_PB
        _CONFIG_PERIPHERAL(B, 18, PB_18_CAN0_TX);                        // CAN0_TX on PB18 (alt. function 2)
        _CONFIG_PERIPHERAL(B, 19, PB_19_CAN0_RX);                        // CAN0_RX on PB19 (alt. function 2)
    #else
        _CONFIG_PERIPHERAL(A, 12, PA_12_CAN0_TX);                        // CAN0_TX on PA12 (alt. function 2)
        _CONFIG_PERIPHERAL(A, 13, PA_13_CAN0_RX);                        // CAN0_RX on PA13 (alt. function 2)
    #endif

If PE doesn't support the ones that you need you should be able to delete its MUX code and add your own.

In case of difficulties just use the CAN solution in the uTasker project: http://www.utasker.com/docs/uTasker/uTaskerCAN.PDF
It is available as free open source on Github.

Regards

Mark

0 Kudos

984 Views
davidzhou
Contributor V

Hi Mark,

Thank you for your reply.

I was using PTB19/PTB18 as CAN0 Rx/Tx. The code is created using PE. The pins are on expansion B (B72/B66) I believe. I don't see any tx or rx signals on the pins when I scoped. I am not sure those pin are directly tied to the micro chip, because they are used as touch pads:

pastedImage_1.png

I don't know is there any way to disable the touch pad function, or jumper to some pins so they are directly tied to the micro. I have hard time time to find the schematic of TWR-K60F120M primary and peripheral boards.

Best Regards,

David

0 Kudos

985 Views
mjbcswitzerland
Specialist V

David

On the TWR-K60D100M the signals are indeed connected as shown (PTB18 to B66, for example).
If you enable the CAN0 pins for CAN function the TSI function is switched out.


Regards

Mark

0 Kudos