HC05/06 component

Moderator: Benj

Post Reply
medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

HC05/06 component

Post by medelec35 »

Tested both 05 and 06 but not sure how to select which one you have connected, I don't believe you can.
I would have thought there is a way as AT commands work completely different.
For example from new both work at a baud rate of 9600
However for setting pair key to 2468 for example.
HC06:
if not paired in AT mode
Baud = 9600
AT+PIN2468
Note CR + LF not required.

HC05:
Get into AT mode by holding button Then apply power.
Or pulling EN high before applying power.
Baud = 38400
AT+PSWD=2468\r\n
Then so you can send and retrieve chars the power must be removed and reconnected so baud rate must be changed back to 9600.

I did notice when testing HC06 the name function worked but setting pair code did not.
Nothing works on HC05
Attachments
HC06 Name + Pairkey Changer 1d.fcfx
(14.96 KiB) Downloaded 230 times
Last edited by medelec35 on Fri Jul 27, 2018 10:47 am, edited 1 time in total.
Reason: Missed out: pulling EN high before applying power.
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: HC05/06 component

Post by Benj »

Hi Martin,

Please can you confirm this works. I have seen this command before knocking about on the internet but thought it was maybe from older firmware as the AT+PIN has always worked for me. Maybe I've only ever bought the HC06 devices?
Baud = 38400
AT+PSWD=2468\r\n
Then so you can send and retrieve chars the power must be removed and reconnected so baud rate must be changed back to 9600.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: HC05/06 component

Post by medelec35 »

Hi Ben,
I confirmed it worked on my HC05 before posting about the component.
If you want me to test the component with HC05 and HC06 before adding to the database, then I'm happy to do so.
I did use Tera Term for confirmation.
What I will do this afternoon is change flowchart and use buttons to direct to either HC05 or HC06 commands.
I will test both HC05/6 with both sets of commands and make a note of which work and which don't.
Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: HC05/06 component

Post by medelec35 »

Hi Ben,
Learned one thing and Some surprising results.
I learned that if RX interrupt is enabled, then if the baud rate is changed via SetBaud then RX interrupt is automatically disabled. :?
Surprising results is HC05 name change command works with HC06 but HC05 pair code command does not work with HC06.
That aside, HC06 name change command or pair code change command does not work with HC05.
Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: HC05/06 component

Post by medelec35 »

medelec35 wrote:I learned that if RX interrupt is enabled, then if the baud rate is changed via SetBaud then RX interrupt is automatically disabled.
Is this a bug, or known and accepted?
It took me a little while to work out what was going on.
Martin

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: HC05/06 component

Post by LeighM »

Hi Martin,
The CAL code looks OK, it re-establishes the interrupt if the correct flags are set, this is probably one for Ben when he re-visits this component.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: HC05/06 component

Post by medelec35 »

Its nothing to do with HC05/06 component its only to do with UART component.
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: HC05/06 component

Post by Benj »

Thanks Martin,
Its nothing to do with HC05/06 component its only to do with UART component.
You're right the interrupt was being deactivated on a baud change if the user activated it using an interrupt icon. The auto RX interrupt as used in the GPS/GSM components etc would have continued to work.

This should now be fixed anyway.

Post Reply