Jump to content
43oh

EasyMSP 1.0.0 RC1 Release Planned


Recommended Posts

  • 2 weeks later...
  • 4 weeks later...

For Example, the 5xx series code for high() is currently:

 

#pragma FUNC_CANNOT_INLINE (high);
void high(unsigned short int pin)
{
#ifdef __MSP430_HAS_PORTA_R__ 

	if(pin < 15)
	{
		#ifndef FASTIO
			PADIR |= (1 << pin);
			PASEL &= ~(1 << pin);
		#endif

		PAOUT |= (1 << pin);

		return;
	}

#endif

#ifdef __MSP430_HAS_PORTB_R__ 

	pin = pin - 16;

	if(pin < 15)
	{
		#ifndef FASTIO
			PBDIR |= (1 << pin);
			PBSEL &= ~(1 << pin);
		#endif

		PBOUT |= (1 << pin);

		return;
	}

#endif

#ifdef __MSP430_HAS_PORTC_R__

	pin = pin - 16;

	if(pin < 15)
		{
			#ifndef FASTIO
				PCDIR |= (1 << pin);
				PCSEL &= ~(1 << pin);
			#endif

			PCOUT |= (1 << pin);

			return;
		}
#endif

#ifdef __MSP430_HAS_PORTD_R__

	pin = pin - 16;

	if(pin < 15)
	{
		#ifndef FASTIO
			PDDIR |= (1 << pin);
			PDSEL &= ~(1 << pin);
		#endif

		PDOUT |= (1 << pin);

		return;
	}

#endif

#ifdef __MSP430_HAS_PORTE_R__

	pin = pin - 16;

	if(pin < 15)
	{
		#ifndef FASTIO
			PEDIR |= (1 << pin);
			PESEL &= ~(1 << pin);
		#endif

		PEOUT |= (1 << pin);

		return;
	}

#endif

#ifdef __MSP430_HAS_PORTF_R__

	pin = pin - 16;

	if(pin < 15)
	{
		#ifndef FASTIO
			PFDIR |= (1 << pin);
			PFSEL &= ~(1 << pin);
		#endif

		PFOUT |= (1 << pin);

		return;
	}

#endif

#ifdef __MSP430_HAS_PORTJ_R__

	pin = pin - 16;

	if (pin < 15)
	{
		#ifndef FASTIO
			PJDIR |= (1 << pin);
		#endif

		PJOUT |= (1 << pin);

		return;
	}

#endif

return;
}

Link to post
Share on other sites

What you're running into is what essentially stopped my work on a similar concept (a generic library of routines supporting the whole MSP430 family for consistent management of DCOs, UARTS, timers, etc; I wasn't even trying to match an existing API like Arduino). I'm not nearly as picky as some folks about the use of preprocessor conditionals, but the inter-family and inter-MCU variations are just horrendous.

 

For test430, which has to support a variety of MCUs, I ended up going with a platform-based approach (launchpad vs different types of msp430 experimenter board), the most trivial/generic solution for basic functionality, and no attempt to refactor and share code, rather than the best that could be done given the resources on a particular chip. At least for the core library: a couple demos, including the one that brings out all the internal clock signals to external pins where they can be measured, are still ifdef-hell.

 

For any non-trivial work, like some FreeRTOS-based wireless sensor applications I'd like to do, I think I'm going to pick a single platform and stick with it. (The Fraunchpad is actually pretty tempting: relatively cheap, the 5739 has stacks of timers, and there's an RF socket.)

 

For the first release of EasyMSP, it might be worth just ignoring everything but a launchpad with the standard 2231 and 2553 MCUs. Add other targets only when needed.

 

Good luck with your library.

Link to post
Share on other sites
  • 4 weeks later...
Agreed. I think most people (I mean me) would be happy to have the API just for the Launchpad.

 

I would be also, at least for a start for sure. Any word on progress? I don't want to push, I know these things are big undertakings usually in spare time, just excited. :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...