element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
RoadTests & Reviews
  • Products
  • More
RoadTests & Reviews
RoadTest Forum [RoadTest] "Freescale RD3803MMA7660FC Review - Serial Communication"
  • Blogs
  • RoadTest Forum
  • Documents
  • RoadTests
  • Reviews
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join RoadTests & Reviews to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 17 replies
  • Subscribers 2566 subscribers
  • Views 1404 views
  • Users 0 members are here
  • rd3803mma7660fc
  • freescale
  • accelerometer
  • serial
Related

[RoadTest] "Freescale RD3803MMA7660FC Review - Serial Communication"

espanholito
espanholito over 15 years ago

Hello all,

 

First of all i would like to thank Alistair for giving me this opportunity to test this equipment.

 

I received my kit yesterday, and soon started exploring it.

 

As Xavier CHAZE said in the other discution(http://www.element-14.com/community/message/6561#6561), this kit is compose by three components: a freescale uC, a FTDI USB-serial chip, and the  accelerometer.

 

Also with the kit is some documentation and a cd to install a applications which allows to explore some of the features of the accelerometer, like tilt, shake, tap, and orientation detection.

 

As there are already some reviews on this kit, i decided not to talk about what others have already talk, and start to discover a bit of the kit. First i have installed the freescale application which didn't work on my windows 7 x64:(

I had to install it on a windows xp machine to work.

 

As the kit has a USB-Serial Converter, you can develop your computer applications to "talk" to the freescale uC in order to receive the sensor data. And this was what I have done, first I had to discover the communications parameteres:

 

Baudrate: 38400

Data Bits: 8

Stop Bits: 1

Parity: None

Handshake: None

 

Then, using a serial port monitor I spied the communication beetween the freescale application and the board.

 

In order to start receiving data from the board you have to send a couple of bytes:

 

Hexadecimal:

 

0x20; 0x48; 0x54; 0x31; 0x53; 0x31; 0x41; 0x41; 0x0D

0x20; 0x48; 0x54; 0x31; 0x53; 0x31; 0x41; 0x41; 0x0D

0x20; 0x73; 0x31; 0x41; 0x41; 0x0D

0x20; 0x62; 0x37; 0x41; 0x41; 0x0D

 

As you can see, all the messages start with 0x20 and end with 0x41; 0x41; 0x0D

 

From this point the uC will start to send the accelerometer data. Each message starts with 0x20; 0x43 and ends with 0x41; 0x41; 0x0D

 

Till this point i still haven't time to explore more of the kits commands, but hope to post them here soon.

 

Best Regards,

Marcos

  • Sign in to reply
  • Cancel
Parents
  • amri_amin
    amri_amin over 15 years ago

    Hello all,

     

    You'll find in attachement, a .net projet (compiles with VS2005 or Sharpdevelop) consisting of a library(reversed from freescale software) implementing the protocol communication with eval board and a demo program that autodetects port used by the board and registers to a callback outputing register values( refer to datasheet for decoding register values).

    Next step is to interface the library with a 3D game.

    Best regards

    Attachments:
    MMA7660.zip
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 15 years ago in reply to amri_amin

    Hi Amine,

     

    I have not tried your code as I have no compiler for it but when browsing through I noticed:

     

    public string setConnection(string port, string handshakeID)
            {
                Exception exception;
                SCIPort = new SerialPort();
                try
                {
                    SCIPort.PortName = port;
                    SCIPort.BaudRate = 0x9600;
                    SCIPort.DataBits = 8;
                    SCIPort.Parity = Parity.None;
                    SCIPort.StopBits = StopBits.One;
                    SCIPort.NewLine = "AA\r";
                }

     

     

    while in the documentation the rate is 38400, do you get good values with your code?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • amri_amin
    amri_amin over 15 years ago in reply to Former Member

    Hi elias,

     

    The baud rate is written in hexadecimal fomat, so 0x9600 in hexa equals 38400 in decimal.

    to compile the code, you can use the open source sharpdevelop ide with the .net framework from microsoft.

     

    BR.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 15 years ago in reply to amri_amin

    Hi Amine,

     

    That explains it image

     

    I downloaded sharpdevelop indeed but as I have a 64bit OS I got errors.

     

    Elias

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 15 years ago in reply to amri_amin

    Hi again,

     

    I changed the target CPU in sharpdevelop and got it to compile and run without errors, however I only get "Device not found." when running it.

     

     

    Elias

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • amri_amin
    amri_amin over 15 years ago in reply to Former Member

    Hi,

     

    Is your board working with freescale software?

    i attached a new version (with a combobox listing all detected serial ports), please check if the port used by the board is listed.

     

    Amine

    Attachments:
    7823.MMA7660.zip
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 15 years ago in reply to amri_amin

    Hi,

     

    The board works normally in 32bit environment and with direct serial connection.

     

    With the build you attached I get a list of the serial ports and the correct port is actually mentioned there twice for some reason.

     

    In device manager I see it only once as usual so I'm not sure what is causing the behaviour.

     

    Maybe something different registry wise in Windows 7.

     

     

    Elias

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 15 years ago in reply to amri_amin

    Hi,

     

    The board works normally in 32bit environment and with direct serial connection.

     

    With the build you attached I get a list of the serial ports and the correct port is actually mentioned there twice for some reason.

     

    In device manager I see it only once as usual so I'm not sure what is causing the behaviour.

     

    Maybe something different registry wise in Windows 7.

     

     

    Elias

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • amri_amin
    amri_amin over 15 years ago in reply to Former Member

    It seems like an issue in GetPortNames function as described here:

    http://connect.microsoft.com/VisualStudio/feedback/details/236183/system-io-ports-serialport-getportnames-error-with-bluetooth

    Here's a build with a workaround.

    Attachments:
    0743.MMA7660.zip
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 15 years ago in reply to amri_amin

    Hi,

     

    Thanks for the new build. I'm getting an exception however:

     

    System.ArgumentException: An entry with the same key already exists.
       at System.ThrowHelper.ThrowArgumentException
       at System.Collections.Generic.TreeSet<System.Collections.Generic.KeyValuePair<System.Int32,System.String>>.Add
       at System.Collections.Generic.SortedDictionary<System.Int32,System.__Canon>.Add
       at MMA7660.MPR031COM.getAvailablePorts in c:\Users\Sene\Desktop\MMA7660\MMA7660\MPR031COM.cs:line 117
       at Demo.MainForm..ctor in c:\Users\Sene\Desktop\MMA7660\Demo\MainForm.cs:line 26
       at Demo.Program.Main in c:\Users\Sene\Desktop\MMA7660\Demo\Program.cs:line 24

     

     

    The line 117 is this one: cleanPortNames.Add(int.Parse(portNumber), string.Format("COM{0}", portNumber));

     

     

     

    Thanks

     

     

    Elias

     

     

    edit: as I saw from your link the issue was related to the MS bluetooth stack so I removed my dongle and your previous build now finds the MMA.

    I still see the correct COM listed twice there though which is weird but the corrupted bt virtual com is gone and that seems to do the trick.

    I did not have any issues accessing the device itself with virtual OS or with direct serial probing so it still looks like something with this method

     

     

    edit2: I replaced the dongle to another port and it was assigned a different COM (with a different weird character) and now it seems to work normally. the latest build also works, maybe I did not remember to delete everything before replacing. I still see two times COM9 but at least I get values out

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • amri_amin
    amri_amin over 15 years ago in reply to Former Member

    hi,

    the method just lists entries in registry key : HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM

    did the com port is also listed twice in registry?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 15 years ago in reply to amri_amin

    Hi,

     

    No in the registry everything is correct so the usb to serial is listed only once and the bt serial com number is normal.

     

    Elias

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube