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:
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.