BACnet Plugfest – Milwaukee

ATmega168 running BACnetI attended the BACnet Interoperability Workshop again this year. The Plugfest was held in Milwaukee. I tested another BACnet Stack at SourceForge enabled device. This time it was an Atmel AVR ATmega168 using the GCC WinAVR compiler. It was utilizing the BACnet MS/TP datalink layer, and had a Device object and 9 Analog Input objects inside. It supported the ReadProperty service, and WhoIs and I-Am services for binding. It had a Maximum APDU size of 128 bytes.
AVR Memory Usage
Device: atmega168

Program: 16350 bytes (99.8% Full)
(.text + .data + .bootloader)

Data: 630 bytes (61.5% Full)
(.data + .bss + .noinit)

Here is the key that helped me fit the code. I found a GCC compiler and linker directive that allowed all the unused functions and dead code to be removed. I found the directive initially on the GCC M68HC11 FAQ. It saved me from having to split out all the functions into separate files and put them into a single library.

Wireshark_NPDU.pngI also met some great folks, some of whom were using the BACnet Stack at SourceForge in their products. I also saw a lot of folks using Wireshark for BACnet protocol analysis. I also got to see a lot of friends that I have made over the years.

Edit: I compiled the project with IAR AVR version 4 compiler and here are the memory usage statistics:

10 055 bytes of CODE memory (+ 36 range fill )
553 bytes of DATA memory (+ 24 absolute )

About skarg

I write software for a living. So, I dedicated some web space for some stuff that I have worked on. I mostly write embedded C for PC based controllers, but I have dabbled in a few other areas as well.
This entry was posted in BACnet. Bookmark the permalink.

3 Responses to BACnet Plugfest – Milwaukee

  1. Sergey says:

    Very intresting,slim bacnet stack version!

  2. Daine says:

    Hi, I know this is an ANCIENT post, however, I noticed that your AVR looks like it’s hooked up to live power. Is that big capacitor part of a capacitive PSU?


  3. skarg says:

    Hi Daine,

    The big cap is really a 0.001uF 1KV snubber cap that goes between shield and earth ground to help filter noise like lightning, since the shield can connect to circuit ground. I had used a older robust design from another engineer for that particular circuit. Now I just use robust RS-485 transceiver chips like LTC2850, SN65HVD12D, MAX3072E, MAX3430 with very little extra protection. The MAX3430 has ±80V Fault-Protected and ±12kV ESD Protection (and yes, it costs a lot)!

    My minimum microcontroller has gotten bigger over the years – I now start with an 64k device (since the BACnet Stack without modification will fit in 32k of flash space) – but that was a fun project to make it fit into the ATmega168.

    Best Regards,


Leave a Reply

Your email address will not be published. Required fields are marked *