Problems writing a program for AtMega16

Hier finden sie die archivierten Beiträge des alten PHPBB Forums von www.loetstelle.net

Von masoud66 am 19.07.2010 00:46

Thanks for your help.

proteuss has no step by step simulating... Sad
i tested your code too. the same result! output doesn't change by changing input.
in the flowchart which i drawed first, when we have a input, output goes to related value and the loop between "output" and "reading input" cycles continusly ... until input change and so output change. but this action doesn't happen. output doesn't change... Crying or Very sad Sad

Von TheBug am 19.07.2010 00:52

Sounds like the simulator sucks. Can you test the code in the real thing? It should work now.

Von masoud66 am 19.07.2010 01:04

i'll try it. i put here result.
when can i see you again?

Von TheBug am 19.07.2010 10:56

I am a regular visitor of this board, some call me notorious...

Von BellaD am 21.07.2010 16:21

The code from TheBug works great Smile
But i think you have a Problem with the Makefile ( The controllertype is define there) and you forgot the defines for the MCUclock and the Includes for IO.

I Test this with AVRstudio4.18 and WINAVR .
########################################

#define F_CPU 8000000UL

#include <stdlib.h>
#include <avr/io.h>


unsigned int x;

void main ()
{

Please check your manual for your compiler.

Maybe helpfull > http://www.atmel.com/dyn/resources/prod_documents/doc2500.pdf