BLE data to DAC output

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

cross mob
Anonymous
Not applicable

Hi there

   

I'm designing a data collection system which collects data over bluetooth using the Heart rate collector example. The data transmitter I've implemented on a different chip, but I've verified its functionality with debug mode in terminal. However, I want to set the level of the IDAC using the received "Heart rate". In the hrsc.c file, right under where it would usually print the heart rate to terminal in debug mode, I put IDAC_SetValue(HrscGetHeartRate()/4); The values I receive are between 0 and 1023, and the IDAC on the PSoC 4 is set to 8 bits, hence the division by four.

   

However, when I run the code, this is what I get when I connect it to an oscilloscope:

   

http://prnt.sc/dd7bj6

   

The IDAC output constantly resets, as if running PWM mode. Here's a zoom-in:

   

http://prntscr.com/dd7h16

   

I can't figure out why this is happening, anyone have an idea?

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

Welcome in the forum.

   

Check your values for negative numbers.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

This was pretty obvious, but the answer was that the PSoC went into sleep mode any chance it got. Disabling this fixed the issue!

0 Likes