Raspberry Pi to Psoc5LP

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

cross mob
Anonymous
Not applicable

I am trying to read output from the Raspbery Pi to the Psoc (High/Low), Im doing a smart lock through bluetooth using the pi as the bluetooth compoenent. When a verified paired device is recognized i need to the pi to send out a 1 . With a DMM I am able to verify that the Pi puts out a 0,1 because it reads 3V=High and 0V=Low. When I try to read the output from the Pi  thorugh an if loop, the psoc does not work.

   

 

   

Any ideas on whats wrong?

0 Likes
12 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received
        Please post your code.   
0 Likes
Anonymous
Not applicable

Does copy and paste work on here?! it wont let me post it

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

Are you providing your PSoC with 3.3V?

   

Please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator -> File -> Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

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

I am providing the PSoC with 3.3 volts via the Pi.

   

Here is my workspace

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

You only read your pinstate at the beginning of the program. Its value is never again changed.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

that pin is changed though the pi, when a device is paired i send out a 1 to the psoc. but it doesnt seem to read it 

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

You do not read the pin again! Follow your program flow, you assign the value from reading the pin only once.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Ok, I tried inserting the pin_read() inside the for loop so the state of the pin is being read from the raspberry pi it still did not work. Is there a way I can print out if the pin is actually reading 3V or logic 1 or 0? 

   

I also tried connecting it directly to a 3.3V pin from the pi which should provide a logc 1 but also no luck.

   

thanks for your input Bob!

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

You should use the debugger to check variables. Set a breakpoint and display (mouse over) your vars.

   

Reading a pin is such a simple thing, I would suggest using a logic analyzer. Triple check the connections.

   

Can you provide the actual changed project?

   

 

   

Bob

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

I just see: Your bluetooth_pin is configured as output, not as input!

   

 

   

Bob

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

Here is my current file

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

Set the drive mode of the bluetooth_pin to "Digital High-Z"

   

 

   

Bob

0 Likes