Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC

Ads

Discussion Groups

Discussion Groups | 68HC12 | Re: Please Help...Programming Assitance Needed with Dragon12

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

Please Help...Programming Assitance Needed with Dragon12 - b_scheibe - Apr 14 16:07:59 2007

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


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )


Re: Please Help...Programming Assitance Needed with Dragon12 - Eric Engler - Apr 16 21:29:46 2007

--- In 6...@yahoogroups.com, "b_scheibe" wrote:

> What i am wanting to know is what i need to add to my Freescale
> CodeWarrior C code to cause these things to happen.

It's a good idea to pay attention in class. Surely you attended
lectures on this subject? And what about sample code or exercises?

Eric


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Please Help...Programming Assitance Needed with Dragon12 - b_scheibe - Apr 16 23:21:11 2007

I agree with you, it is a good idea to pay attention in class. That
is why in my college career i've yet to miss a class for any reason
besides a job interview. In this case that has nothing to do with
what i am working on. I'm going beyond the scope of my Mechatronics
class to add my own little 'thing' for a project req. in another
class. Since i've had practically no success in meeting up with my
professor i thought someone might be of assistance on here.
--- In 6...@yahoogroups.com, "Eric Engler" wrote:
>
> --- In 6...@yahoogroups.com, "b_scheibe" wrote:
>
> > What i am wanting to know is what i need to add to my Freescale
> > CodeWarrior C code to cause these things to happen.
>
> It's a good idea to pay attention in class. Surely you attended
> lectures on this subject? And what about sample code or exercises?
>
> Eric
>



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Please Help...Programming Assitance Needed with Dragon12 - Jefferson Smith - Apr 17 11:07:46 2007

--- In 6...@yahoogroups.com, "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.



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Re: Please Help...Programming Assitance Needed with Dragon12 - Vernon Lermond - Apr 17 11:55:08 2007

I use a ULN2803A darlington array to drive relays. The chip has surpressor diodes to absorb the energy in the relay magnetic field when it is shut off and will sink 500ma per darlington. The processor should not be used to drive relays directly as the current requirement is likely to exceed the output rating of the chip and the "spike" when the relay is shut off may damage the processor output or cause a "noise crash" - and require a reset.

Data sheet:

http://www.tranzistoare.ro/datasheets/105/366825_DS.pdf

The common (surpressor diode) is connected to the +5 rail. The relay coil is connected between the +5 rail and the chip "out" terminal. A one (+5) at the input will then energise the relay. The relay is selected to have a contact rating suitable to the heater load and for high power applications the relay might pick up a power contactor. A solid state relay can also be driven by the darlington and this method will provide optical isolation of the heater power circuit. Jameco part 481001is a triac output solid state relay rated 240V at 10 amps and it provides 4000V isolation between the AC power and your delicate 5V electronics.

----- Original Message -----
From: Jefferson Smith
To: 6...@yahoogroups.com
Sent: Tuesday, April 17, 2007 9:07 AM
Subject: [68HC12] Re: Please Help...Programming Assitance Needed with Dragon12
--- In 6...@yahoogroups.com, "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.

------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.5.1/764 - Release Date: 4/17/2007 4:43 AM
[Non-text portions of this message have been removed]


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Please Help...Programming Assitance Needed with Dragon12 - Jefferson Smith - Apr 17 13:06:07 2007

--- In 6...@yahoogroups.com, "Vernon Lermond" wrote:
> I use a ULN2803A darlington array to drive relays. The chip has
> surpressor diodes to absorb the energy in the relay magnetic field
> when it is shut off and will sink 500ma per darlington. The
> processor should not be used to drive relays directly as the current
> requirement is likely to exceed the output rating of the chip and
> the "spike" when the relay is shut off may damage the processor
> output or cause a "noise crash" - and require a reset.

In fact the Dragon12 has an "application corner" where there is a
circuit (without the parts stuffed) for a relay driven by NPN
transistor (i.e. 2N2222). It accomodates a 1K on the gate and 1N4004
to protect the silicon, but who knows whether b_scheibe is using this
circuit? It would not likely be that same relay because... how much
power might one supply to power a "heater"?



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )