Modifying the CY3240 I2USB Firmware

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

cross mob
Anonymous
Not applicable

Hi,

   

I'm trying to modify the CY3240 firmware (through PSoC Designer) so that it retains all its bridge functionality but can also use some of the I/O pins on the dev board to read voltages through its internal ADC. Ideally, the dev board would function as normal, routing USB commands to the i2c bus, but would also be able to intercept certain packets that tell it to access an I/O port.

   

Anyone have experience with this (e.g. sample code)?

0 Likes
2 Replies
Anonymous
Not applicable

Hello,

   

I'm looking for the same functionnality as you. Have you find a way?

   

I'm not able to program the CY3240 through the Miniprog, it doesn't regonize the Psoc parts.

   

Thanks to share your discovers.

   

best regards,

   

 

   

Mathias.

0 Likes
wistc_299286
Level 3
Level 3
10 replies posted 10 sign-ins First solution authored

Hello,

   

I am modifying the firmware for the CY3240-I2USB Bridge to use the I/O ports and I am stuck. There is a boot file called boot_psocconfigtbl.asm that overwrites the configurations that I set in the chip viewer. So, modifying the code and chip configuration requires that you copy the automaticly generated psocconfigtbl.asm file register setting on to this boot file. I have had sucess in reading internally by using the bridge's internal read commands which use the I2C addresses after 80h. I just added my own and it appears I can read from them after using the I2C address 86h and I can still use the bridge. Ultimatly, I want to keep the I2C USB Bridge and use the I/O ports and use the A/D Converters to read a DC voltage.

   

That seems to be my problem. I am trying to use an incremental ADC with a PGA amplifier with a gain of 1and my ADC always gives me 00 as my result data. I routed the output of the PGA to the analog out and I can read the same voltage that I input, and I have followed several tutorials and I can't get the ADC to output a value. I started a new project without the I2CBridge and configured an ADCINC and a PGA and it works perfectly!! I copy the same settings on to the I2C USB project and it dosen't work. I have painstakenly monitored every register that is affilated with the ports or the ADC and PGA during runtime, I can't see any problems.

   

From what I can tell the Interupts are working correctly and the data ready flag is set but the data is zero and I know I have a DC voltage at the input. Here are my settings:

   

VC1=12 (For both the PWM and the Analog Clock Column) 2MHz Clock

   

Analog Power= SC On/Ref High (All modules start at high power)

   

Ref Mux = (VDD/2 +- VDD/2)

   

I have tried swapping the clocks many times but right no the clocks are swapped.

   

Interupts are enabled

   

ADC resulution= 8 bits

   

BYTE ADC_Recieve;

   

I am using the sample code from main:

   

M8C_EnableGInt;

   

ADCINC_Start(ADCINC_HIGHPOWER);       // Apply power to the SC Block

   

ADCINC_GetSamples(0);

   


for(i=0; i<200; i++){
            if(ADCINC_fIsDataAvailable()!= 0){
                ADC_Recieve=ADCINC_bClearFlagGetData();  // Clear ADC flag
                }
        }

   

If anyone can tell me what I am doing wrong I would greatly appreciate it!!

   

Thank You,

   

William

0 Likes