68HC11

 comp.robotics.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
68HC11 Xronocruz 09-09-2006
---> Re: 68HC11 Joe Pfeiffer09-09-2006
Posted by Xronocruz on September 9, 2006, 7:17 pm
Please log in for more thread options
hi there,
im not too sure if this is the right place to ask for help for 68HC11
but i would like to ask if anyone knows how to program the PortA of the
68HC11 so tat it is able to take in inputs from a zero crossing circuit
and then be able to control a dimmer circuit?
would appreciate any help rendered..
many thanks.


Posted by Joe Pfeiffer on September 9, 2006, 10:03 pm
Please log in for more thread options

> hi there,
> im not too sure if this is the right place to ask for help for 68HC11
> but i would like to ask if anyone knows how to program the PortA of the
> 68HC11 so tat it is able to take in inputs from a zero crossing circuit
> and then be able to control a dimmer circuit?
> would appreciate any help rendered..
> many thanks.

So... what does the input from the zero-crossing circuit look like?
What does the output to the dimmer circuit look like? An HC11 is
really easy to program, but you sort of have to know what the hardware
is first....
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
New Mexico State University http://www.cs.nmsu.edu/~pfeiffer

Posted by Xronocruz on September 10, 2006, 3:29 am
Please log in for more thread options

The zero crossing circuit uses 12VAC running thru a phototransistor
CNY17-3 with a 54K resistor and a 1N4007 across pin 1 and 2 of the
CNY17-3, the other side of the CNY17-3 is connected with a series of
capacitors and resistors coupled w/ a BC547 NPN transistor where the
output from the zero crossing is tapped from the collector of the
BC547.

The dimmer circuit was constructed relatively easily since i just
followed the application notes on the optocoupler MOC3021 and used a
triac SC140, the control of the dimmer would come from Pin1 of the opto
since i've previously tested by running an output from a full bridge
rectifier connected to an LM741 generating a simulated zero crossing
however with a variable resistor acting a manual dimmer.

I understand the 68HC11 is a relatively simple MCU however, being out
of school quite a while already and trying to understand it still gives
me the headaches.




------

Joe Pfeiffer wrote:
>
> > hi there,
> > im not too sure if this is the right place to ask for help for 68HC11
> > but i would like to ask if anyone knows how to program the PortA of the
> > 68HC11 so tat it is able to take in inputs from a zero crossing circuit
> > and then be able to control a dimmer circuit?
> > would appreciate any help rendered..
> > many thanks.
>
> So... what does the input from the zero-crossing circuit look like?
> What does the output to the dimmer circuit look like? An HC11 is
> really easy to program, but you sort of have to know what the hardware
> is first....
> --
> Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
> Department of Computer Science FAX -- (505) 646-1002
> New Mexico State University http://www.cs.nmsu.edu/~pfeiffer


Posted by Mike Silva on September 10, 2006, 11:47 am
Please log in for more thread options

Xronocruz wrote:
> The zero crossing circuit uses 12VAC running thru a phototransistor
> CNY17-3 with a 54K resistor and a 1N4007 across pin 1 and 2 of the
> CNY17-3, the other side of the CNY17-3 is connected with a series of
> capacitors and resistors coupled w/ a BC547 NPN transistor where the
> output from the zero crossing is tapped from the collector of the
> BC547.
>
> The dimmer circuit was constructed relatively easily since i just
> followed the application notes on the optocoupler MOC3021 and used a
> triac SC140, the control of the dimmer would come from Pin1 of the opto
> since i've previously tested by running an output from a full bridge
> rectifier connected to an LM741 generating a simulated zero crossing
> however with a variable resistor acting a manual dimmer.
>
> I understand the 68HC11 is a relatively simple MCU however, being out
> of school quite a while already and trying to understand it still gives
> me the headaches.

The approach I would use is (a) have the zero-crossing signal trigger
an interrupt which loads a timer with the desired dimming value (that
is, the time after zero-cross at which you want to turn on the triac --
longer timing values result in greater dimming), and (b) a timer
interrupt which turns on the triac. For example, if your desired
dimming value is 5ms:

Zero-crossing interrupt:
-- Load timer with dimming value to produce 5ms delay
-- Start timer, which is configured to generate an interrupt on timeout

After 5ms, timer will generate its interrupt:
-- Turn on triac
-- Stop timer, if it doesn't stop automatically

This sequence will happen every zero-crossing, or every 8.33ms for 60Hz
AC. Outside of the interrupts, your code will be altering the dimming
value based on some form of input (user switches or potentiometer,
commands received via the serial port, etc). What you need to figure
out is how to set up the processor to generate the zero-crossing
interrupt, and how to set up a timer to generate the timeout interrupt,
and how to use an output bit to turn on the triac.

Hope this is what you were looking for.


Posted by Xronocruz on September 10, 2006, 3:35 pm
Please log in for more thread options
hello mike,

thanks for the insight,
i have written a code for the initialization from a keypad input
already and that i'm able to detect and show on a 7-seg display the
user input from the keypad. But the main problem im facing now is that
i'm unsure or probably im looking at all the wrong directions.
The following is the kind of psuedocode im following

1)Main
2)Initialize subsystems
3)Wait for user input
4)store user input
5)update register

Interrupts
1) Initialize timer with registers(register value will be taken from
the previous update above from the user input)
2) trigger diac(MOC3021)
3) return

however i've got no knowldge in programming interrupts in assembly or C
and getting it to merge 2gether with the main program, so far i've juz
been doing a lot of hard coding. would appreciate if anyone could
provide me with some links or perhaps an example code for the usage on
a 68HC11 its the setup for the input of the zero crossing and output to
the diac i'm having problems with some of the article i've read they
provide the entire code however they do not specify like to which pin
the zero crossing and the dimmer is connected to.
One such article is written by Eric
Gunnerson...http://www.nutsvolts.com/PDF_Files/light_effects.pdf#search=%22eric%20gunnerson%20dimmer%22
i do understand the theory behind it but the main application on board
the 68HC11 is what thats troubling me.



Mike Silva wrote:
> Xronocruz wrote:
> > The zero crossing circuit uses 12VAC running thru a phototransistor
> > CNY17-3 with a 54K resistor and a 1N4007 across pin 1 and 2 of the
> > CNY17-3, the other side of the CNY17-3 is connected with a series of
> > capacitors and resistors coupled w/ a BC547 NPN transistor where the
> > output from the zero crossing is tapped from the collector of the
> > BC547.
> >
> > The dimmer circuit was constructed relatively easily since i just
> > followed the application notes on the optocoupler MOC3021 and used a
> > triac SC140, the control of the dimmer would come from Pin1 of the opto
> > since i've previously tested by running an output from a full bridge
> > rectifier connected to an LM741 generating a simulated zero crossing
> > however with a variable resistor acting a manual dimmer.
> >
> > I understand the 68HC11 is a relatively simple MCU however, being out
> > of school quite a while already and trying to understand it still gives
> > me the headaches.
>
> The approach I would use is (a) have the zero-crossing signal trigger
> an interrupt which loads a timer with the desired dimming value (that
> is, the time after zero-cross at which you want to turn on the triac --
> longer timing values result in greater dimming), and (b) a timer
> interrupt which turns on the triac. For example, if your desired
> dimming value is 5ms:
>
> Zero-crossing interrupt:
> -- Load timer with dimming value to produce 5ms delay
> -- Start timer, which is configured to generate an interrupt on timeout
>
> After 5ms, timer will generate its interrupt:
> -- Turn on triac
> -- Stop timer, if it doesn't stop automatically
>
> This sequence will happen every zero-crossing, or every 8.33ms for 60Hz
> AC. Outside of the interrupts, your code will be altering the dimming
> value based on some form of input (user switches or potentiometer,
> commands received via the serial port, etc). What you need to figure
> out is how to set up the processor to generate the zero-crossing
> interrupt, and how to set up a timer to generate the timeout interrupt,
> and how to use an output bit to turn on the triac.
>
> Hope this is what you were looking for.


Similar ThreadsPosted
Imagecraft C compiler for 68HC11 December 3, 2005, 1:17 pm
Anyone Needing a 68HC11 Based Microcontroller? February 7, 2008, 2:52 pm
68HC11 and robotics books posted on abet July 23, 2005, 8:13 pm

The site map in XML format XML site map
other useful resources:
Official Robosapien Website
Lego Mindstorms Website

Contact Us | Privacy Policy