Hi everyone
I am a newbie to assembly programming and I have to write a program, one in assembly language and one in C, to blink one LED such that the LED is ON for 5/8 of a second and OFF for 3/8 of a second. The LED should blink ON and OFF ?forever.? Assuming the microcontroller is working at 2MHz, and the LED is connected to Port D. I know we are s'pposed to use like NOP's and LDAA and basic stuff, yet I am totally lost. If someone could guide me with this, that would be really helpful. (Also I need to do the same thing in C ! any help is appreciated!)
Posted on 2002-02-09 23:28:27 by dawizard

This forum is a targetted 32 bit assembler forum for Windows, not a place where other people will do your homework for you. You will need to get the info on the processor you are working with and probably a cross compiler so that you can write code for it.

If you have some specific data on the processor you are working with then perhaps some of our membere can help you but no-one is going to do it for you.

Good luck with it.

Posted on 2002-02-09 23:50:10 by hutch--
I cant say i really remember how, but i will toss out some hints:

From your brief decription, i gather your using a Motorolla 68HCxx type processor. ("LDAA", and "Port D").

So in short, you need to set up an TIMMER INTERUPT to call an ISR at a precalculated time. In the isr, every X interupts, turn the LED on (write to port D), and then every Y interupts, turn the LED OFF and reset the interupt count, such that this cycle will go on "forever".

For C, i assume you would be using an INTEL language, so you would have to do more or less the same idea, but most likely for 16 bit Intel ASM. ( Im my opinion, it will be harder to get done with intel 16 ) An online text, Art of Assembly language 16 bit, would be a good reference for the latter....

Hopefully i tossed out enought "key" words to look up. I suggest you get into a technical library and get some texts on the Chip(s) your using to get the job done. As well google searches will find "something" in motorola programming examples.

Good Luck...
Posted on 2002-02-10 01:36:27 by NaN
1stly Mr.Moderator..sorry forgot ur nick, neways I didn't really intend to have someone do my work for me, just guidance would have helped me and I guess this msg board is helpful! :) Thanks Nan for the suggestion, that did help me! And yes I am using a 6811, so I could try that out and I'll be using a TeXas Stimulator. tx once again!
Posted on 2002-02-10 02:07:36 by dawizard

sorry forgot ur nick

Never mind, some questions are forgettable as well. :grin:
Posted on 2002-02-10 03:28:47 by hutch--
Hey hutch
nothing personal, i just didn't remember your name while typing the msg! So no hard feelings. chillax
Posted on 2002-02-10 03:39:49 by dawizard
no problems there dude. :grin:


Posted on 2002-02-10 03:49:05 by hutch--