Why i am Unable to send data via BLE?

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

cross mob
Anonymous
Not applicable

Hello Every One,

   

I made a program in BLE PSOC4. If i run the program without my code for sine wave generator (IDAC and TCPWM module) then, it runs perfectly fine. But if i include it, it doesn't work. This means i am unable to detect or communicate between my mobile and BLE device.

   

   

Looking forward for your suggestions.

   

Awais

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

Have a look at the warning in line 41 (Declaration of SineTable).

   

You just declared a pointer, but did not reserve any storage for the array. So an assignment SinTable will destroy some data in sram.

   

Ways out:

   

char SineTable[128];

   

or, if you like dynamic allocations:

   

SineTable = malloc(TABLESIZE);  //  do not forget to increase Heap size!!!

   

 

   

Bob

View solution in original post

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

Have a look at the warning in line 41 (Declaration of SineTable).

   

You just declared a pointer, but did not reserve any storage for the array. So an assignment SinTable will destroy some data in sram.

   

Ways out:

   

char SineTable[128];

   

or, if you like dynamic allocations:

   

SineTable = malloc(TABLESIZE);  //  do not forget to increase Heap size!!!

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thankyou Bob for your reply.

   

Yes now i used char SineTable[64];

   

Now the data is coming but, the speed is very slow.

   

Can you tell me why i am getting this much slow speed?

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

On every interrupt, which occurs 7680 times a second, you are re-calculating the sine table. Change your program, so that you just calculate all values once, and then in the interrupt handler transfer them to IDAC.

   

 

   

Bob