How to read Endpoint 1 / 2 downloading data?
Usually, when user download information using other endpoints, he can read data from fifo using the defined macro to user's own variables, such as when use Endpoint1 as download endpoint, you can use the following method:
BTS1 UE1R.5
//Check whether there is data to download
JMP Main_Loop
//No data to download, jump to the main program
//There is data to download, read it to buffer
EP1_RD_RAM_addr_set 0x08
//Write endpoint 1FIFO Address
EP1_RD_RAM_to_A
//Read data A from the Fifo
MOV Buffer,A
BCLR UE1R.5 //Clear the flag bit
Main_Loop:
..........................................