Board index › Products › MICrODEC › Software

First C Software

3 posts · 7358 views

First C Software

by mcanulty » Sun Sep 19, 2010 01:27 UTC
I'm uploading my first C software so people can start experimenting with writing their own functions. So far I've only implemented writing the first 16 bits of the SRAM, that can be easily improved. There's a delay function, an area for processing inputs to scale values, a switch case function for determining which audio program to use in the interrupt and other goodies including serial communication protocols which aid debugging to no end.

There's an AVR Studio with AVR-GCC project file here:
AVRStudio_MICrODEC_09172010.zip (76.0 KiB)
AVR Studio project - zip file

and an X-Code with AVR Crosspack project file here:
Xcode_MICrODEC_C_09172010.zip (195.4 KiB)
X-Code Project with AVR Crosspack - zip file

Re: First C Software

by mcanulty » Mon Sep 20, 2010 03:10 UTC
I have 18b address functions implemented now, and tested them with the delay. Not releasing them right away because I haven't decided if they need some more optimization in the long run, but if you'd like to get started with 18b let me know.

Re: First C Software

by mcanulty » Fri Oct 01, 2010 13:03 UTC
psyched to say that tomorrow I will upload code that allows you to write audio functions with nice clear syntax like this:
void updownsweepPot18b(void)
{    
	updateAudioInAudioOut();  //most efficient packing
	
	if (direction == 1)
	{
		decreaseReadOffsetBy(2); 

		if(atTopOfBuffer())	
		{
			readOffsetLSB = 0x04;
			direction = 0;	
		}
	}
	else
	{
 		increaseReadOffsetBy(4);

		if(atBottomOfBuffer()) //tests for exceeding Buffer Size
		{
			decreaseReadOffsetBy(2);
			direction = 1;
		}
	}
	
	calculateReadAddressFromOffset();
	
	if (ADCValueChanged )
	{
		calculateBufferSizeFromADC();
		ADCValueChanged = 0x00;	
	}

	//*****************
	// mod2 check here
	//*****************
	mod2Check();
	
}