Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Problem with PC6 and PC7 of AN21xx/FX using EZ Loader method

Problem with PC6 and PC7 of AN21xx/FX using EZ Loader method

Anonymous
Not applicable
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?

 

Answer:

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.
0 Likes
155 Views
Contributors