The HC908GR4 acts as a SPI slave, the baud rate of the host clock is only around 5K bps. When the host sends a packet of 8-bytes to the HC908GR4, it only generate the first Rx interrupt and the ISR only read the first byte. Then no more interrupt occurs, even on the subsequence packets. It seems just reading from the Status and Control Register then reading from the Data Register does not clear the interrupt. Do I have to more? Anyone seen the same problem? Or have implemented the SPI interface that works and has sample code? Please help. Thanks in advance Fred
HC908GR4/8 SPI interrupt problem
Started by ●April 10, 2004
Reply by ●April 11, 20042004-04-11
>When the host sends a packet of 8-bytes to the HC908GR4, it >only generate the first Rx interrupt and the ISR only read the first byte. >Then no more interrupt occurs, even on the subsequence packetsTry posting your code so people can see if you are doing something wrong. I downloaded the datasheet and the errata and didn't see any reported problems with the SPI. There might be an app note about implementing SPI.
Reply by ●April 12, 20042004-04-12
Hi, Perhabs, you have not clear the flag in your ISR. You MUST do this BEFORE read the SPCR. Yvan http://www.ybdesign.fr "Gary Kato" <garykato@aol.com> a �crit dans le message de news: 20040411151116.15383.00000241@mb-m02.aol.com...> >When the host sends a packet of 8-bytes to the HC908GR4, it > >only generate the first Rx interrupt and the ISR only read the firstbyte.> >Then no more interrupt occurs, even on the subsequence packets > > Try posting your code so people can see if you are doing something wrong.I> downloaded the datasheet and the errata and didn't see any reportedproblems> with the SPI. There might be an app note about implementing SPI. > > >
Reply by ●April 13, 20042004-04-13
It reads the SPSCR then the SPDR is that all? Is there any register to set the EOI? Thanks is advance Fred "YB" <yvan@no_spam_ybdesign.fr> wrote in message news:c5dkph$m85$1@news.tiscali.fr...> Hi, > Perhabs, you have not clear the flag in your ISR. > You MUST do this BEFORE read the SPCR. > > Yvan > http://www.ybdesign.fr > > > > > "Gary Kato" <garykato@aol.com> a crit dans le message de news: > 20040411151116.15383.00000241@mb-m02.aol.com... > > >When the host sends a packet of 8-bytes to the HC908GR4, it > > >only generate the first Rx interrupt and the ISR only read the first > byte. > > >Then no more interrupt occurs, even on the subsequence packets > > > > Try posting your code so people can see if you are doing somethingwrong.> I > > downloaded the datasheet and the errata and didn't see any reported > problems > > with the SPI. There might be an app note about implementing SPI. > > > > > > > >
Reply by ●April 13, 20042004-04-13
Yes, in C : SPI isr { unsigned char temp ; temp = SPSCR ; valSPI = SPDR ; } That's all !!! Yvan http://www.ybdesign.fr "Fred" <nospam.fpang168@hotmail.com> a �crit dans le message de news: RlLec.52808$J56.19975@edtnps89...> It reads the SPSCR then the SPDR > is that all? > Is there any register to set the EOI? > > Thanks is advance > > Fred > > "YB" <yvan@no_spam_ybdesign.fr> wrote in message > news:c5dkph$m85$1@news.tiscali.fr... > > Hi, > > Perhabs, you have not clear the flag in your ISR. > > You MUST do this BEFORE read the SPCR. > > > > Yvan > > http://www.ybdesign.fr > > > > > > > > > > "Gary Kato" <garykato@aol.com> a crit dans le message de news: > > 20040411151116.15383.00000241@mb-m02.aol.com... > > > >When the host sends a packet of 8-bytes to the HC908GR4, it > > > >only generate the first Rx interrupt and the ISR only read the first > > byte. > > > >Then no more interrupt occurs, even on the subsequence packets > > > > > > Try posting your code so people can see if you are doing something > wrong. > > I > > > downloaded the datasheet and the errata and didn't see any reported > > problems > > > with the SPI. There might be an app note about implementing SPI. > > > > > > > > > > > > > > >
Reply by ●April 14, 20042004-04-14
It still doesn't work for me. And I ran out of idea. Thanks very much. Fred "YB" <yvan@no_spam_ybdesign.fr> wrote in message news:c5g8q1$6ni$1@news.tiscali.fr...> Yes, in C : > > SPI isr > { > unsigned char temp ; > > temp = SPSCR ; > valSPI = SPDR ; > } > > That's all !!! > > > Yvan > http://www.ybdesign.fr > > > > > "Fred" <nospam.fpang168@hotmail.com> a crit dans le message de news: > RlLec.52808$J56.19975@edtnps89... > > It reads the SPSCR then the SPDR > > is that all? > > Is there any register to set the EOI? > > > > Thanks is advance > > > > Fred > > > > "YB" <yvan@no_spam_ybdesign.fr> wrote in message > > news:c5dkph$m85$1@news.tiscali.fr... > > > Hi, > > > Perhabs, you have not clear the flag in your ISR. > > > You MUST do this BEFORE read the SPCR. > > > > > > Yvan > > > http://www.ybdesign.fr > > > > > > > > > > > > > > > "Gary Kato" <garykato@aol.com> a crit dans le message de news: > > > 20040411151116.15383.00000241@mb-m02.aol.com... > > > > >When the host sends a packet of 8-bytes to the HC908GR4, it > > > > >only generate the first Rx interrupt and the ISR only read thefirst> > > byte. > > > > >Then no more interrupt occurs, even on the subsequence packets > > > > > > > > Try posting your code so people can see if you are doing something > > wrong. > > > I > > > > downloaded the datasheet and the errata and didn't see any reported > > > problems > > > > with the SPI. There might be an app note about implementing SPI. > > > > > > > > > > > > > > > > > > > > > > > >