Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
Problem with PC6 and PC7 of AN21xx/FX using EZ Loader method
Question: After downloading firmware to EZ-USB (AN21xx/FX) using EZ Loader method, we are not able to use the GPIO pins PC6 and PC7. When we use EZ-USB control panel to download the firmware we are able to use these pins. What might be the problem?
The loader firmware that gets downloaded by the EZ Loader driver configures the alternate function of PC6 and PC7 to be RD# and WR#. The EZ-USB Control Panel examines the Intel hex record first to determine whether part/full of the firmware resides in external memory. If so then it configures PC6 and PC7 to their alternate setting to access external memory. This is the reason behind this behavior. You can overcome this by using any of the following two methods
You can remove the following three lines from ezloader.c and then rebuild the driver: Ezusb_8051Reset(fdo,1); Ezusb_DownloadIntelHex(fdo,loader); Ezusb_8051Reset(fdo,0);
This way you bypass the loader firmware since you're loading only to on-chip memory.
In the boot-up part of your firmware (TD_Init()) you can write to PORTCCFG register to configure PC6 and PC7 as GPIOs before accessing them.