Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 1 > compiler runs on it's own!

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



compiler runs on it's own!
Moderator:
ARVI

Post Reply
Follow this topic



compiler runs on it's own!

robertseczkowski posted on 27 Aug 2010 10:18 AM PST
Top Contributor
89 Forum Posts

I'm trying to make use of I2CHW module, i order to modify comparator hyst parameter.
For testing only I put control value in I2cregs.cSTR[4] to see what is going on.
I figured out that code puts the value which is not entered.

I mean that under I2CRegs.cStr[4] appears value 0x70 after I2Cconversation

w 04+ 00+ 10+ 10+ 10+ 10+ 10+ p
r 04+ 00+ 70+ 00+ 00+ 10+ 10+ 00+ p
w 04+ 01+ 10+ 10+ 10+ 10+ 10+ p
r 04+ 10+ 70+ 00+ 00+ 10+ 70+ 00+ p

Please ommit  00 twice after 70. it's from the rest of the code


Below is the code which runs in the loop:
"
volatile unsigned char histCurrent = 0x70;
void I2C(void)
{
BYTE status;
status = I2CHW_bReadI2CStatus();
        /* Wait to read data from the master */
        if( status & I2CHW_WR_COMPLETE ){
         /* Data received - clear the Write status */
            I2CHW_ClrWrStatus();
            /* Reset the pointer for the next read data */
            I2CHW_InitWrite((BYTE*)&I2CRegs,BS);

            if(I2CRegs.bCmd == 0x01)
            {
             switch (I2CRegs.cStr[0])
             {
             case COMP_REF0_937:
             case COMP_REF0_875:
             case COMP_REF0_812:
             case COMP_REF0_750:
             case COMP_REF0_688:
             case COMP_REF0_625:
             case COMP_REF0_562:
             case COMP_REF0_500:
             case COMP_REF0_437:
             case COMP_REF0_375:
             case COMP_REF0_312:
             case COMP_REF0_250:
             case COMP_REF0_188:
             case COMP_REF0_125:
             case COMP_REF0_062:
             case COMP_REF0_042:
             case COMP_REF0_021:
             histCurrent = I2CRegs.cStr[0] ;
             I2CRegs.cStr[4] = I2CRegs.cStr[0];
             break;
             default:
             histCurrent = COMP_REF0_500;
             I2CRegs.cStr[4] = I2CRegs.cStr[0];
             break;
             }
               
            COMP_SetHyst(histCurrent);
            I2CRegs.bCmd = 0x10;
            }else I2CRegs.bCmd = 0;
       
        }
        if( status & I2CHW_RD_COMPLETE )
        {
                    /* Data echoed - clear the read status */
            I2CHW_ClrRdStatus();
            /* Reset the pointer for the next data to echo */
            I2CHW_InitRamRead((BYTE*)&I2CRegs,BS);
        }
}"
 




Re: compiler runs on it's own!

robertseczkowski posted on 28 Aug 2010 06:57 AM PST
Top Contributor
89 Forum Posts

Another conversation example. Look's as if number after address determines number of nines from the end of buffer.
But the code do not contain 9, nor it's logic is not such.

Secondly please note that if conversation starts with address plus 01 then next byte is acknowledged. If not next byte is not acknowledged. The code is not able to do this, unless You interfere with interrupts which I don't use at all


I have no doubt now that newly purchased CY8C24223A chip is broken.

Simply no way to comunicate with device. Maybe artificial inteligence is sitting inside chip and send conversation invitations which I  hardly undersand. Thanks CYPRESS TEAM


follow up conversation:
w 04+ 01+ 05+ p
r 04+ 05+ 00+ 00+ 01+ 00+ 00+ 00+ 00+ 00+ 09+ p
w 04+ 01+ 08+ p
r 04+ 08+ 00+ 00+ 01+ 00+ 00+ 00+ 00+ 00+ 09+ p
w 04+ 02+ 08- p
r 04+ 00+ 00+ 01+ 00+ 00+ 00+ 00+ 00+ 09+ 09+ p
w 04+ 02+ 08- p
r 04+ 00+ 00+ 01+ 00+ 00+ 00+ 00+ 00+ 09+ 09+ p
w 04+ 03+ 08- p
r 04+ 00+ 01+ 00+ 00+ 00+ 00+ 00+ 09+ 09+ 09+ p
w 04+ 04+ 08- p
r 04+ 01+ 00+ 00+ 00+ 00+ 00+ 09+ 09+ 09+ 09+ p
w 04+ 03+ 08- p
r 04+ 00+ 01+ 00+ 00+ 00+ 00+ 00+ 09+ 09+ 09+ p

 

 

 

 

 

http://www.psocdeveloper.com/forums/viewtopic.php?f=3&t=7032






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20