PIC TO PIC USING BLUETOOTH

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

PIC TO PIC USING BLUETOOTH

Post by siliconchip »

Hi,
is it possible to transmit a square wave from one pic micro to another using bluetooth such as the HC-05 bluetooth module, ??

cheers bob

User avatar
Steve
Matrix Staff
Posts: 3418
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: PIC TO PIC USING BLUETOOTH

Post by Steve »

The short answer is yes.

We have a full course on this here which you can find in the resource tab on that page.

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: PIC TO PIC USING BLUETOOTH

Post by siliconchip »

hi steve,
thanks for the reply, i just looked at the course and got lost lol ive no experience with bluetooth i was hoping there may have been something on the site that someone had already done so i could disect it at will to try to get a grip on it i realsie i wont learn anything in 5 mins but would prefer this method if available

cheers bob

User avatar
Bachman
Posts: 116
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 9 times
Been thanked: 53 times
Contact:

Re: PIC TO PIC USING BLUETOOTH

Post by Bachman »

Bluetooth is for data transfer, see Wikipedia: https://en.wikipedia.org/wiki/Bluetooth

You can't use it to transfer pure square wave. HC-05 bluetooth module is an UART - Bluetooth module. You can use it to send (and receive) data from a device to another.

chipfryer27
Valued Contributor
Valued Contributor
Posts: 618
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 195 times
Contact:

Re: PIC TO PIC USING BLUETOOTH

Post by chipfryer27 »

Hi

I don't know your intended application however as per Steve's reply it could be done if you really, really wanted to, but as Bachman points out the UART isn't suited to "sending waves" so you would most likely need to transmit the wave component values for reconstruction at the far end. If you were going to do that, why not just get the Rx PIC to generate the wave in the first place, perhaps being controlled (on/off/duty/etc) by the Tx PIC via the UART?

There is an example of using the module to send data on the WiKi

https://www.flowcode.co.uk/wiki/index.p ... (Wireless)

Hope this is of help.

Regards

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: PIC TO PIC USING BLUETOOTH

Post by siliconchip »

hi bachman and chipfryer
thanks for the replys sorry i wasnt specific in my description but yes chipfryer i agree about the RX pic being programmed for the wave generator but being initialised by the TX pic i just need to try to construct a working model now as i say ive never touched blue tooth so its a learning curve

cheers bob

chipfryer27
Valued Contributor
Valued Contributor
Posts: 618
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 195 times
Contact:

Re: PIC TO PIC USING BLUETOOTH

Post by chipfryer27 »

Hi

That sounds reasonably straight forward.

I'd look at the wiki example of how to send data via BT and once you are comfortable with that then move on. I'm sure if you get stuck with anything the forum will give good advice.

If using the UART you might also want to look at the Circular Buffer examples too. A very handy component indeed.

Not really what you are after, but on the WiKi there is also an example of PWM using an analogue pot to vary the duty cycle. You could modify that so that instead of reading a value from the pot, it receives it via the BT. That could be a nice project to get started with especially as you are only modifying "working" examples to get the concept correct. Of course you could just send a command via BT to switch a LED on/off too :)

Hope this helps and keep us updated with progress.

Regards

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: PIC TO PIC USING BLUETOOTH

Post by siliconchip »

hi all

having clicked on the wiki link above there is only one flowchart when sending data via a keypad to the LCD, am i right in thinking that this flowchart is for the transmitting microcontroller as well as the receiving controller ?? with the transmitting HC05 set as master and the receiving HC05 set up as the slave ?? pardon my ignorance but I'm having trouble grasping this cheers in advance

bob

Post Reply