Software/ Host Apps

lwIP TCP Server on LM3S8962

This TCP server is setup for Stellaris series (LM3S8962) from TI. The TCP/IP stack is lwIP shipped with enet_io app in StellarisWare.

tcp port connectivity test

First create and add a C file “tcp_server.c” at “..\StellarisWare\third_party\lwip-1.3.2\apps\tcpserver” folder. Include the prototype in enet_io.c file.

//*****************************************************************************
//
// External Application references.
//
//*****************************************************************************
extern void httpd_init(void);
extern void tcp_server_init(void);

In the main function, call the tcp_server_init() function.
(continue reading…)

Share

Solar Power Calculator

solar power calculatorOften we need to calculate the power ratings of different components in a solar power systems. This may include the battery rating, solar charger rating, number of panels and their ratings. It all depends upon the output load, charging time and resources available. Attached is a very simple excel sheet which helps to calculate these parameters. Just change the parameters on left to see the reflected output calculations on right.

Download Files:

Share

Writing Better Embedded Firmware

Co-operative multitasking I think this is the most simple, organized and suitable way to write code for real-time embedded systems. This is simple state machine based model which responds well in real-time. In this case I am using PIC32MX340F512L MCU, you can adopt this code for your favorite microcontroller.

First we write a simple main function where other functions will be called:

// main.c file
// add pic32 lib
#include
 
// prototype the functions
void blinky_init(void);
void blinky(void);
void button_init(void);
void button(void);
 
int main (void)
{
	// initialize the apps
	blinky_init();
	button_init();
	// ....
 
	// run the app(s)
	while (1)
	{
		blinky();
		button();
		// ....
	}
}

In above code snippet we have added processor related libraries, declared the prototypes of the functions which we are going to use and then started the main function. In the main function, we have first initialized the peripherals which we are going to use. In this case only two types, an LED and a push button. The main operations of the peripherals are handled in the blinky(); and button(); functions. Now we look at these functions: (continue reading…)

Share


  • Follow

  • Just a Moment Please

    Did you find what you were looking for on this website?






  • Disclaimer

    The information on this website is based on my personal views which may differ from my employer(s). The free material here to download is the work I have done in my free time and, though may seem resembling, does not belong to my current or previous employer(s). It is solely my own intellectual property.
  • Copyright © Electrodesigns.net 2011-12
    iDream theme by Templates Next | Powered by WordPress