Jump to content
Sign in to follow this  
SeuPay

TimerSerial Vs hardware UART Code size

Recommended Posts

Doing some experiments with an older LaunchPad (rev 1.4).

With a MSP340G2553 (hardware UART):

post-36927-135135564793_thumb.jpg

 

Commpiling a small Sketch with serial communication found that the code size generated by the compiler

is smaller using TimerSerial than the code size used for hardware UART:

 

Target Board: LaunchPad w/ msp430G2452 (16MHz)

 

Erasing...

Programming...

Done, 1358 bytes written <---- Using TimerSerial

 

Target Board: LaunchPad w/ msp430G2553 (16MHz)

 

Erasing...

Programming...

Done, 1930 bytes written <---- Using hardware UART

 

any idea?

Share this post


Link to post
Share on other sites

There is one Sketch only.

Is compiled using diferent options (target Microcontroller).

Both of them are working correctly (taking care of inverting TXD and RXD lines ).

When the target is MSP430G2452, the compiler will use TimerSerial library because there is not a UART available.

The compiler produce a more compact code when simulate the UART, a strange result in my opinion. :?:

Share this post


Link to post
Share on other sites

This is due to USCIAB0TX_VECTOR and USCIAB0RX_VECTOR being shared between UART and I2C. Unfortunately the I2C ISR code is pulled into even if you only use UART. This results in an increase in size. This will be revisited for the next release to see if this can be done in a more elegant and code size optimal way.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×