UF32 as DMA host

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

UF32 as DMA host

9,281 Views
Bee
Contributor III
I'm wondering if anybody has enough experience with the UF32 to help me decide if using it might work as a DMA host. I was thinking of using the SM module to simulate the DREQ/DACK/DBWR functions. I only need to read from a device (a FIFO in this case) that has been taught to respond as a DMA output device. The transfer can happen in 512 byte blocks and I can ignore doing the 16 bytes of redundant data as well as not doing the ECC.

My questions are:
1-what lines (pins) are critical to have data movement?
2-what lines should be set constant values (/SBSY=1, /SCD=0)?
3-do I note SCLE=0 and SALE=0 during the /SRE time?
4-is /SRE the only line that I need to look at for data requests?

Has anyone tried this yet? It would be good to be able to use a UF32 module to do this transfer into a QUE buffer to avoid bit-banging, which uses up CPU time. I want to be able to move this data to a host via the USB module.

Thanks, -Al-
Labels (1)
0 Kudos
11 Replies

990 Views
pryszczol
Contributor I
Hi, I'm making SD card reader using UF32_Drivers_20041201 as basic firmware for microcontroller s12uf32. After plugging in USB connector and debugging a test firmware (USB test without ATA), program stops at the check USB bus reset loop located in USB_StatusChgISR function(USB Status Change interrupt service routine). It means that USB bus is in reset state all the time. I have tried my best modifying source files to get out from this reset state on USB bus, but with no effect. Swapping signal line D- and D+ didn't help. Have anybody got any idea to get through this problem? The registers value during debuggering: UMCR=0xC01C-Enable Module Clock, USB module enabled, normal operation on usb bus, bus-powered device, SET_DESCRIPTOR supported, full speed expected, Remote Wakeup supported, UMSR1=0xE8C8-no transfer in progress, USB reset status has changed, Full-speed, Reset state detected on bus, UIMR=0x3807-every thing is set except RESUMEIE.
0 Kudos

990 Views
glork
Contributor I
Hi Al.
I've used the uf32 in one application. We wanted to use the usb but ultimately abandoned it because we could never get it to finish enumerating.
I do believe that we were able to transfer the enumeration date to the pc though. I didn't do that part of the firmware but I can probably get my hands on it if I need to.

We didn't ever try to use the ique; it looks like an absolute mess to me and I don't generally trust something that complicated (just general principle).

We did have to use CF flash cards with it (kind of the purpose of the application), however I found the built-in CF interface not to my liking so I bit-banged it. With good success.

If any of this looks helpful to you I will try to share.
ron
0 Kudos

990 Views
Bee
Contributor III

glork wrote:
Hi Al.
I've used the uf32 in one application. We wanted to use the usb but ultimately abandoned it because we could never get it to finish enumerating.
I do believe that we were able to transfer the enumeration date to the pc though. I didn't do that part of the firmware but I can probably get my hands on it if I need to.

We didn't ever try to use the ique; it looks like an absolute mess to me and I don't generally trust something that complicated (just general principle).

We did have to use CF flash cards with it (kind of the purpose of the application), however I found the built-in CF interface not to my liking so I bit-banged it. With good success.

If any of this looks helpful to you I will try to share.
ron




Thanks for your quick reply. Yes, I definitely would like any help that you can give, especially your experience with the USB. It's hard to believe that Freescale doesn't have better support for this UF32 (more examples-that work, better documentation for USB-section 5 left out!). Once I get something to work, I will be glad to share what I've found wrt (with respect to) the IQUE and USB20.
Bit-banging is working for my 8-bit byte stream because it's slow (256 bytes/millisec). Did your CF solution run fast enough (say, >4 KB/millisec)? Please let me know the next step.

-Al-
0 Kudos

990 Views
imajeff
Contributor III

glork wrote:
it looks like an absolute mess to me and I don't generally trust something that complicated (just general principle).

Al wrote:
It's hard to believe that Freescale doesn't have better support for this UF32 (more examples-that work, better documentation for USB-section 5 left out!).


All together this discussion doesn't make a good impression of Freescale, but I have some comments. And glork, I believe we all trust many things more complicated than that... you may not know it because they are hidden in 'black boxes', and we typically feel strangely comfortable only because we are not controlling them :smileyhappy:

I think the UF32 is probably really good for anyone who learns it inside and out. IMHO the problem is usually just that a developer doesn't see the whole picture (i.e. what was intended by the design), or doesn't already know about the subject, in this case USB. That leads to my question to Al:

Al, why is it hard to believe that Freescale doesn't have better support for this UF32? This is the absolute norm for their documentation which has been discussed repeatedly since long before Frescale was distinguished from Motorola. I should mention I've seen better improvements just recently (last two years).

So I plan to learn more about the subject from other sources also, maybe
http://www.lvr.com/usb.htm
http://www.hitex.co.uk/usb/usbtutorial.html :smileysad:sorry not useful for many of us )
http://www.techtutorials.info/usb.html

Message Edited by imajeff on 05-05-200608:27 AM

0 Kudos

990 Views
Bee
Contributor III
Thanks for your input, iamjeff.

The problem is not so much that I don't understand USB protocol, as that Freescale's example (reference) and the documentation, don't elaborate on the proper use of their USB20 module in the UF32. The marketing words extoll the advantage of this chip, but the use of it is not well defined. Surely it must work or why would it be on their list of products. I'm looking for some practical hints as to how/what procedures (bit settings and their order) to use. I've done the obvious, and the results are stated in my other post (USB on UF32). I've turned in a service request and have not had a reasonable response, so I'm looking for help from someone with experience. Freescale/Motorola has been good on that in the past, IF the correct person can be found. I will gladly share what I find out.

-Al-
0 Kudos

990 Views
imajeff
Contributor III


The problem is not so much that I don't understand USB protocol, as that Freescale's example (reference) and the documentation, don't elaborate on the proper use of their USB20 module in the UF32.

Yea I should have been more clear that I could tell you knew about USB itself. Hopefully beginners can find a better path to using this UF32. It's just that the problem you see with documentation has always been their problem... Maybe enough Information but not enough Application given in the same place.

I hope they improve that. When I read specific details I want at least one sentence about how it would be used (like a real example) on the same section. I did see almost that in the IIC docs. When I download an "Application Note" it is annoying that there is normally no specifics, and normally it is not even written for the same MCU.
0 Kudos

990 Views
Bee
Contributor III
Yes, iamjeff, I'm being confused by the documentation. This morning I got bit7 of UMSR1 to lite up and it is supposed to be 0. That tells me my documentation is out of date, but I have the Latest from the UF32 site. So what is a person to do??
Next, I went to the 8-bit MCU Board to see if they have anything better on using a USB. And they do! "DR002: USB08 Universal Serial Bus Evaluation Board Using the MC68HC908JB8 Designer Reference Manual". It describes the expected function of the chip with respect to the USB protocol, and there is some code to look at as well. One of the users got it to run on a JB16 (another 908 mcu). So there is hope. Of course, the S12UF32 and the 908JB8 don't have much in common since the UF32 is faster and does more behind your back. Now I'm on a hunt for more up-to-date documentation. My version is S12USB20D6E2FV1/D V01.01. Does anyone know where a more recent doc might be?

-Al-
0 Kudos

990 Views
J2MEJediMaster
Specialist I
OK, there is a later version of the document S12USB20D6E2FV1/D, version 1.03. Also there's an app note, DRM065, that explains how to use the UF32's USB 2.0 interface to read flash cards and memory sticks. To obtain these docs, go to the freescale documentation library and type "USB2" as the search criteria.

Here's the link with the search string embedded in it:

http://www.freescale.com/webapp/search/MainSERP.jsp?showAllCategories=false&SelectedAsset=Documents&...;

This also turns up a few more USB-related docs that may or may not what you need, but it's worth a look. Hope this helps.

---Tom
0 Kudos

990 Views
imajeff
Contributor III

J2MEJediMaster wrote:
OK, there is a later version of the document S12USB20D6E2FV1/D, version 1.03.

Tom, thanks for pointing out the USB20 revision to 1.03, I thought I still had the latest (1.02). However, look at the Change descriptions from 1.01 to 1.03. You had to know it would not be helpful.
1.02 - Changed company logo
1.03 - Removed empty Section 5

In fact, it would be helpful if I knew a quick link to see just the summary page of recent changes for each revision so I know if it's worth downloaing another.

Message Edited by imajeff on 05-10-200608:13 AM

0 Kudos

990 Views
Bee
Contributor III
Thanks for the pointers, Tom. I've been to the DRM066 and have studied it. My problem was more basic, in that I couldn't even get out of Reset state on the USB connection. (I will check the other references your search found as well.)

Good News: this morning I have found that in the layout, the 2 signal wires were Crossed! (reverse polarity) I rerouted them and Wallah! I am out of reset and into the next phase of development. The UF32 is seen by the PC. Thank you all for the patience. A basic observation about USB: if all you get are 3 or so attempts by the host to Reset the USB without success, then check the polarity of the wiring to the plug.

Now I still would like to find more details about the correct use of the bits in the USB20 module. For example, the sample code never sets the MEN (module enable) bit, only the MCE (module clock enable). Seems strange not to have the module enabled and yet it appears to work.

-Al-
0 Kudos

990 Views
glork
Contributor I
Good morning Al.
I'll start today to try to gather the usb code, give me a couple of days.
I never timed the CF transfers since raw speed wasn't a big issue in my application, so I don't know how fast it runs. In any case I just used "register-decrement" timing to control the transfer speed and that can be optimized.
ron
0 Kudos