7 Replies Latest reply on Jan 29, 2018 9:35 AM by WaMa_286156

    BLE not connecting when adding ADC on PSoC4


      I am trying to read 2 analog sensors with ADC and send the information out via BLE. The BLE is detected, but cannot connect. Interesting enough, the moment I remove the ADC component from the design, the BLE is connected successfully. I have tried with 2 separate modules. I suspect that something in my project is not quite right, so I need help.


      Attached is the project.


      I have tried the Cypress CySmart app to connect to it - no connection. I have downloaded the heart rate example code and compiled it, run and try to connect with CySmart - no connection. In both cases the CySmart does detect the BLE module. I have tried Samsun tablet and phone (with CySmart app and my app), and Iphone with the CySmart app.


      Any help will be much appreciated!




        • 1. Re: BLE not connecting when adding ADC on PSoC4

          Did you alrady try to set the BLE to a higher priority (0 is highest)



          • 2. Re: BLE not connecting when adding ADC on PSoC4

            Hi Bob,


            Thanks for the prompt answer.

            I have increased to level 0. I did it from the Interrupt tab of Design Wide Resources. Yet no change. Still can not connect to the tablet.




            • 3. Re: BLE not connecting when adding ADC on PSoC4

              Looking at your project, you are not setting the interrupt routine of the ADC correctly:


              Try it with AdcStart() modified to the following:


              void AdcStart()


              ADC_Start(); /* Initialize ADC */

              //ADC_IRQ_Enable(); /* Enable ADC interrupts */

                  ADC_IRQ_Start();//Either this or ADC_IRG_StartEx(<callback function>) will work

              ADC_StartConvert(); /* Start ADC conversions */



              When you are calling ADC_IRQ_Enable(), that only allows the interrupt to fire for the ADC component, but doesn't setup the callback vector, priority, and handling fully.

              ADC_IRQ_Start() is what I believe you were looking for.

              • 4. Re: BLE not connecting when adding ADC on PSoC4

                Thanks for the tip! Unfortunately not a fix in my case.


                So I have tried it - no connection. I have deleted the ADC and the clock and left the 2 sensor pins. Commented the lines:

                ADC_Start ();

                ADC_IRQ_Start ();

                ADC_StartConvert ();


                and further commented the lines:


                ADC_StopConvert ();

                ADC_Stop ();


                Clean, Compile, Program -> the connection is successful.


                Then I have added the ADC component, connected to the pins. I did NOT take the comments off the above lines, i.e. the above lines that start the ADC are still not executed.


                Clean, Compile, Program -> the connection cannot be established.


                Any ideas?


                Meanwhile I will try with different components on the design, to try to figure out a pattern...



                • 5. Re: BLE not connecting when adding ADC on PSoC4


                  I made it work. The only problem is that I have no idea how. What I did is experimenting:

                  - taking the ADC out - connecting OK

                  - placing an IDAC - Connecting OK.

                  - taking IDAC out - connecting OK

                  - placing ADC with default settings - Connecting OK

                  - starting ADC - connecting OK.


                  Then windows crashed during build, and corrupted the project. I loaded the original version and NO communication again. Changed the ADC_IRQ function to Start, still no communication. 


                  Conclusion: somehow the settings on the ADC are responsible for the lack of communication.


                  I will continue with the tryouts. I will update when having result.




                  • 6. Re: BLE not connecting when adding ADC on PSoC4

                    Try setting your clock to be internal, and the clock frequency to be 1100.000 kHz.

                    Also, see if putting some resistance between the ADC and your sensor left/right helps out.

                    • 7. Re: BLE not connecting when adding ADC on PSoC4

                      *The following is a *guess* *


                      I recently found out on the PSOC5 (Yes, I know this is PSOC4) that adjacent *analog* pins have issues when there are digital signals on them at a high frequency.  This caused some analog and digital features to not work properly.  The fix was to put slow moving signals between the high frequency signals if they also occupied analog pins.


                      Check your part to see if you have high frequency digital signals next to your Bluetooth radio signals.  If so, move them a pin or two away and see if that fixes anything.


                      Also, I found the order in which I added components to the system could cause an issue with digital routing.  (Race conditions).

                      1 of 1 people found this helpful