HMC5883L Bug or me!

For general Flowcode discussion that does not belong in the other sections.
jgu1
Posts: 820
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 705 times
Been thanked: 186 times

HMC5883L Bug or me!

Post by jgu1 »

Hi!

I figth with this module an not managed to get it work. Tryed almost everything, but not working. After initialyilse, I see 28929 in the display and it stop.

Have anyone experience with this module or can tell med if I do something wrong, please :) Also not working in FC9.

Thank´s i advance

Jorgen
Attachments
HMC5883L-Magnetometer-Module.jpg
HMC5883L-Magnetometer-Module.jpg (47.52 KiB) Viewed 531 times
Flowcode1.fcfx
(12.07 KiB) Downloaded 39 times

medelec35
Matrix Staff
Posts: 2120
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 658 times
Been thanked: 716 times

Re: HMC5883L Bug or me!

Post by medelec35 »

Hi Jorgen
First of can you set your flowchart up so the display shows the value of X also for Initialise and UpdateCompassData
Show them on different rows to make it easier to know what all the values are for.
You could use a string preceding as well.
Rather than using clear, can you just use several spaces after the values to clear unwanted digits.
E.g.
PrintString "UCD = "
PrintNumber X
PrintString " "

I can see a issue with the code.
Initialisation value of 1E for the 7bit address looks correct since when in write mode it will be 3C etc.

Do you have a logic analyser you can connect to I2C data and lock signals?
At this stage for the compass keep to different pins in software mode than the LCD
Martin

jgu1
Posts: 820
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 705 times
Been thanked: 186 times

Re: HMC5883L Bug or me!

Post by jgu1 »

Hi Martin!

Thanks´for fast reply.

I will try to make a better program.

" First of can you set your flowchart up so the display shows the value of X also for Initialise and UpdateCompassData" do you mean in display?

Do you also mean that I also have to convert to String, and then use the " " to delete the previous data?

Yes I have an analyzer, and I will make a test and attach and I am aware of the display, i will allocate another pin for this when test.

I am not home at the moment, maybe 2-3 days and I test ;) You hear.

Br Jorgen

jgu1
Posts: 820
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 705 times
Been thanked: 186 times

Re: HMC5883L Bug or me!

Post by jgu1 »

Hi Martin!

"Bug or me"? Me :lol:

I startup with a new testprogram as you advice, strugling and figth and will sent you data from logic analyzer to you. The last ting I tryed, supply the device to 3,3V, and then data is comming data in the display. Nice so it work. ;)

But one thing, I guess that "use data pin is when the device is finish update data it give a signal out? I can enable and disable it, bur if I in config set it for yes, no data come out and if I use no, the the triggersignal is comming. Okay, the other way around is a trifle.

If someone like to test, I use the device on the picture, on the backside is label GY-273, the GY-271 will not work.

Again thank´s for your help.

Br Jorgen
Attachments
QMC5883LWiki.fcfx
(20.86 KiB) Downloaded 8 times

medelec35
Matrix Staff
Posts: 2120
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 658 times
Been thanked: 716 times

Re: HMC5883L Bug or me!

Post by medelec35 »

hi Jorgen.
For the board that's not working have you tried using the I2C scanner on it?
If so, what address is displayed?
Martin

jgu1
Posts: 820
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 705 times
Been thanked: 186 times

Re: HMC5883L Bug or me!

Post by jgu1 »

Hi again!

Of course your great tool ;)

The GY-273 first (which now vorking have adress: 0x0D

The GY-271 have another adress: 0x1E

So I guess this is the issue, but can´t see in proporties where to change it, maybe you could update so it is possible to choose in proporties? ;)

Jorgen

medelec35
Matrix Staff
Posts: 2120
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 658 times
Been thanked: 716 times

Re: HMC5883L Bug or me!

Post by medelec35 »

I have looked at the component and 0D is used.
I have added an address property if you want to try it out.

If you do, browse to this location using file explorer , it's hidden by default so just paste the link into your address bar.

Code: Select all

%ProgramData%\MatrixTSL\FlowcodeV10\Components
Place the attached components.
If Flowcode is already open, then you will need to reload your project for the new component to work
If you run any component updates, then the component you added will be overwritten, so it will stop working again (unless the component update has been pushed).

Can you let me know how you get on please.
Attachments
QMC5883_Magnetometer.fcpx
(6.56 KiB) Downloaded 3 times
Martin

medelec35
Matrix Staff
Posts: 2120
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 658 times
Been thanked: 716 times

Re: HMC5883L Bug or me!

Post by medelec35 »

I have just modified the component so you can select either QMC5883L or HMC5883L
People might find it less confusing than just leaving the user to work out and enter correct address.
Attachments
QMC5883_Magnetometer.fcpx
(6.58 KiB) Downloaded 4 times
Martin

jgu1
Posts: 820
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 705 times
Been thanked: 186 times

Re: HMC5883L Bug or me!

Post by jgu1 »

Agree ;)
The HMC5883L does not work!

medelec35
Matrix Staff
Posts: 2120
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 658 times
Been thanked: 716 times

Re: HMC5883L Bug or me!

Post by medelec35 »

OK thanks for letting me know.
Did you want to try with the first file and enter correct address.
We can take it from there.
Martin

Post Reply