Register Access
"Christian Gieseler" <[email protected]>
| Newsgroups | gmane.linux.uclinux.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all!
We have to activate dithering in our Coldfire 5329 device. But it seams,
that I cant even read the register values of PLL Control Register (PCR) and
PLL Modulation Divider Register (PMDR). The registers should be user
readable and writable. But it seems that I get a bus error because the
values do not match the written ones or the reset values if I don´t write
something.
#define GT_REG_READ_SHORT(Reg, pData)
\
*pData = ((volatile unsigned short)*((unsigned short *) (Reg)));
#define GT_REG_WRITE(Reg, data) \
(*(volatile unsigned long *)(Reg)) =data
#define PLL_PODR 0xFC0C0000
#define PLL_PLLCR 0xFC0C0004
#define PLL_PMDR 0xFC0C0008
int main(int argc, char *argv[])
{
unsigned int RegVal=0;
//GT_REG_WRITE(MCF_PLL_PLLCR,0x0);
GT_REG_WRITE (PLL_PLLCR ,0);
GT_REG_WRITE (PLL_PMDR ,0x5);
//Setze PLL Control Register
GT_REG_WRITE (PLL_PLLCR ,0x87);
GT_REG_READ_SHORT (PLL_PLLCR,(unsigned int*)&RegVal);
printf ("PLLCR has Value=%x\n",RegVal);
return 0;
}
Does someone have a hint how to write and read these registers? Is something
wrong in my code?
Best regards
Christian
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev