Shop OBEX P1 Docs P2 Docs Learn Events
Going from 5V to 3.3V...is it possible that it only "works" sometimes? [problem — Parallax Forums

Going from 5V to 3.3V...is it possible that it only "works" sometimes? [problem

bulkheadbulkhead Posts: 405
edited 2007-12-01 02:56 in Propeller 1
EDIT: see 3rd post, I seem to have found the problem
I'm having trouble getting the H48C tri-axis accelerometer working with my propeller. It works fine with my BS2. I am using the code from the prop obex so I am assuming that it should work correctly.

Here is the H48C manual: parallax.com/Portals/0/Downloads/docs/prod/acc/HitachiH48C3AxisAccelerometer.pdf
Right now I have a 1Kohm resistor on the DIO line and 470 ohm resistors on the CS and CLK lines (although if I am correct, these 470 ohm resistors are not needed at all in this case since those two pins remain as outputs).

My problem is that I do get some readings from the H48C, but it appears that some bits are missing (there are gaps in the data of powers of two, like 64, or 32). It also doesn't scale properly in different directions (it gives +1g on the other side and perhaps -.6g on the other, when it should be +/- 1g). I know this module works on the BS2, but not on my propeller, so could this be a 5V to 3.3V issue? The strange thing is that it seems to half work... I've tried testing this on two propellers and they both do the same thing. Any ideas on what could be wrong?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm new to the propeller!

Post Edited (bulkhead) : 12/1/2007 12:48:44 AM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-01 00:10
    It could be a 3.3V to 5V issue with the CLK and CS lines. Try eliminating the 470 ohm resistors. If the H48C draws enough current and is fussy enough about its input thresholds, the 470 ohm resistors might drop enough voltage to make the clock line (or the chip select line) too susceptable to noise, hence the intermittent errors.
  • bulkheadbulkhead Posts: 405
    edited 2007-12-01 00:45
    I put jumpers to bypass the resistors and connect the lines directly, but it didn't help.

    I then tried changing the clockmode to pll 8x instead of 16x (so running @40MHz) and it works now! Works for pll 4x too. It is strange because the demo program for the H48C uses pll 16x.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I'm new to the propeller!
  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-01 01:17
    You probably have noise on the control lines to the H48C and slowing things down quiets some of the noise as well. Are the wires to the H48C relatively long? I'll bet if you used short wires and/or twisted pairs (with ground wires), the higher speed will work better.
  • bulkheadbulkhead Posts: 405
    edited 2007-12-01 02:56
    I tested this on a PEK as well as on a wulfden PRC and they both did not work, but they did so consistently. There was a definite pattern in the data that was outputted (I don't think it was random noise). Unless the act of sending data creates an echo or something that would cause it to consistently misread data bits. Anyhow, I think I will just run it at 40MHz for now since I don't really need the extra speed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I'm new to the propeller!
Sign In or Register to comment.