View Single Post
Old 05-04-2011, 08:06 AM   #4695 (permalink)
adamj12b
Master EcoModder
 
Join Date: Apr 2009
Location: Charlton MA, USA
Posts: 463

EVVette - '71 Chevy Corvette Coupe
Thanks: 31
Thanked 183 Times in 94 Posts
Quote:
Originally Posted by Camaro View Post
I've been trying to get through this thread, but it's just to long. I've built the 500 amp controller from Paul's kit, but I can't get the source code posted on the Wiki to run.
I'm using Programmer's Notepad with AVR Dude, and Sparkfun's Pocket AVR Programmer. I can program the 168 fine, I've written my own code to test the LED, UART, and ADC. It's not a programmer or communication problem, it's something with the Paul's code (or the way my complier interprets it). I'm a fare programmer but for the life of me I can't figure this out. I've take the code from the wiki, add this:

int main(void)
{
int x;
unsigned tm_show_data;
unsigned char cmdpos, cmdok;
char cmd[32];
char str[80];

DDRD = 0b11000000;
PORTD = 0b01000000;


but the idle Led never lights up.

Has anyone else used my same setup? Any advice? Thanks guys...

PS. Is there a controller help thread where I should have posted this?
Is there a special reason you want to compile your own firmware?

If not, I suggest you just download it from my website. Index of /firmware

They are already compiled and tested. Its a full archive of all the versions of FW.

Im not sure why it wont blink the LED.

Try this out.

Code:
#include <avr/io.h>
#include <util/delay.h>
#include <avr/iom168.h>

int main (void)
{
	DDRD = 0xFF;

	while (1) {

		PORTD = 0xFF; //Set PORTD high
		_delay_ms(500);

		PORTD = 0x00; // Set PORTD low
		_delay_ms(500);
	}
	return 0;
}
-Adam
__________________
www.EVVette.com - 1971 Corvette Coupe Conversion to all Electric!
www.AdamBrunette.com - Machining, CNC, Robotics and Electronics.

You can download RTD Explorer for the Cougar controllers at www.EVVette.com
  Reply With Quote
The Following User Says Thank You to adamj12b For This Useful Post:
Camaro (05-04-2011)