--- In
68HC12@..., "b_scheibe" <b_scheibe@...> wrote:
> I am very new to programming/HC12 so please bare with me. The code i
> am currently dealing with is something my professor made available
> so that i can modify it. I am trying to run a heater using the
> Dragon 12 with a relay hooked up between the two. I already have a
> thermistor set up on the board with temperature being displayed to
> the LCD. I am wanting the heater to turn on when the temp is below
> 270 and turn off when the temp is above 280. I currently have the
> relay hooked up to PB2 and ground. This is where my programming
> knowledge ends. I am assuming it is just a matter of turning the
> relay either high or low according to my previously mentioned
> criteria. What i am wanting to know is what i need to add to my
> Freescale CodeWarrior C code to cause these things to happen. If
> there is any other information you need, let me know. Thanks for
> your help.
>
> -Bryan
Well, Dragon12 is so far the best setup for my projects (and just
keeps getting better), but I see that you need more info about the
hardware you are interfacing with, and how it looks inside the MCU.
Actually from what you've said so far, you did not even indicate that
you know what "if/else" means in C. There's no way we could tell you
*everything* you need to know, so let us know in more detail, what you
have. If your professor just gave you source code to get you started,
I suppose a sort of framework, have you even figured out what *that*
does? We certainly cannot guess what the code does so far.
Do you have the relay coil directly connected to the MCU pin? will
that cause a problem? How much current can the pin drive? Will counter
EMF burn out the MCU? Has all this been already tested by someone with
the same hardware? All this research will help you, but has nothing
really to do with this 68HC12 group unless you have specific questions
about what it says in spec sheets for the MC9S12DP256 or DP512.
Also, you would need to know how to read in a variable that represents
a temperature from your sensor. Maybe you know that number is not
necessarily '270' when the actual temperature is 270 degrees (F? C?
K?). Well I suppose you already can get the actual temperature value
because you say it is displayed on the LCD, but sure will hepl if you
can read the code and know how it does it.