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

See Also

DSPFPGAElectronics

Discussion Groups | 68HC12 | Xgate CPU and memory

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

Xgate CPU and memory - Pascal - Jan 3 4:23:47 2007

Hello,

I would like to understand how the access ram works. For example, the Xgate write the variable test (test=0x50). At the same time the CPU read the variable test (if test==0x40 .)

What happens? Could this operation take place?

Thank you for help

Regards

[Non-text portions of this message have been removed]
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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


Re: Xgate CPU and memory - Jefferson Smith - Jan 3 16:11:45 2007

--- In 6...@yahoogroups.com, "Pascal" wrote:
> I would like to understand how the access ram works. For example,
> the Xgate write the variable test (test=0x50). At the same time the
> CPU read the variable test (if test==0x40 .)
> What happens? Could this operation take place?

Good Q. AFAIK, they cannot access at *exactly* the same time because
they use have a time share of the bus. I think they function out of
sync so that one part of the bus cycle is for XGate, and another part
for S12X access.



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

Re: Re: Xgate CPU and memory - Daniel Friederich - Jan 4 5:56:00 2007

The accesses are serialized and therefore any order may happen. So the
XGATE may read the old value, the new one, or if HC12 needs several
accesses to update the variable (read modify write accesses, longs,
several variables) anything in between too.
The HC12 access to the RAM actually has a higher priority than the
XGATE, the XGATE will wait one additional cycle.

Note that there are special synchronization semaphores supported to
protect concurrent accesses like this, the XGATE has special assembly
instructions for it and the HC12 accesses those semaphores via memory
mapped registers.
Anyway, concurrent access problems are not new with the XGATE, they can
happen with interrupts on the HC12 on its own, especially as the HCS12X
has multiple interrupt levels.

Daniel

Jefferson Smith wrote:
> --- In 6...@yahoogroups.com, "Pascal" wrote:
>
>> I would like to understand how the access ram works. For example,
>> the Xgate write the variable test (test=0x50). At the same time the
>> CPU read the variable test (if test==0x40 .)
>> What happens? Could this operation take place?
>>
>
> Good Q. AFAIK, they cannot access at *exactly* the same time because
> they use have a time share of the bus. I think they function out of
> sync so that one part of the bus cycle is for XGate, and another part
> for S12X access.
>
> Yahoo! Groups Links
>
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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

Re: Xgate CPU and memory - Jefferson Smith - Jan 10 10:17:42 2007

--- In 6...@yahoogroups.com, Daniel Friederich wrote:
>
> The accesses are serialized and therefore any order may happen.

Thanks Daniel, could you refer us to a good document on the
fundamentals of the bus sharing?



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

Re: Re: Xgate CPU and memory - Daniel Friederich - Jan 10 14:54:58 2007

Did you check the data sheet for your device?
(for a XDP512, for example
http://www.freescale.com/files/microcontrollers/doc/data_sheet/MC9S12XDP512V2.pdf)

The chapter "17.4.4 Chip Bus Control" lists the priorities the different
bus masters have.
Not sure if it is what you look out for.

Daniel

Jefferson Smith wrote:
> --- In 6...@yahoogroups.com, Daniel Friederich wrote:
>
>> The accesses are serialized and therefore any order may happen.
>>
>
> Thanks Daniel, could you refer us to a good document on the
> fundamentals of the bus sharing?
>
>


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

Question SD CARD - Victor Adrian Prisacariu - Jan 11 5:02:14 2007

Hello.

I have a question. I've been trying to connect an sd card to a hcs12x MCU.
The card does initialize , but i can not get a data token when i try to
read. Does anyone have any ideas how to solve this? (the card worked fine on
another MCU).

Thanks,

Victor

[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: Question SD CARD - Peter Lissenburg - Jan 11 5:27:47 2007

When you say it initialized, have you read the CID or CSD, and it fails reading
a sector?
P

Victor Adrian Prisacariu wrote:
> Hello.
>
> I have a question. I've been trying to connect an sd card to a hcs12x MCU.
> The card does initialize , but i can not get a data token when i try to
> read. Does anyone have any ideas how to solve this? (the card worked fine on
> another MCU).
>
> Thanks,
>
> Victor
>
> [Non-text portions of this message have been removed]
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.16.9/622 - Release Date: 1/10/2007 2:52 PM



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

RE: Question SD CARD - Victor Adrian Prisacariu - Jan 11 5:37:51 2007

Yes. That is the problem.

From: 6...@yahoogroups.com [mailto:6...@yahoogroups.com] On Behalf Of
Peter Lissenburg
Sent: 11 ianuarie 2007 12:10
To: 6...@yahoogroups.com
Subject: Re: [68HC12] Question SD CARD

When you say it initialized, have you read the CID or CSD, and it fails
reading
a sector?
P

Victor Adrian Prisacariu wrote:
> Hello.
>
> I have a question. I've been trying to connect an sd card to a hcs12x MCU.
> The card does initialize , but i can not get a data token when i try to
> read. Does anyone have any ideas how to solve this? (the card worked fine
on
> another MCU).
>
> Thanks,
>
> Victor
>
> [Non-text portions of this message have been removed]
> ----------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.16.9/622 - Release Date: 1/10/2007
2:52 PM

[Non-text portions of this message have been removed]
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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

Re: Question SD CARD - Peter Lissenburg - Jan 11 7:14:39 2007

I have not worked on this for a while, but I will be soon. From memory, I did
find some cards that would work OK in a PC card reader, and yet behave this way
in SPI mode. My explanation at the time was that some manufacturers did not
implement the SPI mode (it was some years ago). But I doubt that is the case now.
Looking at my code, I send the "READ_SINGLE_BLOCK" and an address, with 0xff as
the dummy CRC.
Then poll the SPI port for a non 0xff response. If the non 0xff response is
0x00, then the code continues to poll waiting for the 0xfe.
Once this arrives, the data is read out in a loop.
By poll, I mean sending a dummy character, (0xff) and checking the character
returned, continuously (with a time out).
What part of this procedure is not working for you?
Or is my process different to your?
Pete

Victor Adrian Prisacariu wrote:
> Yes. That is the problem.
>
> From: 6...@yahoogroups.com
> [mailto:6...@yahoogroups.com ] On
> Behalf Of
> Peter Lissenburg
> Sent: 11 ianuarie 2007 12:10
> To: 6...@yahoogroups.com
> Subject: Re: [68HC12] Question SD CARD
>
> When you say it initialized, have you read the CID or CSD, and it fails
> reading
> a sector?
> P
>
> Victor Adrian Prisacariu wrote:
> >
> >
> > Hello.
> >
> > I have a question. I've been trying to connect an sd card to a hcs12x
> MCU.
> > The card does initialize , but i can not get a data token when i try to
> > read. Does anyone have any ideas how to solve this? (the card worked fine
> on
> > another MCU).
> >
> > Thanks,
> >
> > Victor
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> > ----------------------------------------------------------
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.432 / Virus Database: 268.16.9/622 - Release Date: 1/10/2007
> 2:52 PM
>
> [Non-text portions of this message have been removed]
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.16.9/622 - Release Date: 1/10/2007 2:52 PM



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

RE: Question SD CARD - Victor Adrian Prisacariu - Jan 11 7:29:59 2007

I am pooling (sending 0xFF) till I get 0x00 and then till i get 0xFE. The
problem is that 0xFE doesn't arrive. And the same card worked perfectly with
a different MCU (PIC). Also the same software (I changed only the SPI
functions (lowest level)).

Could it be because I'm not using SPI correctly ? I use rising edge, MSD
first, 333kHz (for initialization) and 4Mhz after that. Also the function
for reading SPI is:

SPI1DR = myData;

While ((SPI1SR & 128)==0) {}

Return SP1DR;

Is this the correct way of using this card on a hcs12x ?

Of course to initialize it I by sending ~80 SCLK then CMD0_GO_IDLE_STATE,
CMD1_SEND_OP_COND and finally CMD16_SET_BLOCKLEN. All these work perfectly.

And to read one card sector I use:

BOOL CardReadSector(DWORD sectorNr)

{

WORD i;

SectorInBuffer = sectorNr; //using this for buffering (to
increase FAT operation speed)

sectorNr <<= 9;

convert.dword = sectorNr;

CardCommand(CMD17_READ_SINGLE_BLOCK,convert.byte[3],convert.byte[2],convert.
byte[1],convert.byte[0],0xFF);

if (CardResponse(0x00) == FALSE)

return FALSE;

if (CardResponse(0xFE) == FALSE)

return FALSE; //<- DOES NOT GET PAST THIS

for (i=0;i<512;i++)

Sector[i] = SPI(0xFF);

//no need for CRC

SPI(0xFF);

SPI(0xFF);

return TRUE;

}

BYTE CardResponse(BYTE response)

{

WORD count = 0xFFFF;

while(SPI(0xFF) != response && --count > 0);

if (count==0)

return FALSE;

else

return TRUE;

}

Victor

From: 6...@yahoogroups.com [mailto:6...@yahoogroups.com] On Behalf Of
Peter Lissenburg
Sent: 11 ianuarie 2007 13:01
To: 6...@yahoogroups.com
Subject: Re: [68HC12] Question SD CARD

I have not worked on this for a while, but I will be soon. From memory, I
did
find some cards that would work OK in a PC card reader, and yet behave this
way
in SPI mode. My explanation at the time was that some manufacturers did not
implement the SPI mode (it was some years ago). But I doubt that is the case
now.
Looking at my code, I send the "READ_SINGLE_BLOCK" and an address, with 0xff
as
the dummy CRC.
Then poll the SPI port for a non 0xff response. If the non 0xff response is
0x00, then the code continues to poll waiting for the 0xfe.
Once this arrives, the data is read out in a loop.
By poll, I mean sending a dummy character, (0xff) and checking the character

returned, continuously (with a time out).
What part of this procedure is not working for you?
Or is my process different to your?
Pete

Victor Adrian Prisacariu wrote:
> Yes. That is the problem.
>
> From: 6...@yahoogroups.com

> [mailto:6...@yahoogroups.com
] On
> Behalf Of
> Peter Lissenburg
> Sent: 11 ianuarie 2007 12:10
> To: 6...@yahoogroups.com

> Subject: Re: [68HC12] Question SD CARD
>
> When you say it initialized, have you read the CID or CSD, and it fails
> reading
> a sector?
> P
>
> Victor Adrian Prisacariu wrote:
> >
> >
> > Hello.
> >
> > I have a question. I've been trying to connect an sd card to a hcs12x
> MCU.
> > The card does initialize , but i can not get a data token when i try to
> > read. Does anyone have any ideas how to solve this? (the card worked
fine
> on
> > another MCU).
> >
> > Thanks,
> >
> > Victor
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> > ----------------------------------------------------------
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.432 / Virus Database: 268.16.9/622 - Release Date:
1/10/2007
> 2:52 PM
>
> [Non-text portions of this message have been removed]
> ----------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.16.9/622 - Release Date: 1/10/2007
2:52 PM

[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: Xgate CPU and memory - Jefferson Smith - Jan 11 10:24:56 2007

--- In 6...@yahoogroups.com, Daniel Friederich wrote:
>
> Did you check the data sheet for your device?
> (for a XDP512, for example
> [...]/files/microcontrollers/doc/data_sheet/MC9S12XDP512V2.pdf)
>
> The chapter "17.4.4 Chip Bus Control" lists the priorities the
> different bus masters have.
> Not sure if it is what you look out for.

Daniel,
Thanks for pointing that out because for that document I had Rev 2.13
which has no section 17.4.4; It is in the latest (2.15). I bet it's a
more complete document now :)



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

Re: Question SD CARD - Peter Lissenburg - Jan 12 6:15:14 2007

Hi Victor,
did you get further with this?
I got distracted, the SPI looks OK, however I'm working with a HCS08 on this
one. So may be missing something, yet I believe they are mostly identical in SPI.
My SPICR1 = 0x54
PL

Victor Adrian Prisacariu wrote:
> I am pooling (sending 0xFF) till I get 0x00 and then till i get 0xFE. The
> problem is that 0xFE doesn't arrive. And the same card worked perfectly with
> a different MCU (PIC). Also the same software (I changed only the SPI
> functions (lowest level)).
>
> Could it be because I'm not using SPI correctly ? I use rising edge, MSD
> first, 333kHz (for initialization) and 4Mhz after that. Also the function
> for reading SPI is:
>
> SPI1DR = myData;
>
> While ((SPI1SR & 128)==0) {}
>
> Return SP1DR;
>
> Is this the correct way of using this card on a hcs12x ?
>
> Of course to initialize it I by sending ~80 SCLK then CMD0_GO_IDLE_STATE,
> CMD1_SEND_OP_COND and finally CMD16_SET_BLOCKLEN. All these work perfectly.
>
> And to read one card sector I use:
>
> BOOL CardReadSector(DWORD sectorNr)
>
> {
>
> WORD i;
>
> SectorInBuffer = sectorNr; //using this for buffering (to
> increase FAT operation speed)
>
> sectorNr <<= 9;
>
> convert.dword = sectorNr;
>
> CardCommand(CMD17_READ_SINGLE_BLOCK,convert.byte[3],convert.byte[2],convert.
> byte[1],convert.byte[0],0xFF);
>
> if (CardResponse(0x00) == FALSE)
>
> return FALSE;
>
> if (CardResponse(0xFE) == FALSE)
>
> return FALSE; //<- DOES NOT GET PAST THIS
>
> for (i=0;i<512;i++)
>
> Sector[i] = SPI(0xFF);
>
> //no need for CRC
>
> SPI(0xFF);
>
> SPI(0xFF);
>
> return TRUE;
>
> }
>
> BYTE CardResponse(BYTE response)
>
> {
>
> WORD count = 0xFFFF;
>
> while(SPI(0xFF) != response && --count > 0);
>
> if (count==0)
>
> return FALSE;
>
> else
>
> return TRUE;
>
> }
>
> Victor
>
> From: 6...@yahoogroups.com
> [mailto:6...@yahoogroups.com ] On
> Behalf Of
> Peter Lissenburg
> Sent: 11 ianuarie 2007 13:01
> To: 6...@yahoogroups.com
> Subject: Re: [68HC12] Question SD CARD
>
> I have not worked on this for a while, but I will be soon. From memory, I
> did
> find some cards that would work OK in a PC card reader, and yet behave this
> way
> in SPI mode. My explanation at the time was that some manufacturers did not
> implement the SPI mode (it was some years ago). But I doubt that is the case
> now.
> Looking at my code, I send the "READ_SINGLE_BLOCK" and an address, with 0xff
> as
> the dummy CRC.
> Then poll the SPI port for a non 0xff response. If the non 0xff response is
> 0x00, then the code continues to poll waiting for the 0xfe.
> Once this arrives, the data is read out in a loop.
> By poll, I mean sending a dummy character, (0xff) and checking the character
>
> returned, continuously (with a time out).
> What part of this procedure is not working for you?
> Or is my process different to your?
> Pete
>
> Victor Adrian Prisacariu wrote:
> >
> >
> > Yes. That is the problem.
> >
> > From: 6...@yahoogroups.com
>
>
> > [mailto:6...@yahoogroups.com
>
> ] On
> > Behalf Of
> > Peter Lissenburg
> > Sent: 11 ianuarie 2007 12:10
> > To: 6...@yahoogroups.com
>
>
> > Subject: Re: [68HC12] Question SD CARD
> >
> > When you say it initialized, have you read the CID or CSD, and it fails
> > reading
> > a sector?
> > P
> >
> > Victor Adrian Prisacariu wrote:
> > >
> > >
> > > Hello.
> > >
> > > I have a question. I've been trying to connect an sd card to a hcs12x
> > MCU.
> > > The card does initialize , but i can not get a data token when i try to
> > > read. Does anyone have any ideas how to solve this? (the card worked
> fine
> > on
> > > another MCU).
> > >
> > > Thanks,
> > >
> > > Victor
> > >
> > > [Non-text portions of this message have been removed]
> > >
> > >
> > >
> > >
> > > ----------------------------------------------------------
> > >
> > > No virus found in this incoming message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.432 / Virus Database: 268.16.9/622 - Release Date:
> 1/10/2007
> > 2:52 PM
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> > ----------------------------------------------------------
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.432 / Virus Database: 268.16.9/622 - Release Date: 1/10/2007
> 2:52 PM
>
> [Non-text portions of this message have been removed]
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.16.9/622 - Release Date: 1/10/2007 2:52 PM



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

Oscillator from s12dp256 to s12Xdp512 - jpdi...@free.fr - Mar 21 15:25:44 2007

Hye

I'm trying to go from 9s12dp256 CPU to 9s12Xdp512, with the same printed board.

I'm able to download and debug program (ICC12 ImageCraft V 7 compiler and NoIce debugger)

But I think the CPU run with his internal clock, not quartz :
- some functions (delay) developped before are very slow
- the PLL doesn't run too.

When I compare data sheets, I see
dp256 family : Collpitts oscillator, so my scheme is
- cond 22 pF between XTAL and EXTAL
- quartz 12 Mhz between EXTAL and GND
- cond 22 pF between XTAL and GND
(I copy this oscillator from a learning board)

XDP family : Pierce oscillator

Who can help me for the scheme of that Pierce oscillator ?

It seems the PLL circuit are the same, so I hope the PLL run with the same components with the two families...

Many thanks
Best regards

Joel Petrique
Diese-Info

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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