Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Object: Hitachi H48C Tri-Axis Accelerometer Module — Parallax Forums

Propeller Object: Hitachi H48C Tri-Axis Accelerometer Module

Beau SchwabeBeau Schwabe Posts: 6,560
edited 2007-03-16 17:01 in Propeller 1
Here is a DEMO object using the Hitachi H48C Tri-Axis Accelerometer Module.

The 3D graphics engine still needs a little work, but all in good time.

This might actually work well with a compass module also.

attachment.php?attachmentid=43187

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe

IC Layout Engineer
Parallax, Inc.

Post Edited (Beau Schwabe (Parallax)) : 9/13/2006 10:44:26 PM GMT

Comments

  • simonlsimonl Posts: 866
    edited 2006-09-14 12:48
    Beau,

    Wow! I'll never cease to be amazed at what this PChip (and a guru programmer) can achieve smile.gif

    Any chance you would give me some pointers on how to achieve the same with·two MEMSIC 2125s?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon

    Post Edited (simonl) : 9/14/2006 4:51:32 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2006-09-14 18:23
    simonl,

    It's really just a matter of plugging in the deg values for X,Y, and Z

    With the MEMSIC 2125 your only going to have one Deg value that can be substituted into either/or/and the X,Y,Z parameters.

    See this link below...

    http://forums.parallax.com/showthread.php?p=605385

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Bryan K.Bryan K. Posts: 47
    edited 2007-03-15 06:52
    Beau,
    I have tried the H48C cube program that you created, but the cube is stationary on the screen. The graphics to the TV work well, I think the problem is with the accelerometer. Any ideas on how to fix it?
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2007-03-15 07:19
    Is the pin configuration of your accelerometer correct? Sometimes it's hard to tell...

    There should be a white dot on the PCB board (upper left) denoting pin 1 ... if you go by the dot on the chip itself (lower right) is closest to pin 3

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Bryan K.Bryan K. Posts: 47
    edited 2007-03-16 06:24
    Beau,
    I checked and rechecked the pin configuration. Still no luck. I also checked to see if it was the accelerometer itself, but it works flawlessly with a BASIC STAMP. In the DEMO program, I also tried to change the pins, making them easier to get to using jumper wires, but no luck as well. There is an output to the tv, it will display the cube, but the cube does not move when the accelerometer is moved. I also tried other accelerometer programs, mainly this one: http://forums.parallax.com/forums/attach.aspx?a=8945, which is the .sensor.hitachi.h48c.diagnostic and the accelerometer will not communicate with the prop. (I placed an LED in parallel with the clock pin, so I could visually see if the prop was communicating, but nothing)


    Bryan
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2007-03-16 15:21
    Bryan,

    The ".sensor.hitachi.h48c.diagnostic" from this point (http://forums.parallax.com/showthread.php?p=602451) in the thread was not working according to 'tyrebiter'.
    If you look further down, the code that 'tyrebiter' posted that works is here (http://forums.parallax.com/showthread.php?p=605174).

    You are supplying the accelerometer with 5V on pin 6 of the accelerometer correct? ...and the VSS connections are shared between Prop and accelerometer right?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Bryan K.Bryan K. Posts: 47
    edited 2007-03-16 16:29
    Beau,
    I have also tried that program. I wired an LED up to the clock pin, to see if there would be any signal, and there appears to be no clock signal going to the accelerometer. Do you have any other suggestions?

    Bryan
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2007-03-16 17:01
    First try to the blink the LED on the pins you are using...

    Use a 220 Ohm resistor in series with your LED from the Propeller I/O to VSS

    [b]CON[/b]
    
      [b]_CLKMODE[/b] = [b]XTAL[/b]1 + [b]PLL[/b]16X
      [b]_XINFREQ[/b] = 5_000_000
    
    
      LEDpin = 1  <- adjust this to a different pin
    
    [b]PUB[/b] Toggle
        [b]dira[/b][noparse][[/noparse]LEDpin&#093;~~
        [b]repeat[/b]
          ![b]outa[/b][noparse][[/noparse]LEDpin&#093;
          [b]waitcnt[/b](3_000_000 + [b]cnt[/b])
    
    
    




    Then try another set of pins on the Propeller and ajust your code accordingly

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.