MCF51JM64 interrupt issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MCF51JM64 interrupt issue

929件の閲覧回数
CSoto
Contributor I

Hi,

I'm trying to integrate the CMX generic HID demo code into my own application and board to enable USB communication with the PC host.

When I look at the MCF_USB_INT_STAT register after an interrupt has been raised, I always get the USB_RST bit, but also the SOF_TOK bit even though the last one hasn't been enabled in the init code.

 

I should say that the HID demo runs fine in my board, so it shouldn't be a hardware problem. Any clues? I'm totally stuck right now.

 

Thanks in advance

ラベル(1)
8 返答(返信)

627件の閲覧回数
CSoto
Contributor I

After some research, it seems the problem is that I can't get any TOK_DNE interrupt, so the hosts generates RESETs until it finally gives up and stops sending any message.

I'm using PE to initialize hardware, and I think the CLK settings are right (I've got a 12MHz external clock, and the PLL output frequency is 48MHz to feed the USB peripheral) but right now I'm not quite sure I've set everything right.

 

I also thought it could be related to the other interrupts, but right now I'm only using 3 more (TPM2, SCI1 and I2C2)

 

I'll keep searching, but any help would be greaty appreciated.

0 件の賞賛

627件の閲覧回数
SecondTechCo
Contributor IV

I am wondering how this turned out.  I am using the CDC sample program and  freescale stack and find continuous interrupts generated anytime the usb cable is plugged in.  The interrupt is SOF_TOK.  IS this necessary  in the USB stack ?

0 件の賞賛

627件の閲覧回数
JimDon
Senior Contributor III

Yes:

    • Start of Frame Packets

The SOF packet consisting of an 11-bit frame number is sent by the host every 1ms ± 500ns on a full speed bus or every 125 µs ± 0.0625 µs on a high speed bus.

USB is a polled protocol. The host asks device if it has anything.

627件の閲覧回数
JimDon
Senior Contributor III

You may be able to ignore SOF, I am not 100% sure if you must ack this packet.

But if you ignore all polls, for more than 3ms you will be "suspended".

You need to balance things carefully when using native USB.

0 件の賞賛

627件の閲覧回数
SecondTechCo
Contributor IV

Thanks.  You have been very helpful.  Is there another way to use USB ? IE Non native ?

0 件の賞賛

627件の閲覧回数
JimDon
Senior Contributor III

I've used the  FT232H connected to a CFV2 8 bit parallel interface. I send the data on a non-interrupt thread, so real time keeps running. Since it hi speed usb, you can send data at a much higher rate. Note that the 80Mhz V2 maxes out at about 1MB, but realistically 700KB to allow other things to happen.

Also, no issues with device drivers, as FTDI provides all that.

FT232H

0 件の賞賛

627件の閲覧回数
SecondTechCo
Contributor IV

This would seem to bog down a real time system with a lot of interrupts wouldnt it ?    Does each device need to respond back to the host even if it has nothing?  

0 件の賞賛

627件の閲覧回数
SecondTechCo
Contributor IV

IE can I turn off the interrupt so it doesn't bog down my micro and then  respond only when I have something.

0 件の賞賛