Loading ...
Sorry, an error occurred while loading the content.

Re: [SeattleRobotics] Re: AT89S8252

Expand Messages
  • harish
    yeah that i have already gone thru.. ... From: Kenneth Maxon To: ; Sent: Thursday,
    Message 1 of 11 , Jan 1, 2004
    View Source
    • 0 Attachment
      yeah that i have already gone thru..


      ----- Original Message -----
      From: "Kenneth Maxon" <kmaxon@...>
      To: <SeattleRobotics@yahoogroups.com>; <harishm@...>
      Sent: Thursday, January 01, 2004 11:38 AM
      Subject: Re: [SeattleRobotics] Re: AT89S8252


      > A quick net search turned up the following SPI example from the Keil
      > compiler folks. Download it and use it as a stepping stone towards fixing
      > your own code. There's a text file with build notes and a PDF as well.
      >
      > http://www.keil.com/download/files/at89s8252_spi.zip
      >
      > Having worked with them before, I'd recommend virus scanning the file
      before
      > opening it.
      >
      > -Kenneth
      > (Unit 3's in trouble and it's scared out of its wits) -Geddy Lee
      > ----- Original Message -----
      > From: "harish" <harishm@...>
      > To: <seattleRobotics@yahoogroups.com>
      > Sent: Wednesday, December 31, 2003 9:38 PM
      > Subject: Fw: [SeattleRobotics] Re: AT89S8252
      >
      >
      > > hi
      > >
      > > posting again the correct code some lines were missing
      > >
      > >
      > > regds
      > >
      > > hm
      > >
      > >
      > >
      > > > -----------SLave --------
      > > >
      > > > when SPIF is set 4 bytes r received ..
      > > >
      > > > static void spi_isr (void) interrupt 4 using 1
      > > > {
      > > > EA = 0;
      > > > r_in = 0;
      > > >
      > > > if(SPIF == 1)
      > > > {
      > > > do
      > > > {
      > > > xstat = SPSR;
      > > > spi_rx[r_in] = SPDR;
      > > > SPDR = spi_tx[r_in];
      > > > while((xstat & 0x80) == 0);
      > > > r_in++;
      > > > }
      > > > while(r_in !=3);
      > > > }
      > >
      > > else
      > > {
      > > TI = 0;
      > > RI = 0;
      > > }
      > >
      > > EA = 1;
      > >
      > > }
      > >
      > > >
      > > > -------slave Init code ------
      > > >
      > > > spi_tx[4]; transmit buffer
      > > > spi_rx[4]; receive buffer
      > > > char r_in; acts a counter
      > > >
      > > > r_in = 0;
      > > > SCK = 1;
      > > > MOSI = 1;
      > > > MISO = 1;
      > > > SS = 1;
      > > >
      > > > SPCR = 0xc5; slave mode
      > > > spi_tx[0] = SPSR;
      > > >
      > > > ES = 1;
      > > >
      > > >
      > > > -------Master INIT code
      > > >
      > > >
      > > > SCK = 1;
      > > > MOSI = 1;
      > > > MISO = 1;
      > > > SS = 1;
      > > > SPCR = 0x55; master mode
      > > > char xstat;
      > > >
      > > > >>
      > > > >>>
      > > >
      > > > on master side 4 bytes r transmitted
      > > >
      > > > void snd_spi()
      > > > {
      > > > SS = 0;
      > > > for(r_in = 0;r_in<=3;r_in++)
      > > > {
      > > > SPDR = rxbuf[r_in];
      > > > xstat = SPSR;
      > > > while((xstat & 0x80) == 0);
      > > > SPSR = 0;
      > > > txbuf[r_in] = SPDR;
      > > > }
      > > > SS = 1;
      > > > }
      > > >
      > > >
      > >
      > > ----- Original Message -----
      > > From: "harish" <harishm@...>
      > > To: <SeattleRobotics@yahoogroups.com>
      > > Sent: Thursday, January 01, 2004 11:04 AM
      > > Subject: Re: [SeattleRobotics] Re: AT89S8252
      > >
      > >
      > > > hi maxon
      > > > the following is code snippet of master and slave
      > > > routines. slave is interrupt based and will recieve 4 bytes as the
      maste
      > > > uses snd_spi()
      > > > function which transmits 4 bytes of code.
      > > >
      > > > i have found out that only reception of 1st character is
      successful
      > > and
      > > > i.e. again immidiately after reset.
      > > >
      > > > i am using raisonance kit as a compiler. and checked the isr addresses
      > all
      > > > were fine..
      > > >
      > > > thanx
      > > >
      > > > regds
      > > >
      > > > hm
      > > >
      > > >
      > > >
      > > > -----------SLave --------
      > > >
      > > > when SPIF is set 4 bytes r received ..
      > > >
      > > > static void spi_isr (void) interrupt 4 using 1
      > > > {
      > > > EA = 0;
      > > > r_in = 0;
      > > >
      > > > if(SPIF == 1)
      > > > {
      > > > do
      > > > {
      > > > xstat = SPSR;
      > > > spi_rx[r_in] = SPDR;
      > > > SPDR = spi_tx[r_in];
      > > > while((xstat & 0x80) == 0);
      > > > r_in++;
      > > > }
      > > > while(r_in !=3);
      > > > }
      > > >
      > > > -------slave Init code ------
      > > >
      > > > spi_tx[4]; transmit buffer
      > > > spi_rx[4]; receive buffer
      > > > char r_in; acts a counter
      > > >
      > > > r_in = 0;
      > > > SCK = 1;
      > > > MOSI = 1;
      > > > MISO = 1;
      > > > SS = 1;
      > > >
      > > > SPCR = 0xc5; slave mode
      > > > spi_tx[0] = SPSR;
      > > >
      > > > ES = 1;
      > > >
      > > >
      > > > -------Master INIT code
      > > >
      > > >
      > > > SCK = 1;
      > > > MOSI = 1;
      > > > MISO = 1;
      > > > SS = 1;
      > > > SPCR = 0x55; master mode
      > > > char xstat;
      > > >
      > > > >>
      > > > >>>
      > > >
      > > > on master side 4 bytes r transmitted
      > > >
      > > > void snd_spi()
      > > > {
      > > > SS = 0;
      > > > for(r_in = 0;r_in<=3;r_in++)
      > > > {
      > > > SPDR = rxbuf[r_in];
      > > > xstat = SPSR;
      > > > while((xstat & 0x80) == 0);
      > > > SPSR = 0;
      > > > txbuf[r_in] = SPDR;
      > > > }
      > > > SS = 1;
      > > > }
      > > >
      > > >
      > > >
      > > > ----- Original Message -----
      > > > From: "Kenneth Maxon" <kmaxon@...>
      > > > To: <SeattleRobotics@yahoogroups.com>; <harishm@...>
      > > > Sent: Thursday, January 01, 2004 10:18 AM
      > > > Subject: Re: [SeattleRobotics] Re: AT89S8252
      > > >
      > > >
      > > > > Have you thrown a scope on the output pins to see the data that is
      > > coming
      > > > > out of the primary?
      > > > >
      > > > > Check the bit-widths making sure you've got devices of appropriate
      > speed
      > > > > talking to each other? Many older peripherals have transfer rates
      > > > > sub-Megabit.
      > > > >
      > > > > You'll want to check the assertion level of the clock. Some
      > > > implementations
      > > > > of SPI use the falling edge of the clock rather than the rising
      edge.
      > > > >
      > > > > Another thing to check is the interrupt service address. Since SIPE
      > is
      > > > not
      > > > > recognized by most standard 8051 variety compilers the origin for
      the
      > > > > service vector may be incorrect/untested? A quick look in the
      vectors
      > > > > section of the *.OBJ or *.S19 or whatever flavor you are using
      should
      > > > verify
      > > > > this.
      > > > >
      > > > > Finally, you'll want to look at your initialization code. Check
      > > settings
      > > > > for data rate, check number of bits used to send the message, check
      > that
      > > > you
      > > > > are correctly loading data into the transmit registers, and that a
      > > > separate
      > > > > module access is launching the transmit.
      > > > >
      > > > > -Kenneth
      > > > > (Unit 3's in trouble and it's scared out of its wits) -Geddy
      Lee
      > > > > ----- Original Message -----
      > > > > From: "harish" <harishm@...>
      > > > > To: <SeattleRobotics@yahoogroups.com>; <yahoo@...>
      > > > > Sent: Wednesday, December 31, 2003 7:50 PM
      > > > > Subject: Re: [SeattleRobotics] Re: AT89S8252
      > > > >
      > > > >
      > > > > > hi
      > > > > > yeah i have tried avrfreaks site but nothing related to
      > SPI
      > > > > ATMEL
      > > > > > 89S8252 could be found..
      > > > > > any idea how to proceed ?
      > > > > >
      > > > > > I have treied so many techniques for SPI communication but all in
      > > vain.
      > > > > even
      > > > > > single master to single slave was not thru.
      > > > > > i have used interrupts on the slave end.
      > > > > >
      > > > > >
      > > > > > regds
      > > > > >
      > > > > > hm
      > > > > >
      > > > > >
      > > > > >
      > > > > > ----- Original Message -----
      > > > > > From: "Kenneth Maxon" <kmaxon@...>
      > > > > > To: <SeattleRobotics@yahoogroups.com>; <yahoo@...>
      > > > > > Sent: Thursday, January 01, 2004 4:41 AM
      > > > > > Subject: Re: [SeattleRobotics] Re: AT89S8252
      > > > > >
      > > > > >
      > > > > > > He may have meant 8051 as opposed to 5051.
      > > > > > >
      > > > > > > -Kenneth
      > > > > > > (Unit 3's in trouble and it's scared out of its
      wits) -Geddy
      > > Lee
      > > > > > > ----- Original Message -----
      > > > > > > From: "Larry Barello" <yahoo@...>
      > > > > > > To: <SeattleRobotics@yahoogroups.com>
      > > > > > > Sent: Wednesday, December 31, 2003 1:18 PM
      > > > > > > Subject: RE: [SeattleRobotics] Re: AT89S8252
      > > > > > >
      > > > > > >
      > > > > > > > The at89 series is Atmel's 5051 compatible chips. AvrFreaks
      > would
      > > > > have
      > > > > > > > nothing to do with them.
      > > > > > > >
      > > > > > > > -----Original Message-----
      > > > > > > > From: Michael
      > > > > > > >
      > > > > > > > have you tried the AVRFreaks site?
      > > > > > > >
      > > > > > > > --- In SeattleRobotics@yahoogroups.com, "harish"
      <harishm@e...>
      > > > > > > > wrote:
      > > > > > > > > hi all
      > > > > > > > > does anyone has code for AT89S8252 single master
      > > multi
      > > > > > > > slave using SPI and using SPIE interrupt
      > > > > > > > >
      > > > > > > >
      > > > > > > >
      > > > > > > > Visit the SRS Website at http://www.seattlerobotics.org
      > > > > > > >
      > > > > > > > Yahoo! Groups Links
      > > > > > > >
      > > > > > > > To visit your group on the web, go to:
      > > > > > > > http://groups.yahoo.com/group/SeattleRobotics/
      > > > > > > >
      > > > > > > > To unsubscribe from this group, send an email to:
      > > > > > > > SeattleRobotics-unsubscribe@yahoogroups.com
      > > > > > > >
      > > > > > > > Your use of Yahoo! Groups is subject to:
      > > > > > > > http://docs.yahoo.com/info/terms/
      > > > > > > >
      > > > > > > >
      > > > > > > >
      > > > > > >
      > > > > > >
      > > > > > > Visit the SRS Website at http://www.seattlerobotics.org
      > > > > > >
      > > > > > > Yahoo! Groups Links
      > > > > > >
      > > > > > > To visit your group on the web, go to:
      > > > > > > http://groups.yahoo.com/group/SeattleRobotics/
      > > > > > >
      > > > > > > To unsubscribe from this group, send an email to:
      > > > > > > SeattleRobotics-unsubscribe@yahoogroups.com
      > > > > > >
      > > > > > > Your use of Yahoo! Groups is subject to:
      > > > > > > http://docs.yahoo.com/info/terms/
      > > > > > >
      > > > > > >
      > > > > > >
      > > > > >
      > > > > >
      > > > > > Visit the SRS Website at http://www.seattlerobotics.org
      > > > > >
      > > > > > Yahoo! Groups Links
      > > > > >
      > > > > > To visit your group on the web, go to:
      > > > > > http://groups.yahoo.com/group/SeattleRobotics/
      > > > > >
      > > > > > To unsubscribe from this group, send an email to:
      > > > > > SeattleRobotics-unsubscribe@yahoogroups.com
      > > > > >
      > > > > > Your use of Yahoo! Groups is subject to:
      > > > > > http://docs.yahoo.com/info/terms/
      > > > > >
      > > > > >
      > > > > >
      > > > >
      > > > >
      > > > > Visit the SRS Website at http://www.seattlerobotics.org
      > > > >
      > > > > Yahoo! Groups Links
      > > > >
      > > > > To visit your group on the web, go to:
      > > > > http://groups.yahoo.com/group/SeattleRobotics/
      > > > >
      > > > > To unsubscribe from this group, send an email to:
      > > > > SeattleRobotics-unsubscribe@yahoogroups.com
      > > > >
      > > > > Your use of Yahoo! Groups is subject to:
      > > > > http://docs.yahoo.com/info/terms/
      > > > >
      > > > >
      > > > >
      > > >
      > >
      > >
      > > Visit the SRS Website at http://www.seattlerobotics.org
      > >
      > > Yahoo! Groups Links
      > >
      > > To visit your group on the web, go to:
      > > http://groups.yahoo.com/group/SeattleRobotics/
      > >
      > > To unsubscribe from this group, send an email to:
      > > SeattleRobotics-unsubscribe@yahoogroups.com
      > >
      > > Your use of Yahoo! Groups is subject to:
      > > http://docs.yahoo.com/info/terms/
      > >
      > >
      > >
      >
      >
      > Visit the SRS Website at http://www.seattlerobotics.org
      >
      > Yahoo! Groups Links
      >
      > To visit your group on the web, go to:
      > http://groups.yahoo.com/group/SeattleRobotics/
      >
      > To unsubscribe from this group, send an email to:
      > SeattleRobotics-unsubscribe@yahoogroups.com
      >
      > Your use of Yahoo! Groups is subject to:
      > http://docs.yahoo.com/info/terms/
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.