element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • 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
Sixth Sense Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Sixth Sense Design Challenge
  • More
  • Cancel
Sixth Sense Design Challenge
Blog R2B4 #7 - Reading the SensorTile
  • Blog
  • Forum
  • Documents
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: 14rhb
  • Date Created: 4 Mar 2019 7:43 PM Date Created
  • Views 146 views
  • Likes 7 likes
  • Comments 1 comment
  • l298
  • sixth_sense
  • r2b4
  • robot
  • stepper motors
  • nema17
  • sixth sense design challenge
Related
Recommended

R2B4 #7 - Reading the SensorTile

14rhb
14rhb
4 Mar 2019

      • 1.     Aims
      • 2.     Data From SensorTile Cradle Expansion
      • 3.     The Way Ahead is Clear(er)
        • 3.1     The STM32F411RE-Nucleo
        • 3.2     Reading the UART
        • 3.3     System Code Design
      • 4.     Things To Do
      • 5.     What For Blog #8

1.     Aims

In the last blog I formulated a plan to get the SensorTile data from the SensorTile Cradle Expansion board and out on the 'Arduino' interface pins CN 9 pins 1 and 2.

 

2.     Data From SensorTile Cradle Expansion

I thought back in R2B4 #6 - SensorTile Outputs  that I was so close to getting this to work by just bridging the solder bridges SB11 and SB20 on the SensorTile Cradle Expansion board but luckily kulky64 has been providing massive amounts of help in the suggestions of that thread - so many thanks for all that assistance. Actually I learned a lot from those comments as it pointed me into areas of the schematics to see what those solderbridges did and to understand why I was being suggested to open or close them.

 

For a while at this point it seemed I would need to disconnect the ST-LINK v2 part of the Nucleo board by opening up SB13 and SB14. I wasn't too keen to do that as I thought I would likely loose the programming ability but again kulky64 provided valuable comment that this would not be the case. Currently I have:

  • re-opened SB23/23
  • bridged SB11/20 on the SensorTile Cradle Expansion
  • bridged SB62/63 on the STM32F411RE-Nucleo board
  • opened SB13/14 on the STM32F411RE-Nucleo board

 

Getting a little dispondant I then looked again at the SensorTile cradle and what it offered. The only input/output from that was via the USB. Therefore I could program the SensotTile and solder it to the SensorTile cradle and when powered up the data would be output on the USB as previously seen...maybe I could take that data via a USB cable to the STM32F411RE Nucleo board and read it back in (swapping between the programming and the reading function cables as required during development). I'd need a USB adapter to micro but that would be all. I parked this divergent thought for a while and went back to trying to get the board working as I intended.

 

I started a new thread on getting HAL incorporated to a STM32/CubeMX project HAL Libraries - Importing and Using which might be useful to other newcomers to this area.

 

It was also suggested by kulky64 that I make a simple UART example in STM32CubeMX to test out the pins of the board. I did this and setup both UART5 and the LP_UART and added in code to output a couple of known characters 'U' and the coma symbol. I was happy to see data on the CN9-pin 2 that looked like UART data. It was changing and ocasionally seemed to burst in duration....I had doubts it was actually my data.

Modifying my code didn't seem to affect the output and finally I commented out my lines where I transmitted the characters. The data was still visible on my oscilloscope - it seemed to me that perhaps it was debug traffic on the USB/UART pins and I hadn't quite disconnected them as I had thought. I was getting ready to spend another few hours reading the datasheets and making code changes (which incidentally isn't a bad thing as I'm getting better at understanding the whole STM32 'thing' and debug, CubeMX etc) which was when another post from kulky64 came through intoHAL Libraries - Importing and Using

 

I made the changes as suggested (coupling the CN9-1/Morpho CN-10-37 to Rx on the Nucleo board, and upon debugging my code I found the PuTTY screen filling with the 'U' character.

 

I then changed my code to output a little thank you message for all that help:

3.     The Way Ahead is Clear(er)

3.1     The STM32F411RE-Nucleo

I still need to program my STM32F411RE-Nucleo board.

The aim here is to start from scratch using the STM32CubeMX package and it is to be seen if I can actually get something up and running - I'm hopeful given all the STM32/TrueStudio skills I have started t build up. Although R2B4 is a long way off I am actually really pleased - for once I am finally starting to understand these boards.

 

3.2     Reading the UART

The Nucleo code will need to read the UART stream and extract the relevant data - snipping out the various ASCII characters and casting those strings back to integers.

 

3.3     System Code Design

I also need to then write the main functions for mobility of R2B4, namely (1) a function that can turn R2B4 to align with a magnetic compass value and (2) to drive R2B4 along by a set distance that will be based on steps to the motor. The basic navigation could be via three pairs of data (angle of travel and distance to travel). The angle of travel would naturally require to work out the quickest turn to get to that bearing based on the current bearing. Once the R2B4 has worked its magic at the destination (i.e. offloaded the sand) it can easily work out the reverse route and navigate that back to the sand heap.

 

4.     Things To Do

There is lots still to do (and not much time left now):

  • R2B4 cannot actually move very well still - I need to adjust the gearing
  • I need to control the A4988 drivers from the Nucleo board
  • I need to read the UART into the Nucleo and act on those values
  • I need to design the load/unload mechanism - utilising the TE Connectivity Load Cell
  • I need to work out how to actually program R2B4 with a 'route'

 

5.     What For Blog #8

I am hoping I can at least read the SensorTile UART data into the Nucleo, and I will share that code in my next blog. Even without much additional logic I should be able to step through some simple manoeuvres and get R2B4 to navigate a course and I hope to show a video of that happening. I also should have the larger GT2 pulley arrive and so can add that to get R2B4 moving with greater traction.

 

Rod

Anonymous

Top Comments

  • franklee97
    franklee97 over 2 years ago +1

    Edit: I guess I was not supposed to plug in the expansion board on top of the Nucleo. I connected to the TX, RX pins (CN3) of Nucleo, and I'm able to see the output via COM port.

     

    Hi, I don't know if…

  • franklee97
    franklee97 over 2 years ago

    Edit: I guess I was not supposed to plug in the expansion board on top of the Nucleo. I connected to the TX, RX pins (CN3) of Nucleo, and I'm able to see the output via COM port.

     

    Hi, I don't know if you still monitor these blogs, but I have a question regarding your project.

     

    First of all, I think it's amazing the work you've accomplished. I've been working with SensorTile for about a month now, and I still haven't figured out how the Datalogger code structure is.

     

    One question: You mentioned you wrote "a simple UART example in STM32CubeMX to test out the pins of the board." You just put a byte through UART, correct? Essentially a printf.

    And when you uploaded this code, you've connected the TX(UART5) of Sensortile to TX (UART2, which is connected to USB) of Nucleo and RX of Sensortile to RX of Nucleo, correct? I think if you just plug in the Sensortile expansion board, this connection is made. So essentially you're reading Sensortile's UART5 output to COM port of your computer, which is connected to the Nucleo's UART2. Please correct me if I have made any misunderstanding.

     

    If this connection is correct, I have connected everything accordingly, but the Nucleo's COM port isn't outputting anything. After you have flashed the code on Sensortile and removed SWD cable, did you plug in the ST-LINK connectors back on the Nucleo board? Also is your Nucleo board running any code?

     

    Thank you in advance.

     

    Frank.

    • Cancel
    • Up +1 Down
    • Reply
    • More
    • Cancel
Element14

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 © 2022 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube