Can Sampler For MPC56XX

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

Can Sampler For MPC56XX

Jump to solution
7,502 Views
thangabalashanm
Contributor III
Hi,

 

We are using MPC5607B Micro controller and configured CAN Sampler to wake up over CAN but wake up interrupt is not generated.

 

we are using TJA1043 can transceiver, circuit connection details and code is attached below:

 

Details of code:

 

1. Configured wake up unit and CAN Sampler for 125kbps,

CAN Sampler bit enabled,MODE =1

(It should sample first frame), ACTIVE_CK =1(RC_CLK) and

CAN_RX_SE = 000(RX0(PB[0])

 

2.Initially we transmit one frame through Flexcan0 Module

from controller (just to confirm CAN configuration) with baud rate

125kbps,

 

3. Then on reception of the frame with id=6F we are putting the

CAN transceiver in stand-by mode and controller in STOP

Mode, .

 

4. Then try to transmit frame from canalyzer for wakeup the microcontroller

but i am getting error frame on canalyzer

 

I have attached my code and Can transceiver Cirucuit

 

Please guide me..

 

Thanks and Regards

Thangabala S

Original Attachment has been moved to: 01129640091588_Can-Sampler.txt.zip

Labels (1)
1 Solution
6,292 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I uploaded the example here:

https://community.freescale.com/docs/DOC-100206

Hope it will be useful.

Regards,

Lukas

View solution in original post

18 Replies
6,292 Views
thangabalashanm
Contributor III

Hi,

Thank you, it will be very useful for me.

Thanks And Regards

Thangabalakrishnan S

0 Kudos
Reply
6,292 Views
thangabalashanm
Contributor III

Hi,

     In CANSampler, is it possible to use three CAN Channels simultaneously

Thanks and Regards

Thangabalakrishnan S

6,292 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

unfortunately not. There's only one CAN sampler module and we can select only one RX pad to be sampled.

Regards,

Lukas

0 Kudos
Reply
6,292 Views
thangabalashanm
Contributor III

Hi,

         Without Cansampler, is it possible to wake-up the mcu from low power mode upon reception of any other frame

Thanks and Regards

Thangabalakrishnan S

0 Kudos
Reply
6,292 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Yes, take a look at Table 12-1 in RM:

http://www.freescale.com/files/32bit/doc/ref_manual/MPC5607BRM.pdf

Each CAN RX pin is connected also to Wake Up unit.

Regards,

Lukas

0 Kudos
Reply
6,292 Views
thangabalashanm
Contributor III

Hi,

    1. I want to put my controller and can transceiver in standby mode, in that case how i can wakeup by can frame

    2. What is the state of CAN0RX while controller is in standby mode

    3. In wakeup unit, which register i want to access(Falling or Rising)

Thanks and Regards

Thangabalakrishnan S

0 Kudos
Reply
6,292 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

1. Configure the WKPU in the same way as in the SW example that I shared earlier. Just do not use the sampler. Notice that the FlexCAN must be frozen before entering the low power mode due to erratum e3247.

2. All WKPU pins must be pulled up by internal or external resistor in STANDBY mode. CAN0RX is input pin, pull up must be enabled, so the state is logic "1" - so it is the same state like in normal recessive state of CAN RX pin.

3. Set falling edge.

Any incoming CAN frame will generate falling edge on CAN RX pin, so the WKPU will wake up the device.

Best Regards,

Lukas

6,292 Views
thangabalashanm
Contributor III

Hi,

     Thank you for your replay

Thanks and Regards

Thangabalakrishnan S

0 Kudos
Reply
6,292 Views
thangabalashanm
Contributor III

Hi,

     1. Can u guide how to handle bus-off and error passive interrupt in MPC5607B (Flexcan 0), both having same vector address.

     2. For me bus-off is working but error passive is not working, I have configured Flexcan Transmit warning interrupt and receive warning interrupt also.

     3. How i can generate error passive?

0 Kudos
Reply
6,292 Views
thangabalashanm
Contributor III

Hi,

    What about MPC5607B Micro controller EEPROM?

Thanks and Regards

Thangabalakrishnan S

0 Kudos
Reply
6,292 Views
thangabalashanm
Contributor III

Hi,

Thank you, I have the same code that you have shared. But i need code regarding low power modes.

If you have any code regarding the Low power modes share me. Otherwise guide me how to handle

CAN Sampler

Thanks and Regards

Thangabala S

0 Kudos
Reply
6,292 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Could you wait till next week? I will try to prepare some sample code.

Lukas

0 Kudos
Reply
6,292 Views
thangabalashanm
Contributor III

Hi,

Ya sure, When can i expect that?

0 Kudos
Reply
6,293 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I uploaded the example here:

https://community.freescale.com/docs/DOC-100206

Hope it will be useful.

Regards,

Lukas

6,292 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I can see in your code that you do not select rising or falling edge on wake up unit. You are writing WIREER to zero and WIFEER is left in reset state (also zero).

Copied from reference manual:

“Writing a ‘0’ to both IREE[x] and IFEE[x] disables the external interrupt

functionality for that pad completely (that is, no system wakeup or interrupt

will be generated on any activity on that pad)!”

Please give this a try.

Regards,

Lukas

6,292 Views
thangabalashanm
Contributor III

Hi,

That one also i tried, but i am getting error frames. can u share me some links about Can sampler and low power modes in MPC5607B controller.

Thanks and Regards

Thangabala S

0 Kudos
Reply
6,292 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

here is application note about low power applications:

http://www.freescale.com/files/microcontrollers/doc/app_note/AN4240.pdf

And examples for low power can be found in this AN:

http://www.freescale.com/files/32bit/doc/app_note/AN2865.pdf

http://www.freescale.com/webapp/sps/download/license.jsp?colCode=AN2865SW

Unfortunately there's no AN for CAN sampler.

Regards,

Lukas

0 Kudos
Reply
6,292 Views
thangabalashanm
Contributor III

Hi,

Thank You For Your replay. I will back soon.

Thanks and Regards

Thangabala S

0 Kudos
Reply