Can you help me out

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I've attached the project bundled file. please look into it and tell me where it goes wrong.

   

Thank you

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I presume: CY8CKIT-042 BLE Pioneer Kit. Port 3 pin 4 might be used internally as I2C_SDA for the I2C-UART bridge, see schematics. Try another input (port 3 pin 0 at J2 pin 1)

   

 

   

Bob

View solution in original post

0 Likes
18 Replies
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I took the right to change the sources, see attached.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thank you, Bob, 

   

1.Still, there are no Values in ADCout. (step execution in debug mode)

   

2. I couldn't understand why you write Wait(x) At ln16 and what is its use there?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

ADC will not work correctly when debugging. Just let the program run and then click a breakpoint at the assignment ADCout = ... You will see the value of the previous conversion. I cannot see where the input voltage comes from. Schematic??

   

No value needs explanation, every value can be valid. So what shows ADCout?

   

 

   

Wait() is just for readability, everyone will see that your program waits for something to happen.

   

while(); // will cast a warning

   

while()

   

{

   

}   // Needs 3 lines instead of one

   

 

   

Bob

0 Likes
Anonymous
Not applicable

ADCout shows 0x00000... value.

   

And the schematic is a voltage divider network with an LDR and Resister. The analog IP is taken from the Node. Vref 3.3v

   

 

   

Thank You Bob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Which Cypress development kit are you using? CY8CKIT-0?? <- number??

   

 

   

Bob

0 Likes
Anonymous
Not applicable

I'm using 042

   

Uc is cy8c4247lqi-bl-483

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

cy8c4247lqi-bl-483t is the PSoC chip, the board (pcb) when a cypress one starts with CY8CKIT-

   

Or what kind of board are you using?

   

 

   

Bob

0 Likes
Anonymous
Not applicable
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I presume: CY8CKIT-042 BLE Pioneer Kit. Port 3 pin 4 might be used internally as I2C_SDA for the I2C-UART bridge, see schematics. Try another input (port 3 pin 0 at J2 pin 1)

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thank you Bob,

   

I understand, But When I'll needing 4-5 ADC that time will i be able to use the P3.4 and P3.5? I guess its multiplexed with the I2C proto

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

^There are some more pins to use for ADC, don't worry. At this time you need to get one pin to work. The step to n+1 is then much easier. I still miss the schematic of LDR and Resistor you use. Did you already see that you can do that in topdesign using the off-chip components? Just enable "External terminal" checkbox of your Ain pin. Then connect LDR, resistor GND and VCC

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Thank You Bob,

   

I did the schematic with the off-chip component just like you told me last. Please find the project file in the attached

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You are still on Port3 pin 4

   

 

   

Bob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I just checked: Because you do not do anything with your variable ADCout the compiler has optimized-out the assignment.

   

Use Project -> Build Settings -> ARM GCC -> Compiler -> Optimization: and set Optimization level to "none", then rebuild the project. Now the value will get stored in ADCout.

   

 

   

Bob

0 Likes
manusharian
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Hi Bob,

   

Sorry to interfere but you said something about the port 3 pin 4 and 5 which are internally assign to I2C interface. I have made a custom PCB because I needed the port 3 pins 4,5 and also 6,7( which are on the RGB led) but still have problems with 4,5 pins. Shouldn't they be connected to I2C only when the chip is put on the development board?

   

Also I used the Port 4 pins 0 and 1. I do not observe strange behavior yet but I may ask, and this may be useful also for this post: Is there any problem to use all 8 pins of Port 3 + Port 4: 0,1 pins? I do not received any errors but I did not validate the ADC values yet either.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@Marian-Emanuel

   

I was referring to the Cypress Kit CY8CKIT-042 BLE Pioneer kit which uses some of the PSoC's pins for UART or I2C bridging, Capsense etc. On a self designed board there are no restrictions of using Port3. Port 4 pins are restricted in routing, they can be used under firmware control but it is not possible to route them internally.

   

Can you please explain what problems you have got with the P3_4 and P3_5 pins? And can you post a project showing that issue?

   

 

   

Bob

0 Likes
Anonymous
Not applicable

@Marian Emanuel

   

Very agreed with you. it's a development board then why we can't use P3.4&5 for ADC.

   

 

   

Gaurav

0 Likes
Anonymous
Not applicable

Hey bob thank you, I can see the ADC reading in ADCout by using P3.0.

0 Likes