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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Frank Milburn's Blog AIS Alarm - Firmware Tested, Bug Squashed
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fmilburn
  • Date Created: 18 Jun 2018 6:11 AM Date Created
  • Views 473 views
  • Likes 5 likes
  • Comments 1 comment
  • fram
  • debug
  • smartalarch
  • daisy
  • ais
  • msp430
Related
Recommended

AIS Alarm - Firmware Tested, Bug Squashed

fmilburn
fmilburn
18 Jun 2018

Project Objective: Develop an open source AIS Alarm that alerts sailors that a new marine vessel with AIS is within range

 

Project Update:

In the last post I described the hardware state and showed a photo of the new boards.  This past week I have been testing the refactored firmware and chasing a bug that caused me to get out the logic analyzer.

image

Logic Analyzer to the Rescue:

When I refactored the code one of the changes was to the ring buffer which I described in an earlier post.  This was very elegant code which I have used before but it requires the ring buffer size to be a power of 2.  Since the microcontroller being used only has 4k of FRAM I decided it would be good to have a less constrained ring buffer size and completely rewrote the code.

 

However, there was a bug that caused stored AIS messages to be lost in some instances after the first time the "replay" button was pushed.  I was pretty sure the cause was the ring buffer and spent an inordinate amount of time trying to find it.  Finally I stopped trying to fix the nonexistent problem and started tracing the signals between the alarm and the dAISy board with a logic analyzer.  To do this I separated the boards and used jumpers to a small breadboard to give access.  In addition, I soldered a 0.1" header onto the alarm PCB where I usually use pogo pins for programming so I could use the Code Composer Studio debugger to step through the code and set breakpoints.

 

Found it!  The problem was occurring during an UART RX interrupt when the dAISy was sending AIS data back during the replay and the alarm was doing a TX.  Messages passing each other in the night and the ring buffer trying to manage it...  Problems with interrupts can be tricky.  Anyway, I seem to have that fixed now.  A logic analyzer is a very valuable tool indeed...

 

The firmware now does a self test on power up which was a feature I wanted to add.  And at the moment there are no known bugs hardware or firmware :-)

 

Coming Next:

This coming week I am going to a "hacker" camp where I hope to do a project review, perform additional testing, and maybe get some thoughts from others as well as have a good time.  I also need to revisit the "User Manual", sad document that it is.  And when I get around to it, there are some minor changes to the PCBs to aid in assembly in case I make another run of the boards.

 

Past Posts from this Project:

AIS Alarm

AIS Alarm - The Process

AIS Alarm - Prototype Hardware

AIS Alarm - Timers and GPIO

AIS Alarm - Prototype Code Outline

AIS Alarm - UART

AIS Alarm - First AIS Messages

AIS Alarm - First FRAM Storage

AIS Alarm - Debouncing Momentary Button Switches

AIS Alarm - FRAM Ring Buffer

AIS Alarm - Schematic

AIS Alarm - PCB Version 0.1

AIS Alarm - PCB Version 0.1 Arrived

AIS Alarm - PCB Version 0.2

AIS Alarm - PCB Version 0.2 Populated

AIS Alarm - PCB Version 0.2 Tested

AIS Alarm - Faceplates Received

AIS Alarm - Everything Working

AIS Alarm - First Version 1.0 Hardware Assembled

  • Sign in to reply

Top Comments

  • genebren
    genebren over 7 years ago +1
    Frank, Another fine blog in your AIS Alarm story. Great work on finding and fixing you bug. Enjoy your 'Hacker' camp! Gene
  • genebren
    genebren over 7 years ago

    Frank,

     

    Another fine blog in your AIS Alarm story.  Great work on finding and fixing you bug.

    Enjoy your 'Hacker' camp!

    Gene

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • 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