YAPP(u) - AIS plotter goes ARMish

AngusMcDoon

Well-Known Member
Joined
20 Oct 2004
Messages
9,045
Location
Up some Hebridean loch
Visit site
Yet Another Pontless Project (upgrade)

Previously, the YAPP AIS plotter was running on a 18F PIC processor, here. Now this all worked in a PIC sort of way, but it was pushing the boundaries of PICness, especially all the floating point geometry and driving the QVGA display. I was also getting scoffed at by the big important people here for using a feeble boy's processor. So now I have pushed myself through the initial ARM pain barrier, and here is the first YAPP running on an STM32F100 ARM M3 Cortex jobbie...

SDC11322.jpg


The processor board is an STM32VL-Discovery from ST. It's sold by Farnell for about a tenner and includes an ST-Link JTAG on the board, so no extra hardware needed to flash and debug. All the development environment is legally free. I use the CooCox IDE and the free GNU ARM compiler. I did try using plain vanilla Eclipse, the Code Sourcery compiler, and OpenOCD for debugging. That all worked too eventually, but was especially painful to get going.

<geekspeak>
Porting the code was the normal world of grief, as porting embedded code always is. One particular gotcha that held me up was plain 'char' on the PIC compiler is signed, but on the ARM compiler it is unsigned. This is because, as I found out, the C standard does not specify the signedness of plain chars. I ended up comparing what I thought were 2 signed chars, but in fact were signed/unsigned, the optimiser said 'that will always be false' and took a chunck of code out. Consequently I was dereferencing memory that didn't exist which gave an immediate hard fault with no call stack.
</geekspeak>

Now so far, it does just the same as the previous PIC based version, so it's not a new YAPP, just a YAPP(u) upgrade...

SDC11323.jpg


I still have code and memory space left over out of my 128k/8k. I have got the SD card interface working and I can write to a FAT32 file system on the card. I thought about writing AIS details of everything that goes past, so later back in the office in the dark days of winter you can replay your voyages at high speed and remember those sunny summer days of June 2012.

A final reason for moving YAPPs to ARM is that I get lots of people who say they would like to have a go but don't want to do all the spaghetti wiring. Now from the first picture it can be seen that there is still alot of wiring up to do - that display card has 40 connections. But now I have it running on an STM32, it should not be too difficult to port it to my next hardware platform, which is a pre-built STM32 board with lots of integrated goodies, including the display, serial line drivers, USB, beepers, SD card reader etc. Here's one I have just bought...

SDC11328.jpg


These cost £28, and can be flashed with nothing more than a USB cable and some free software from ST. Dedicated followers of YAPP will then be able to have their own pointless devices with no fiddly wiring at all.

Sauce code (at the moment working on the STM32VL-Discovery board) to anyone who wants it. PM me an email address. I've not done a schematic for this one yet, but I'll knock up something if anyone wants it.
 
Yet Another Pontless Project (upgrade)

Previously, the YAPP AIS plotter was running on a 18F PIC processor, here. Now this all worked in a PIC sort of way, but it was pushing the boundaries of PICness, especially all the floating point geometry and driving the QVGA display. I was also getting scoffed at by the big important people here for using a feeble boy's processor. So now I have pushed myself through the initial ARM pain barrier, and here is the first YAPP running on an STM32F100 ARM M3 Cortex jobbie...

SDC11322.jpg


The processor board is an STM32VL-Discovery from ST. It's sold by Farnell for about a tenner and includes an ST-Link JTAG on the board, so no extra hardware needed to flash and debug. All the development environment is legally free. I use the CooCox IDE and the free GNU ARM compiler. I did try using plain vanilla Eclipse, the Code Sourcery compiler, and OpenOCD for debugging. That all worked too eventually, but was especially painful to get going.

<geekspeak>
Porting the code was the normal world of grief, as porting embedded code always is. One particular gotcha that held me up was plain 'char' on the PIC compiler is signed, but on the ARM compiler it is unsigned. This is because, as I found out, the C standard does not specify the signedness of plain chars. I ended up comparing what I thought were 2 signed chars, but in fact were signed/unsigned, the optimiser said 'that will always be false' and took a chunck of code out. Consequently I was dereferencing memory that didn't exist which gave an immediate hard fault with no call stack.
</geekspeak>

Now so far, it does just the same as the previous PIC based version, so it's not a new YAPP, just a YAPP(u) upgrade...

SDC11323.jpg


I still have code and memory space left over out of my 128k/8k. I have got the SD card interface working and I can write to a FAT32 file system on the card. I thought about writing AIS details of everything that goes past, so later back in the office in the dark days of winter you can replay your voyages at high speed and remember those sunny summer days of June 2012.

A final reason for moving YAPPs to ARM is that I get lots of people who say they would like to have a go but don't want to do all the spaghetti wiring. Now from the first picture it can be seen that there is still alot of wiring up to do - that display card has 40 connections. But now I have it running on an STM32, it should not be too difficult to port it to my next hardware platform, which is a pre-built STM32 board with lots of integrated goodies, including the display, serial line drivers, USB, beepers, SD card reader etc. Here's one I have just bought...

SDC11328.jpg


These cost £28, and can be flashed with nothing more than a USB cable and some free software from ST. Dedicated followers of YAPP will then be able to have their own pointless devices with no fiddly wiring at all.

Sauce code (at the moment working on the STM32VL-Discovery board) to anyone who wants it. PM me an email address. I've not done a schematic for this one yet, but I'll knock up something if anyone wants it.

Is the arm able to achieve the same refresh rate for the display?
 
What's the source & part number for the new platform with the display etc.

Looks like something I could use for a project I've been thinking of for a while.
 
Is the arm able to achieve the same refresh rate for the display?

The PIC18F26K22 runs at 64 MHz, but takes 4 clocks per instruction.
The STM32F100RB runs at 28 MHz, but does most instructions in a single cycle.

The ARM refreshes faster, but not hugely. The next hardware board I showed runs at 48 MHz and also has a module that can drive the display in h/w on the chip, so should be much faster.
 
If you are using ARM, then have you thought about using an android phone? There are a number of Huawei phones available for around £60, some even less. Do you have to use serial? Can you get bluetooth AIS modules? If you were to port this to android, you could make a lot of money...

Well its a smallish market but you could make SOME money :D

I'm new to this nautical game so i'm not really up to speed on the whole AIS tech front.
 
Here is the promised update. It's a YAPPery first - no brown wires. The hardware in this case is bought pre-built. The board including the display costs £28.

SDC11336.jpg


It's basically the same as before with the addition of an audible CPA/TCPA alarm as this board has a beeper.

This is the easiest YAPP to date for anyone to have a play with. You buy the board, get my software ready to go (no compilation required), download an app from the chip manufacturer (ST) for writing the software on the board (all you need is a bog standard USB cable), connect it up to your AIS engine, and off you go.

This YAPP needs GPS data multiplexed with the AIS stream, but my VHF does that and I think other VHFs and AIS engines do it too.

If anyone is interested, send me a PM with your email address and I'll send you instructions on what to do. Sauce code as well if anyone wants to see how it's done or have a play with it.
 
Last edited:
Top