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 | 10-Bit ATD -- ATDDR0

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

10-Bit ATD -- ATDDR0 - "matthias.hildebrand" - Feb 9 15:09:44 2008

Hey all,

I have a question concernig the 10-bit ATD conversion.
Until today I used the 8-bit conversion without having problems. For a
higher accuracy I want to use the 10 bit conversion now. I had a look
on the registers. The data is stored right justified and unsigned. Is
the only difference setting the SREM bit to low?
How can I convert the value? Before I stored the low register
(ATD0DR0L) as an integer value. Can I just add the to
registers(ATD0DR0L+ATD0DR0H) up and store it as an interger? Or do I
have to multiply the high register with 256(ATD0DR0L+ATD0DR0H*256)?

Thanks for your help
Cheers
Matthias



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


Re: 10-Bit ATD -- ATDDR0 - Petrescu - Feb 11 2:38:33 2008

Hi,
If you define:
#define _IO_BASE 0
#define _LP(off) *(unsigned short volatile *)(_IO_BASE + off)
#define ATD0DR0 _LP(0x90)
then you can read a 16bit word at once, as the result of 10 bit conversion.
No further calculations needed.
Regards,
Ioan

matthias.hildebrand wrote:
>
> Hey all,
>
> I have a question concernig the 10-bit ATD conversion.
> Until today I used the 8-bit conversion without having problems. For a
> higher accuracy I want to use the 10 bit conversion now. I had a look
> on the registers. The data is stored right justified and unsigned. Is
> the only difference setting the SREM bit to low?
> How can I convert the value? Before I stored the low register
> (ATD0DR0L) as an integer value. Can I just add the to
> registers(ATD0DR0L+ATD0DR0H) up and store it as an interger? Or do I
> have to multiply the high register with 256(ATD0DR0L+ATD0DR0H*256)?
>
> Thanks for your help
> Cheers
> Matthias
>
>



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

Re: 10-Bit ATD -- ATDDR0 - "matthias.hildebrand" - Feb 25 10:30:41 2008

Thanks a lot. It works very well!
--- In 6...@yahoogroups.com, Petrescu wrote:
>
> Hi,
> If you define:
> #define _IO_BASE 0
> #define _LP(off) *(unsigned short volatile *)(_IO_BASE + off)
> #define ATD0DR0 _LP(0x90)
> then you can read a 16bit word at once, as the result of 10 bit
conversion.
> No further calculations needed.
> Regards,
> Ioan
>
> matthias.hildebrand wrote:
> >
> > Hey all,
> >
> > I have a question concernig the 10-bit ATD conversion.
> > Until today I used the 8-bit conversion without having problems. For a
> > higher accuracy I want to use the 10 bit conversion now. I had a look
> > on the registers. The data is stored right justified and unsigned. Is
> > the only difference setting the SREM bit to low?
> > How can I convert the value? Before I stored the low register
> > (ATD0DR0L) as an integer value. Can I just add the to
> > registers(ATD0DR0L+ATD0DR0H) up and store it as an interger? Or do I
> > have to multiply the high register with 256(ATD0DR0L+ATD0DR0H*256)?
> >
> > Thanks for your help
> > Cheers
> > Matthias
> >
>



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