- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I wonder if you connect Target, GND, and XRES with MiniProg3, does it work or not?
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, If I connect with Target, GND, and XRES MiniProg3, it still doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, there is no resistors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Then please try with the CardKb attached.
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi, likewise the problem persists. Works with miniprog3. It does not work with dc adapter. Could there be a problem with crystal? Best Regrads.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I set both SDA and SCL to Resistive pull up. still the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for testing.
Since it did not work, please revert those pins to Open drain to avoid further confusion.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi, I think it has nothing to do with cardkb. because I uploaded a non-cardkb project. the same problem exists there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
That is interesting.
Does the project have any I2C in it?
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, there isn't I2C.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, OK.
Then please double check your circuit.
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I accidentally connected the VDDIOX to the VCC with a capacitor.The problem was solved by removing the capacitors from the circuit.
Best Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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