Updated IAR project files for BDK port on AVR. Added main loop I/O toggle to monitor timing.

This commit is contained in:
skarg
2010-12-11 21:40:13 +00:00
parent 4ef20d370a
commit fc9be7814e
4 changed files with 65 additions and 6 deletions
+7 -1
View File
@@ -8,7 +8,7 @@ A-1b: It fits on a ATmega168 (16K bytes flash, 1024 bytes RAM) - see ports/atmeg
With full optimization, the statistics on the demo are: IAR Atmel AVR C/C++ Compiler V5.10A/W32
12 732 bytes of CODE memory (+ 36 range fill )
955 bytes of DATA memory (+ 24 absolute ) (includes CStack=0×200)
955 bytes of DATA memory (+ 24 absolute ) (includes CStack=512)
avr-gcc (GCC) 4.2.2 (WinAVR 20071221rc1)
Program: 15790 bytes (96.4% Full)
@@ -16,11 +16,17 @@ Data: 414 bytes (40.4% Full) (does not include CStack=0
A-1c: It fits easily on an ATmega644p (64K bytes flash, 4096 bytes RAM) - see ports/bdk-atxx4-mstp/ project. The BACnet Capabilities of an Application Specific Controller include WhoIs, I-Am, WhoHas, I-Have, ReadProperty, ReadPropertyMultiple, WriteProperty, and DeviceCommunicationControl support. The BACnet objects include a Device object, 2 Analog Input objects, 2 Analog Value objects, 5 Binary Input objects, and 2 Binary Output objects. Two LEDs are controlled by Binary Output objects. All required object properties can be retrieved using ReadProperty or ReadPropertyMultiple. Most of the Present_Value properties of the objects can be written. The Object_Identifier, Object_Name, Max_Info_Frames, Max_Master, and baud rate (property 9600) of the Device object can be written using WriteProperty. The APDU size is 256 bytes.
With full optimization, the statistics on this port are:
avr-gcc (GCC) 4.3.4
Program (.text+.data): 34172 bytes (52.1% Full)
Data (.data+.bss+.noinit): 2501 (61.1% Full) (not including CStack=1594 bytes)
CStack usage (from painting): 772 bytes
IAR C/C++ Compiler V5.40.2.50249/W32 for Atmel AVR
IAR Universal Linker V4.61L/W32
28 770 bytes of CODE memory (+ 8 range fill )
3 250 bytes of DATA memory (+ 44 absolute ) (includes CStack=1024)
Q-2: The homepage used to say that the MS/TP code does not work. Still true?
A-2: MS/TP works correctly as of the 0.2.6 release. I spent a several days correcting it while working on the RTOS-32 port, and then a full day fine-tuning it while working on the PIC18F6720 that I used at the 2006 BACnet International Plugfest. I also successfully used MS/TP with the 0.4.0 release at the 2007 BACnet International Plugfest on an Atmel AVR ATmega168.
+5 -5
View File
@@ -1054,7 +1054,7 @@
</option>
<option>
<name>SCCStackSize</name>
<state>0x200</state>
<state>0x400</state>
</option>
<option>
<name>SCExtCStack</name>
@@ -1240,7 +1240,7 @@
<name>CCDefines</name>
<state>NDEBUG</state>
<state>BACDL_MSTP</state>
<state>MAX_APDU=256</state>
<state>MAX_APDU=128</state>
<state>BIG_ENDIAN=0</state>
<state>MAX_TSM_TRANSACTIONS=0</state>
<state>BACAPP_BOOLEAN</state>
@@ -1357,7 +1357,7 @@
</option>
<option>
<name>CCDebugInfo</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>CCNoErrorMsg</name>
@@ -1706,7 +1706,7 @@
</option>
<option>
<name>OutputFile</name>
<state>bacnet.a90</state>
<state>bacnet.d90</state>
</option>
<option>
<name>OutputFormat</name>
@@ -1864,7 +1864,7 @@
</option>
<option>
<name>DebugInformation</name>
<state>1</state>
<state>0</state>
</option>
<option>
<name>RuntimeControl</name>
+6
View File
@@ -50,6 +50,12 @@ int main(
void)
{
init();
/* Configure the watchdog timer - Disabled for debugging */
#ifdef NDEBUG
watchdog_init(2000);
#else
watchdog_init(0);
#endif
timer_init();
adc_init();
input_init();
+47
View File
@@ -49,6 +49,52 @@ void test_init(
serial_baud_rate_set(9600);
#endif
timer_interval_start_seconds(&Test_Timer, 1);
/* configure a port pin as output */
BIT_SET(DDRB, DDB0);
}
/*************************************************************************
* Description: Turn on a pin
* Returns: none
* Notes: none
*************************************************************************/
static inline void test_pin_on(void)
{
BIT_SET(PORTB, PB0);
}
/*************************************************************************
* Description: Turn off a pin
* Returns: none
* Notes: none
*************************************************************************/
static inline void test_pin_off(void)
{
BIT_CLEAR(PORTB, PB0);
}
/*************************************************************************
* Description: Get the state of the test pin
* Returns: true if on, false if off.
* Notes: none
*************************************************************************/
static inline bool test_pin_state(void)
{
return (BIT_CHECK(PINB, PB0));
}
/*************************************************************************
* Description: Toggle the test pin
* Returns: none
* Notes: none
*************************************************************************/
static inline void test_pin_toggle(void)
{
if (test_pin_state()) {
test_pin_off();
} else {
test_pin_on();
}
}
#ifdef MSTP_MONITOR
@@ -124,5 +170,6 @@ void test_task(
serial_byte_send('\n');
serial_byte_transmit_complete();
}
test_pin_toggle();
}
#endif