SPI errata - do I have this problem?

Started by Ron Dolling October 20, 2003

SPI errata - SPTEF flag set erroneously. MUCts00741

I think that I may be having the problem described in this errata with
my SPI port, but I am not sure.

I'm trying to run code on a 9S12DJ256 that was running without problems
on a 68HC912B32. I've made changes slight changes to the setup as
required, so it should work. The problem is that none of the three SPI
devices on the bus is communicating properly all the time. How can I
determine that the problem identified in the errata is my problem?

Since the errata says that the SPTEF might reset in the first pulse of a
subsequent byte, should I occasionally see two bytes transmitted when
I'm sending three?

I've tried adding a long time delay between bytes, but it hasn't solved
the problem.

I'd appreciate any suggestions that anyone has..



Ron,

Maybe you can try using the latest MC9S12DJ256 mask-set 0L91N, and see if
it resolves your problem.

The errata of this latest mask-set is not published on the Motorola
web-site so I don't know if this problem has been fixed on it or not, but I
do know SPS fixed many of the problems that were present on the earlier
MC9S12DJ256 mask sets (0K36N, 0K79X, 1K79X and 2K79X) with the latest 0L91N
mask-set.

Hope this helps,
Doron
Nohau Corporation
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html

At 16:07 20/10/2003 -0700, you wrote:
>
>SPI errata - SPTEF flag set erroneously. MUCts00741
>
>I think that I may be having the problem described in this errata with
>my SPI port, but I am not sure.
>
>I'm trying to run code on a 9S12DJ256 that was running without problems
>on a 68HC912B32. I've made changes slight changes to the setup as
>required, so it should work. The problem is that none of the three SPI
>devices on the bus is communicating properly all the time. How can I
>determine that the problem identified in the errata is my problem?
>
>Since the errata says that the SPTEF might reset in the first pulse of a
>subsequent byte, should I occasionally see two bytes transmitted when
>I'm sending three?
>
>I've tried adding a long time delay between bytes, but it hasn't solved
>the problem.
>
>I'd appreciate any suggestions that anyone has..





Ron,

I was having problems with the SPI lately too, and here's the
solution I arrived with with the help of someone at Motorola

When you go to set up your SPI make sure you do this(settings as
apropriate), the 3 NOPs and 2 reads are important:

char test;
//SPI1CR1_SPE = 1; //enable SPI
SPI1CR1_MSTR = 1; //set master mode
SPI1BR_SPR0 = 0x03; //set baud rate to clock/x (16=0x03)
(4=0x01)
SPI1CR1_SPE = 1; //enable SPI
__asm NOP;
__asm NOP;
__asm NOP;
test=SPI1SR;
test=SPI1DR;

Then you can use this code to send/receive data:
while( !SPI1SR_SPTEF )
{
__asm NOP; //WAIT for the transmitter empty flag

}

SPI1CR1_CPOL = 0;
SPI1CR1_CPHA = 1;
PORTB_BIT0 = 0; //enable switch mon
SPI1DR=0x00;

while(( !SPI1SR_SPIF) ) //WAIT for data transfer
{
__asm NOP;
}
test=SPI1DR;

--- In , "Ron Dolling" <rdolling@c...> wrote:
>
> SPI errata - SPTEF flag set erroneously. MUCts00741
>
> I think that I may be having the problem described in this errata
with
> my SPI port, but I am not sure.
>
> I'm trying to run code on a 9S12DJ256 that was running without
problems
> on a 68HC912B32. I've made changes slight changes to the setup as
> required, so it should work. The problem is that none of the three
SPI
> devices on the bus is communicating properly all the time. How can
I
> determine that the problem identified in the errata is my problem?
>
> Since the errata says that the SPTEF might reset in the first
pulse of a
> subsequent byte, should I occasionally see two bytes transmitted
when
> I'm sending three?
>
> I've tried adding a long time delay between bytes, but it hasn't
solved
> the problem.
>
> I'd appreciate any suggestions that anyone has.. >
>





Hi Tim

Thanks for the response. I've implemented the code, but it hasn't solved
the problem. I've looked at your other thread, and it seems likely that
I am having the same problem.

Do you have a contact at Motorola that I could call who you've worked
with? Maybe there is something different about my situation that would
require a medication.

Thanks

Ron -----Original Message-----
From: Tim Raabe [mailto:]
Sent: October 21, 2003 8:55 AM
To:
Subject: [68HC12] Re: SPI errata - do I have this problem?

Ron,

I was having problems with the SPI lately too, and here's the
solution I arrived with with the help of someone at Motorola

When you go to set up your SPI make sure you do this(settings as
apropriate), the 3 NOPs and 2 reads are important:

char test;
//SPI1CR1_SPE = 1; //enable SPI
SPI1CR1_MSTR = 1; //set master mode
SPI1BR_SPR0 = 0x03; //set baud rate to clock/x (16=0x03)
(4=0x01)
SPI1CR1_SPE = 1; //enable SPI
__asm NOP;
__asm NOP;
__asm NOP;
test=SPI1SR;
test=SPI1DR;

Then you can use this code to send/receive data:
while( !SPI1SR_SPTEF )
{
__asm NOP; //WAIT for the transmitter empty flag

}

SPI1CR1_CPOL = 0;
SPI1CR1_CPHA = 1;
PORTB_BIT0 = 0; //enable switch mon
SPI1DR=0x00;

while(( !SPI1SR_SPIF) ) //WAIT for data transfer
{
__asm NOP;
}
test=SPI1DR;

--- In , "Ron Dolling" <rdolling@c...> wrote:
>
> SPI errata - SPTEF flag set erroneously. MUCts00741
>
> I think that I may be having the problem described in this errata
with
> my SPI port, but I am not sure.
>
> I'm trying to run code on a 9S12DJ256 that was running without
problems
> on a 68HC912B32. I've made changes slight changes to the setup as
> required, so it should work. The problem is that none of the three
SPI
> devices on the bus is communicating properly all the time. How can
I
> determine that the problem identified in the errata is my problem?
>
> Since the errata says that the SPTEF might reset in the first
pulse of a
> subsequent byte, should I occasionally see two bytes transmitted
when
> I'm sending three?
>
> I've tried adding a long time delay between bytes, but it hasn't
solved
> the problem.
>
> I'd appreciate any suggestions that anyone has.. >
>

<http://rd.yahoo.com/M4081.4074964.5287182.1261774/D=egroupweb/S06
554205:HM/A06996/R=0/SIGp5b9ris/*http:/www.ediets.com/start.cfm?co
de0509&media=atkins> click here <http://us.adserver.yahoo.com/l?M4081.4074964.5287182.1261774/D=egrou
pmail/S=:HM/A06996/rand2987299>

--------------------
">http://docs.yahoo.com/info/terms/> Terms of Service.


Thanks Doran. I will try to chase down one of these chips. It would be
the best solution assuming that I can get a supply of them.

Ron -----Original Message-----
From: Doron Fael [mailto:]
Sent: October 21, 2003 12:14 AM
To:
Subject: Re: [68HC12] SPI errata - do I have this problem?

Ron,

Maybe you can try using the latest MC9S12DJ256 mask-set 0L91N, and see
if
it resolves your problem.

The errata of this latest mask-set is not published on the Motorola
web-site so I don't know if this problem has been fixed on it or not,
but I
do know SPS fixed many of the problems that were present on the earlier
MC9S12DJ256 mask sets (0K36N, 0K79X, 1K79X and 2K79X) with the latest
0L91N
mask-set.

Hope this helps,
Doron
Nohau Corporation
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html

At 16:07 20/10/2003 -0700, you wrote:
>
>SPI errata - SPTEF flag set erroneously. MUCts00741
>
>I think that I may be having the problem described in this errata with
>my SPI port, but I am not sure.
>
>I'm trying to run code on a 9S12DJ256 that was running without problems
>on a 68HC912B32. I've made changes slight changes to the setup as
>required, so it should work. The problem is that none of the three SPI
>devices on the bus is communicating properly all the time. How can I
>determine that the problem identified in the errata is my problem?
>
>Since the errata says that the SPTEF might reset in the first pulse of
a
>subsequent byte, should I occasionally see two bytes transmitted when
>I'm sending three?
>
>I've tried adding a long time delay between bytes, but it hasn't solved
>the problem.
>
>I'd appreciate any suggestions that anyone has..

<http://rd.yahoo.com/M4081.4074964.5287182.1261774/D=egroupweb/S06
554205:HM/A32163/R=0/SIGn0nglqg/*http:/www.ediets.com/start.cfm?co
de0510&media=zone> click here <http://us.adserver.yahoo.com/l?M4081.4074964.5287182.1261774/D=egrou
pmail/S=:HM/A32163/rand9152953>

--------------------
">http://docs.yahoo.com/info/terms/> Terms of Service.