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

PSoC™ 5, 3 & 1 Forum Discussions

eeEn_4618901
Level 4
Level 4
5 likes given First like received First like given

I made a new PCB board with PSOC chip. I installed this new chip program with miniprog3. the card works when I energize it with the programmer. But if I connect an external source it keeps working 1 time, what could be the reason?

0 Likes
1 Solution

Hi,

For the stability having those capacitor between the pin and GND is also recommended.

Anyway, I'm glad hearing that problem was solved.

moto

View solution in original post

21 Replies
MotooTanaka
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Hi,

Although I think that some of us already know about your project,

it is a good idea and manner to describe your environment,

such as the device and the development environment.

Now I assume that you are using

Device: CY8C5888LTI-LP097

Dev. Env: PSoC Creator v 4.3

Programmer: MiniProg3

Correct me if some of above is/are not crrect.

So from what you wrote

(1) The program works when powered by MiniProg3

(2) But it has problem when MiniProg3 is not connected and the device is powered from an external power source.

(3) BTW, I don't understand what you meant by "it keeps working 1 time."

     Does it mean, it works for the first power up, but it stops working from the 2nd power up or reset?

     Or does it stop working after some time passed?

Right now, what I can imagine are

- The hardware design around power may have problem.

- The circuit around reset may have problem.

- Being a software engineer, I can not go much further,

  it will help others to help you if you can provide your circuit.

  At least around "power", "reset" and PSoC connection.

moto

P.S. Oh, you could have put link to your previous discussion below.

Still your circuit will be very important though.

Psoc 5lp new pcb card

0 Likes

Hi,

I changed the chip.

Device: CY8C5868AXI-LP035

Dev. Env: PSoC Creator v 4.3

Programmer: MiniProg3

If I connect it as in figure a, it works without problems. It does not work if I connect it as in figures b and c.

miniprog prog.jpg

Best Regards

0 Likes

Hi,

I wonder if you connect Target, GND, and XRES with MiniProg3, does it work or not?

moto

0 Likes

Hi, If I connect with Target, GND, and XRES MiniProg3, it still doesn't work.

0 Likes

Hi,

> Hi, If I connect with Target, GND, and XRES MiniProg3, it still doesn't work.

That is interesting!

How about connect SDA and SCL to VDD via some resistors such as 4.4K (2 ~ 10k Ohm)?

moto

0 Likes

Hi,

If the previous test works.

May be, you can test with the external power supply and connecting an external I2C device, such as the CradKb.

moto

0 Likes

Hi, there is no resistors.

0 Likes

Hi

Then please try with the CardKb attached.

moto

0 Likes

hi, likewise the problem persists. Works with miniprog3. It does not work with dc adapter. Could there be a problem with crystal? Best Regrads.

0 Likes

Hi,

Currently, I'm suspecting that some I2C call can not return because of the signals seems to be "Busy."

To prove it, can you debug using MiniProg3 with Vtarget, GND, XRES connected, and SDA, SCL open.

Would you check

(1) When you start debug, does the debugger pointer come to the first part of main()?
(2) Place a break at the first I2C function call and run. Does the debugger pointer stop at the break point?

(3) Step Over the function, does the debugger pointer stop at the next line?

(4) From debugger, run (resume), and wait a while, then select pause. Where is the debugger pointer now?

If

(1) fails, there may be some "real" hardware issue

(2) fails, there must be some more problem(s) which I have not been able to figure out is taking place

(3) fails, this is what I'm suspecting, may be we need to implement timeout for I2C functions.

(4) Probably where the pointer is at or lines before it has the problem.

moto

0 Likes

To prove it, can you debug using MiniProg3 with Vtarget, GND, XRES connected, and SDA, SCL open.

OK.Would you check

(1) When you start debug, does the debugger pointer come to the first part of main()?

YES

(2) Place a break at the first I2C function call and run. Does the debugger pointer stop at the break point?

YES

(3) Step Over the function, does the debugger pointer stop at the next line?

YES

(4) From debugger, run (resume), and wait a while, then select pause. Where is the debugger pointer now?     

   CyDelayCycles_loop:

debugger pointer here ===>  SBCS r0, r0, r1          /*  1    2  */

Best Regards.

0 Likes

Hi,

Today I came a cross with a KBA which stated that MiniProg3 had 5.6K Ohm pull-up for SDA and SCL.

So I think that the absence of pull-up resistor for these signals are causing trouble.

> (4) From debugger, run (resume), and wait a while, then select pause. Where is the debugger pointer now?    

>    CyDelayCycles_loop:

> debugger pointer here ===>  SBCS r0, r0, r1          /*  1    2  */

I'm sorry that I was not very specific, but at least this seems that the program is caught in some kind of loop.

(Probably waiting for I2C bus to be ready)

I suspect that this is caused by I2C API of PSoC 5.

Although recent version of PSoC 4 has "timeout" but not for PSoC 5.

Probably if you connect pull-up resistors to the I2C pins (SCL, SDA) the program will work.

One possible workaround is...

can you set both SDA and SCL to Resistive pull up?

001-SDA_pull-up.JPG

moto

0 Likes

Hi, I set both SDA and SCL to Resistive pull up. still the same.

0 Likes

Hi,

Thanks for testing.

Since it did not work, please revert those pins to Open drain to avoid further confusion.

002-SDA_open_drain.JPG

Then, I wrote earlier, probably the root cause is I2C API is stuck in some of the wait loop(s) when I2C bus does not react as expected.

Namely, following functions have while loop without timeout, which can stuck.

I2C_MasterSendStart()

I2C_MasterSendRestart()

I2C_MasterSendStop()

I2C_MasterWriteByte()

I2C_MasterReadByte()

So I hacked a version with timeout for them and included in the cardkb.h and cardkb.c attached.

I2C_MasterSendStart_TMO()

I2C_MasterSendRestart_TMO()

I2C_MasterSendStop_TMO()

I2C_MasterWriteByte_TMO()

I2C_MasterReadByte_TMO()

Would you try replacing these two file and test if it can fix the problem?

moto

0 Likes

Hi,

OOPS, I forgot to call  the timeout funcitons.

Please modify myI2C_ReadByte(uint8_t reg_addr) to

==========================

uint8_t myI2C_ReadByte(uint8_t reg_addr)

{

    uint8_t status ;

    uint8_t value = 0 ;

   

    I2C_MasterClearStatus();

    status = I2C_MasterSendStart_TMO(CARDKB_I2C_SLAVE_ADDR, I2C_WRITE_XFER_MODE, TIMEOUTMS) ;

   

    if (I2C_MSTR_NO_ERROR == status) {

        I2C_MasterWriteByte_TMO(reg_addr, TIMEOUTMS);

        status = I2C_MasterSendRestart_TMO(CARDKB_I2C_SLAVE_ADDR, I2C_READ_XFER_MODE, TIMEOUTMS); 

    }

   

    if (I2C_MSTR_NO_ERROR == status) {  

        value = I2C_MasterReadByte_TMO(I2C_ACK_DATA, TIMEOUTMS);

    }

    I2C_MasterSendStop_TMO(TIMEOUTMS); 

   

    return(value) ;

}

==========================

moto

0 Likes

hi, I think it has nothing to do with cardkb. because I uploaded a non-cardkb project. the same problem exists there.

0 Likes

Hi,

That is interesting.

Does the project have any I2C in it?

moto

0 Likes

Hi, there isn't I2C.

0 Likes

Oh, OK.

Then please double check your circuit.

moto

Hi, I accidentally connected the VDDIOX to the VCC with a capacitor.The problem was solved by removing the capacitors from the circuit.

Ekran Alıntısı.JPG

Best Regards.

Hi,

For the stability having those capacitor between the pin and GND is also recommended.

Anyway, I'm glad hearing that problem was solved.

moto