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

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

PTM - ncooper_lynntech - Dec 15 16:53:00 2004


I am trying to set up an interface with stepper motors. I need a
lot of GPIO ports (almost filling the entire MC9S12DG256). I have
looked over the PIM reference manual, the CAN reference manual, and
a few others, but cannot make ports T, S, M, P, H, and J work in the
GPIO mode. The PIM manual states that they should function as GPIO
after reset, so I imagined that all I would need to do is to set the
direction registers, and then set the ports. However, this is not
the case, and I cannot determine the cause. I am fairly new to the
HC12, after having used PIC microcontrollers, so I am behind on the
registers that are out there. Any help would be appreciated.






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


Re: PTM - Author Unknown - Dec 15 19:39:00 2004

I am trying to set up an interface with stepper motors. I need a
lot of GPIO ports
=========================
This sounds like a job for a system engineer! You need to list the
requirements before you select the components.... I'd like to know how many steppers
you want to drive and how fast, and if there are stepper controller cards or
driver cards, etc. You could get a couple of I2C stepper controller chips on
an I2C bus for example, or maybe you just need a couple of HC595s daisy
chained on the spi as an output expander. There might even be a commercial off the
shelf module that will do what you want, and we might be able to suggest one,
if we knew what it was you really needed. [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: PTM - tonalbuilder2002 - Dec 15 19:47:00 2004


I use all these ports as mostly GPIO on 2 different products and
all
I have ever needed to do was write to the data direction registers.
Do you have the correct header file for this chip? Internal
addresses vary among the different version. If you're using
assembler, are you writing 1's for outputs? Perhaps
your monitor has re-addressed these registers, or perhaps you have
inadvertantly done so.

If you're using assembler, remember that...

ldaa #255
staa DDRP
writes all ones to the DDRP, making all pins outputs, however...

ldaa 255
staa DDRP
writes the contents of memory location 255 to DDRP, resulting in some
unexpected pattern of input/output.

Anyway, would like to know how your design turns out. --- In , "ncooper_lynntech"
<ncooper_lynntech@y...> wrote:
>
> I am trying to set up an interface with stepper motors. I need a
> lot of GPIO ports (almost filling the entire MC9S12DG256). I have
> looked over the PIM reference manual, the CAN reference manual, and
> a few others, but cannot make ports T, S, M, P, H, and J work in
the
> GPIO mode. The PIM manual states that they should function as GPIO
> after reset, so I imagined that all I would need to do is to set
the
> direction registers, and then set the ports. However, this is not
> the case, and I cannot determine the cause. I am fairly new to the
> HC12, after having used PIC microcontrollers, so I am behind on the
> registers that are out there. Any help would be appreciated.





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

Re: Re: PTM - Edward Karpicz - Dec 16 0:02:00 2004

> If you're using assembler, remember that...
>
> ldd #255
> std DDRP
> writes all ones to the DDRP, making all pins outputs, however...

Writes all zeros to DDRP and 255 to RDRP :-).

Note also that PIC data direction registers are called TRISx. You write
zeros to TRISx to make pins outputs. You write ones to HC/HCS12 DDRx to make
pins outputs.

Edward > ldd 255
> std DDRP
> writes the contents of memory location 255 to DDRP, resulting in some
> unexpected pattern of input/output.
>
> Anyway, would like to know how your design turns out.
>
> Bill Tondreau
> http://www.kupercontrols.com >
> --- In , "ncooper_lynntech"
> <ncooper_lynntech@y...> wrote:
>>
>> I am trying to set up an interface with stepper motors. I need a
>> lot of GPIO ports (almost filling the entire MC9S12DG256). I have
>> looked over the PIM reference manual, the CAN reference manual, and
>> a few others, but cannot make ports T, S, M, P, H, and J work in
> the
>> GPIO mode. The PIM manual states that they should function as GPIO
>> after reset, so I imagined that all I would need to do is to set
> the
>> direction registers, and then set the ports. However, this is not
>> the case, and I cannot determine the cause. I am fairly new to the
>> HC12, after having used PIC microcontrollers, so I am behind on the
>> registers that are out there. Any help would be appreciated.





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

Re: PTM - tonalbuilder2002 - Dec 16 0:48:00 2004



> > ldd #255
> > std DDRP
> > writes all ones to the DDRP, making all pins outputs, however...

Right you are, that's exactly the same type of bug I was trying to
banish!

I noticed that literally just seconds after posting that message,
erased the original message, and reposted one with ldd #255 changed
to ldaa #255, and std changed to staa.

I immediately saw the corrected message on my listing, but I wonder
if "erasing" yahoo messages doesn't necessarily erase them for
everybody.





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

Re: Re: PTM - Edward Karpicz - Dec 16 2:44:00 2004

>> > ldd #255
>> > std DDRP
>> > writes all ones to the DDRP, making all pins outputs, however...
>
> Right you are, that's exactly the same type of bug I was trying to
> banish!
>
> I noticed that literally just seconds after posting that message,
> erased the original message, and reposted one with ldd #255 changed
> to ldaa #255, and std changed to staa.

I'm subscribed and do get all messages, even deleted. I thought you sent
same message twice and I replied to first one. Please place something at top
of revised message next time.

Edward > I immediately saw the corrected message on my listing, but I wonder
> if "erasing" yahoo messages doesn't necessarily erase them for
> everybody.




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

Re: PTM - theobee00 - Dec 16 16:55:00 2004


--- In , "tonalbuilder2002" <twentiethwave@h...> wrote:

> I immediately saw the corrected message on my listing, but I wonder
> if "erasing" yahoo messages doesn't necessarily erase them for
> everybody.

Even if you are connected on line, it seems that erasure is usually too late, the mail has flown...

Cheers,

Theo






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

Re: PTM - Jefferson Smith - Dec 16 17:35:00 2004


A good reason for deleting or editing would be for archive purpose, to
avoid people reading the error repeatedly. I just tried deleting my
error posts today and it's cool

--- In , "theobee00" <yahoodump2@o...> wrote:
>
> --- In , "tonalbuilder2002"
<twentiethwave@h...> wrote:
>
> > I immediately saw the corrected message on my listing, but I wonder
> > if "erasing" yahoo messages doesn't necessarily erase them for
> > everybody.
>
> Even if you are connected on line, it seems that erasure is usually
too late, the mail has flown...
>
> Cheers,
>
> Theo





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