USB Learning Note Serial (20): FX2LP How to achieve high speed and full throttle switching (reprint)

Source: Internet
Author: User

Cypress USB Peripheral Controller cy7c68013a is widely used in USB printers, mobile phones, storage devices, USB testing and other areas of the classic products. The product complies with the USB2.0 protocol specification, supports full speed and high speeds two velocity modes, and is equipped with 8051 MCU, with Io,iic,uart, timer and other functions. Since the chip is the only chip on the market that supports high-speed mode, it has gained a wide range of attention since the first listing.

On the development of CY7C68013A, Cypress provides a complete program architecture, the general application only needs to understand its software architecture and the meaning of the register, and then modify the register initialization value according to its own requirements, and modify the USB related descriptor can be implemented. And Cypress provides a lot of routines and host computer, convenient reference and debugging, speed up the development progress.

But in the process of development, if you want to implement the speed mode of your cy7c68013a device into switchable, then you will probably have to struggle and pain. Because you've looked through its datasheet and TRM manuals and will not find any relevant introductions.

But please don't worry, after reading this post, you will be able to achieve.

First, in all the routines of cy7c68013a, the device is enumerated in high-speed mode by default. So what do you do if you want to implement the default enumeration as a full-speed device? Then you need to change the value of the register. How to change, where to change? CY7C68013A's implementation method is a bit weird. Because he does not configure the value of a register in the program like any other MCU, it is implemented by modifying the configuration of the Keil software. It is accurate to call the Hex2bix file in Keil to implement the conversion parameters by modifying the hex file to the IIc file. The commands in the Keil configuration will be changed to

C:\cypress\usb\bin\hex2bix-c 0x80-i-f 0xc2-o Bulkloop.iic Bulkloop.hex.

If you do not add the-C 0x80 command, then CY7C68013A will be enumerated by default to high speed, plus-C 0x80 is enumerated by default to full speed.

Then when the implementation of the device by default enumeration to full speed, if the program will be USB disconnected, CY7C68013A will become a high-speed mode, when you want to switch speed mode, and how to do? It's simple, just like this (big recruit):

Usbcs |= Bmdiscon; Just disconnect from USB

ct1&=0x02; 0X02 ensures that the program can be kept at full speed after reboot,//0x00 guarantees

Ezusb_delay (1500);

usbcs&=~bmdiscon; Reconnect USB

Usbcs|= Bmrenum; Ezusb_discon (TRUE);

That is, modifying the value of the register CT1 is good. This register is the register that controls the speed mode. But there is no introduction to this register in the TRM Handbook, why? That's because this register is illegal, and it's accurate to say that this register was used by the cypress company when it was developed at test time. So no announcement. The above content is hoped to be helpful to everybody. (This code can only refer to the file Fx2regs.h for the register in the routine)

USB Learning Note Serial (20): FX2LP How to achieve high speed and full throttle switching (reprint)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.