HMC6352

Questions on control of serial busses
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: HMC6352

Post by YahooArchive »

I have no idea if basic works since my system is only C, but it may with the
clock stretching that was added.



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: HMC6352

Post by YahooArchive »

What Bill did was to read 10 bits of data from the HMC6352 instead of 8, I may
have missed other meaningful changes in his code.

This may indicate clock stretching is needed, as the 6352 may have been holding
the SCL line low.

The resolution of Brian's You Tube post is too low to tell anything.

What I would need to see is a screen capture of the scope trace (it looked like
a Tek scope which should have that feature)

And what data came back as reported by the ARMmite I2CIN and whether it was
ACK'd or not.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: HMC6352

Post by YahooArchive »

yes. however at present I switch a bit.

1) I am using another solution to read HMC6352. ATMega16. since this is a low
level platform and I using ICCAVR to do the programming. see what kind of
problem I will encountered. then this may given some hints for me to solve.

2) The HMC6352 can be read by using ATMega16.
http://www.youtube.com/watch?v=udwsC0n3J9c

But I found one point should pay attention and this might related with my
problem which I encountered in ARMite.
The SCL clock for HMC6352 is 100KHz. But my case cann't workring (see the video
for selfexplain), unitl I changed the clock much lower then the reading come
out. This is no good for some precise machine need very fast reading(like UAV,
rocket,...etc). The problem may related with pull up resistors. my case is 4.7K
and SCL/SDA has a long wire (~10cm) connect the compass to eval board. Will
study later.


3) May be I need to swap by using ARMbasic to C programming. then I can easily
control every steps of I2C read/write. In fact, I see another buddy already done
by using C to read HMC6352. At present I still cannot read HMC6352 thru ARMbasic
indeed.

Brian

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: HMC6352

Post by YahooArchive »

Note that my C code for this device worked fine. So making the Basic work
should be straight forward.



Bill

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: HMC6352

Post by YahooArchive »

>from help line
>I've got an ARMmite PRO module from the German distributor 'Watterott
Electronic'. I connected an IMU via the serial port1 and was able to read out
the gyro's and accelerometer's data.
>After that I connected the magnetometer HMC6352 via the I2C to the board and
tried to read out the orientation, but the data I got aren't correct. We wrote a
C-program to test the magnetometer and the data we got by this way are ok.
>I've attached the short basic program and a zip-file including the C-program.
Can anyone of the support have a look on the problem?

This came up before, has anyone resolved it.
Last I checked, you would need to slow down the i2c access to 100Kb or below,
and you may need to allow clock stretching by the slave.
You would need to modify I2C.bas library file.

Just FYI to search for this, use google HMC6352 coridium. Unfortunately the
Yahoo Search within a group is pretty lame.

There is no easy way to link a C program into BASIC, and your C program used
general interrupts. At this point the released compiler does not support
general interrupts in BASIC, but we are testing a version that does in order to
support M3 processors.

Post Reply