cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC Creator & Designer Software

Anonymous
Not applicable

 Hi to all, can anyone tell me why to use the external resistors (one of the PSoC's pin is assigned for that)?

   

on what base does that pin is chosen & how does its presence or absence affects the operations.

   

Thanks & Regards-

   

Amit

   
        
0 Likes
Reply
32 Replies
Esteemed Contributor II

The I2C bus is an open drain connection which allows all particpants to pull down the signal without interfering with each other. The resistors are needed to

   

- setting the impendance of the bus according to bus capacitance

   

- providing logical high on the bus-signals

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

Hi Bob,

   

1. you mean setting the impedance of the SDA &SCL buses, do they have variable capacitances; if they do what are the parameters affecting their capacitance.

   

2. I didn't get you, please elaborate 2nd point.

   

Thanks & Regards-

   

Amit

0 Likes
Reply
Esteemed Contributor II

1) Every pin has an input capacity and a wire / pcb trace has got one also. You have to sum up all involved capacities and use your wanted frequency to calculate the required R which must be kept within the pecs limit. A usual approach was afair something like 5K.

   

2) An open drain bus has no device that can drive the signal to high-level, it only can be pulled low. So a resistor to Vcc is needed to generate a logic high on the bus.

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

Hi Bob, your explaination guides me towards the Pull-up Drive mode in PSoC.

   

After connection of the resistor, does it work in the same way as pull-up drive mode.

   

Thanks & Regards-

   

Amit

0 Likes
Reply
Esteemed Contributor

Whether the R is in PSOC or External (on an open drain configuration) the

   

basic functionality the same. However the tolerance of the internal PSOC

   

R is quite high, it varies a lot. 3.5K to 8.5 K for a PSOC 4.

   

 

   

Attached an ap note on calculating I2C pullup R's.

   

 

   

Regards, Dana.

0 Likes
Reply
Anonymous
Not applicable

Thanks Dana,

   

will go through the note & get back for further help.

   

Regards-

   

Amit

0 Likes
Reply
Anonymous
Not applicable

Hi guys, what will be the effect if I change the parameter in I2Cs-

   

Slave addr----from 4 to 8

0 Likes
Reply
Anonymous
Not applicable

also what is the use & importance of the BRIDGE CONTROL PANEL?

   

How to interface & use it?

   

Thanks & Regards-

   

Amit

0 Likes
Reply
Esteemed Contributor II

"what will be the effect if I change the parameter in I2Cs-Slave addr----from 4 to 8"

   

Just the same as if you move with your houshold two flats up the street: Your post will not arrive because you are living now at a different address.

   

I asked you before but you did not respond: What is the device you use as Master? Link to datasheet? How do you specify the address of the slave at master's side?

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

Sorry Bob, I'm using the Designer 5.4 & prog1.

   

In that still I do not know what to & how to use anything as a master. I'm just following the std. code doing modifications in that only. but as I have read it (I'm not sure)in my board I don't have access to master. do I have one? if I do then please guide me.

   

can we use the bridge as a master, I don't know much of the bridge controll panel. explain all.

   

Thnaks & Regards-

   

Amit

0 Likes
Reply
Esteemed Contributor II

"what is the use & importance of the BRIDGE CONTROL PANEL?"

   

The BCP needs a bridge, a communication connection between your PSoC and via USB to your PC. The Pioneer board has the bridging capability built-in, the MiniProg 3 can act for PSoC 3,4 and 5 as a bridge.

   

 

   

The BCP is able to receive data from your PSoC and visualize them as graphic or list without having the PSoC to stop from running and inspect the data like in debug mode.

   

Start the BPC and go through the help to get a feeling what it can perform.

   

 

   

Bob

0 Likes
Reply
Esteemed Contributor II

So can you please tell me what you want to do with an I2C-slave without a master?

   

 

   

Bob

0 Likes
Reply
Esteemed Contributor II

For PSoC1 a separate bridge is availlable to be used for some devices (not all) of the PSoC1 family. The bridge does not act as a I2C master aafaik.

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

I think I was specifying the slave addresses in the code itself, for each of the sensor.

   

with PSoC designer 5.4 & prog1, which device should I use as a master; but the prior question is do I have access to master with the above combination.

   

Thanks & Regards-

   

Amit

0 Likes
Reply
Anonymous
Not applicable

If I get the visualization of what I'm doing & whats happening in the ckt. while its running, I think I will sort out many things to proceed.

   

I've read of interfacing BCP in many docs but I'm not familier to it. 

   

I have it installed on my PC, I will go to its help & see what will help.

   

Thanks & Regards-

   

Amit

0 Likes
Reply
Esteemed Contributor II

You cannot use an I2C slave without having a master, even testing is not possible.

   

So again: What will you use as I2C-Master?

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

I haven't connected anything else but only the board(on which controller ckt. &BTNs etc. H/W is mounted) to the PC through prog1.

   

Is it that I'm using the PC as a master? I'm not getting about this master device. I just downloaded the code & it started working so I didn't bother anymore about it.

   

I will attach my project here, can  you tell me what am I using as a master.

   

Thanks & Regards-

   

Amit

0 Likes
Reply
Esteemed Contributor II

Your project does not tell anything about the master, the master is a device externally connected to P1[0] and P1[1], so what is connected to these pins???

   

 

   

You telll the connection to PC is made with "prog1" What device is that???

   

 

   

Have you got a schematic for your pcb or is that a development kit? Which??

   

 

   

Where did you get the address for the slave (8) from, is there any documentation???

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

Hello Bob,

   

Q:     Have you got a schematic for your pcb or is that a development kit? Which??

   

A:      I'm using the Cypress Basic Kit- CY3280-BK1.

   

In that I am using the User Modules for the Capsense(CSA_EMC) & for I2C interface(EzI2Cs).

   

Q:   Your project does not tell anything about the master, the master is a device externally connected to P1[0] and P1[1], so what is connected to these pins???

   

A:    In that the parameters of the EzI2Cs are as follow:

   

Slave Address-----> 8    //// I have changed the SLA from 4 to 8

   

Address Type-----> Static

   

ROM Registers-----> Disable

   

I2C ckock----> 400k Fast

   

I2C Pins----> P[1]0-P[1]1      //// these pins are assigned to the I2C interface User Module

   

Q:     You telll the connection to PC is made with "prog1" What device is that???

   

A:     Its a downloader kit.

   

Q:     Where did you get the address for the slave (8) from, is there any documentation???

   

A      I have read the docs referring to the I2C interfacing, but I didn't get much of SLA: their defining & effect of modifications in them. Also I have read about the sub-addresses in the EzI2Cs UM coding (detailed oprations of writing to slave & reading from it).

   

Datasheet of EzI2Cs in the PSoC Designer 5.4, topics on Cypress Forum & Application note etc. on the EzI2Cs.

   

Regards-

   

Amit

0 Likes
Reply
Anonymous
Not applicable

@Bob

   

I'm doing a project for buttons & in that I'm getting the 7(1to5 & 7&8) BTNS & their corrsp. LED's working properly. I have written the code for all 9 BTNS & LED's & assigned the pins accordingly.

   

The problem is I'm not getting 6th & 9th BTNS working. the question for me is that if I'm to get the 7 BTNS working it should be 1to7, why is it not working for the 6th while it is going for the 8th.

   

Help me on this.

   

Thanks & Regards-

   

Amit

0 Likes
Reply
Esteemed Contributor II

Now we can see much more clearer.

   

One question remains:

   

You are using some of the slider elements as buttons which is quite ok. Your not-working switch #6 is connected to which port? Or which segment is your switch 6?

   

Switch #9 cannot work as you programmed since its state is not returned by calling CSA_EMC_baSnsOnMask[0] but by CSA_EMC_baSnsOnMask[1]. Bit #0 will reflect its state.
Your
.button_state variable only holds a byte so it can reflect only the state of 8 switches, so there some changes will have to be made.

   

I cannot see yet why your switch #6 is not functional, waiting for a respose from you.

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

Now we can see much more clearer.

   

One question remains:

   

You are using some of the slider elements as buttons which is quite ok. Your not-working switch #6 is connected to which port? Or which segment is your switch 6?

   

Switch #9 cannot work as you programmed since its state is not returned by calling CSA_EMC_baSnsOnMask[0] but by CSA_EMC_baSnsOnMask[1]. Bit #0 will reflect its state.
Your
.button_state variable only holds a byte so it can reflect only the state of 8 switches, so there some changes will have to be made.

   

I cannot see yet why your switch #6 is not functional, waiting for a respose from you.

   

Hello Bob, thamks for understanding me.

   

Actually I do not intend to use the slider segments as the buttons but as my first prototype I have made 5 buttons & 4 slider segments on my board. Now priorly I wish get all of them as buttons so I'm progamming the considering as the buttons.

   

Q:   Your not-working switch #6 is connected to which port? Or which segment is your switch 6?

   

A:     I have assigned the 6th button to pin P0(4) & corrsp. LED to pin P0(2), all LED's are active low configured.

   

For the #9 do I need to use either CSA_EMC_baSnsOnMask[0] or CSA_EMC_baSnsOnMask[1] or both.

   

Regards-

   

Amit

0 Likes
Reply
Anonymous
Not applicable

@ Bob, sorry for jumbling the contents, here is the reply.

   

Thanks for understanding me.

   

Actually I do not intend to use the slider segments as the buttons but as my first prototype I have made 5 buttons & 4 slider segments(referring to STD. board) on my board. Now priorly I wish to get all of them as buttons so I'm progamming the considering all as the buttons.

   

Q:   Your not-working switch #6 is connected to which port? Or which segment is your switch 6?

   

A:     I have assigned the 6th button to pin P0(4) & corrsp. LED to pin P0(2), all LED's are active low configured.

   

For the #9 do I need to use either CSA_EMC_baSnsOnMask[0] or CSA_EMC_baSnsOnMask[1] or both.

   

Regards-

   

Amit

0 Likes
Reply
Esteemed Contributor II

Q: For the #9 do I need to use either CSA_EMC_baSnsOnMask[0] or CSA_EMC_baSnsOnMask[1] or both.

   

A: Both. [0] will give you buttons 1 to 8 and [1] wil deliver button 9

   

 

   

Since debugging a PSoC1 can be a pain in the ass I would suggest you to exclude all possible hardware defects as shortcuts or broken traces. You have got (hopefully) a CY3280-SLM board which you can plug into the devkit. You have choosen the buttons in a way that they can be used with that board. Only the LEDs differ, the kit-board has got only 5 of them. To avoid conflicts you should re-assign them for a test to see if number 5 is alife... ahh sorry, number 6 of course.

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

Thanks Bob, I will try your suggestions & hopefully will workout for me.

   

Regards-

   

Amit

0 Likes
Reply
Anonymous
Not applicable

Hello Bob, I have gone through your suggestions for the #9 button. I implemened the code with both as its #9, as:

   

reg_info.button_state = CSA_EMC_baSnsOnMask[0];

   

reg_info.button_state = CSA_EMC_baSnsOnMask[1];

   

For the case 1: Only mask[0],

   

I'm getting the o/p for 8 sensors & as we discussed it is right.

   

For the case 2: implementing both mask[0] followed by mask[1]

   

I'm getting:

   
        
  1. the first #1 to #8 buttons not working &
  2.     
  3. for the #9 button its sensing but the o/p is not shown on the corrsponding LED.
  4.    
   

Q:   Why didn't it take all the 9 buttons at a time when I write code for both of them (mask[0] followed by mask[1])?

   

Thanks & Regards-

   

Amit

0 Likes
Reply
Esteemed Contributor II

A byte -as your status variable is- has exactly 8 bits which can hold as many as 8 states for your first 8 buttons. Your second call reg_info.button_state = CSA_EMC_baSnsOnMask[1]; gets the 9th button but overwrites the previously stored buttons since you use the same variable to store. 

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

A byte -as your status variable is- has exactly 8 bits which can hold as many as 8 states for your first 8 buttons. Your second call reg_info.button_state = CSA_EMC_baSnsOnMask[1]; gets the 9th button but overwrites the previously stored buttons since you use the same variable to store. 

   

 Hello Bob, do you mean I need to change my code for the

   

BYTE button_state; to Word?

   

is it possible to do so with the kit I'm having?

   

Regards-

   

Amit

0 Likes
Reply
Esteemed Contributor II

Amit,

   

you are programming in C-Language and everything that C offers you can be used in your project. I would suggest you to take something to read during your holiday, there are some helpful books apart from "C-Programming Language by Kernighan & Ritchie" which is the "Bible" for all C-programmers. Keep an eye on "variables", leave the "pointers and addresses" for later, but look at "structs".

   

 

   

I wish you a pleasant holiday!
Bob

0 Likes
Reply
Esteemed Contributor

This is a pretty good book, attached.

   

 

   

Regards, Dana.

0 Likes
Reply
Anonymous
Not applicable

Hi to all, felling good & refreshed with the holiday.

   

I have got my board working properly to my expectation.

   

Thanks & Regards-

   

Amit

0 Likes
Reply
Esteemed Contributor II

Congratulations Amit! Was a long way to go, but as every jurney it started with the first step.

   

 

   

Bob

0 Likes
Reply