ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 12.06.2025

Просмотров: 8251

Скачиваний: 1

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

© MCS Electronics, 1995-2007

In principle the timings are the same in slave mode like previously described in master mode. Because of the switching of the roles between master and slave the requirements on the timing are inverted as well. The minimum times of the master mode are now maximum times and vice versa.

SPI Transmission Conflicts

A write collision occurs if the SPDR is written while a transfer is in progress. Since this register is just single buffered in the transmit direction, writing to SPDR causes data to be written directly into the SPI shift register. Because this write operation would corrupt the data of the current transfer, a write-collision error in generated by setting the WCOL bit in the SPSR. The write operation will not be executed in this case and the transfer continues undisturbed. A write collision is generally a slave error because a slave has no control over when a master will initiate a transfer. A master, however, knows when a transfer is in progress. Thus a master should not generate write collision errors, although the SPI logic can detect these errors in a master as well as in a slave mode.

When you set the SPI option from the Options, Compiler, SPI menu SPCR will be set to 01010100 which means ; enable SPI, master mode, CPOL = 1

When you want to control the various options with the hardware SPI you can use the CONFIG SPI statement.

Power Up

At power up all ports are in Tri-state and can serve as input pins.

When you want to use the ports (pins) as output, you must set the data direction first with the statement : CONFIG PORTB = OUTPUT

Individual bits can also be set to be used as input or output.

For example : DDRB = &B00001111 , will set a value of 15 to the data direction register of PORTB.

PORTB.0 to PORTB.3 (the lower 4 bits) can be used as outputs because they are set high. The upper four bits (PORTB.4 to PORTB.7), can be used for input because they are set low.

page -137-

© MCS Electronics, 1995-2007

You can also set the direction of a port pin with the statement :

CONFIG PINB.0 = OUTPUT | INPUT

The internal RAM is cleared at power up or when a reset occurs. Use $NORAMCLEAR to disable this feature.

You may use $INITMICRO to set a port level and direction immediately on startup.

page -138-


© MCS Electronics, 1995-2007

Chips

AT86RF401

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

AT90S1200

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

AT90S2313

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

page -139-

© MCS Electronics, 1995-2007

The ATTiny2313 should be used for new designs.

AT90S2323

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

AT90S2333

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

page -140-

© MCS Electronics, 1995-2007

AT90S2343

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

[tip from Martin Verschuren]

When using the AT90S2343 with BASCOM-AVR 1.11.6.4 and the STK200. Programming must be done with jumper ext-clk.

The BASCOM build in programmer will detect a Tiny22, which seems to have the same ID string as the 2343 (Atmel source) so no wonder.

By using the internal clock RCEN=0, then the jumper of the STK200 must be on int.clk after programming.

Don't leave this away, some AT90S2343 will not correctly startup.

page -141-

© MCS Electronics, 1995-2007

In your own project notice that you have to pullup the clk pin(2) at power up else it won't work. (I just looked for it for a day to get this problem solved:-)

Note : the at90s2343 and tiny22 have the same chip ID. In BASCOM you need to choose the tiny22 even if you use the 2343.

I note from MCS : only the AT23LS43-1 has the internal oscillator programmed by default! All other 2343 chips need an external clock signal. Tip: use a AT90S2313 and connect X2 to the clock input of the 2343.

[tip from David Chambers]

Using the AT90S2343 with BASCOM 1.11.7.3 the DT006 hardware there are no problems with programming the chip ie no special jumper conditions to enable programming. However it is best to remove links connecting ports to the DT006 LED’s before programming. If access to PB3 and PB4 is desired then jumpers J11 & J12 must be installed with pins 2 and 3 linked in both cases. Note that PB3 and PB4 are each connected to a momentary pushbutton on the DT006 board. These can be used to check contact closure functions, so bear this in mind when writing code for contact monitoring.

The current ATMEL data sheet specifies that all versions –1, -4 and –10 are supplied with a fuse bit set for the internal clock that operates at approximately 1Mhz. If using the internal clock make sure to enter 1000000 under Options\Complier\Communication\frequency.

A great little chip with minimal external components. Only the resistor and capacitor required for RESET during power up.

Note that the LED’s on the DT006 are not connected to the same programmed port pins when changing the chip type. This is because the special functions assigned ports varies between the 8pin, 20 pin and 28 pin products eg the MOSI, MISI and SCKfunctions are assigned to PB0, PB1 and PB2 for an 8 pin processor and PB5, PB6 and PB7 for a 20 pin processor. The result is that for a given program the LED’s that respond are different.

AT90S4414

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

page -142-


© MCS Electronics, 1995-2007

AT90S4433

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

page -143-

© MCS Electronics, 1995-2007

AT90S4434

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

page -144-

© MCS Electronics, 1995-2007

AT90S8515

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

page -145-

© MCS Electronics, 1995-2007

AT90S8535

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

page -146-

© MCS Electronics, 1995-2007

AT90CAN128

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

page -147-


© MCS Electronics, 1995-2007

ATtiny22

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

ATtiny12

page -148-

© MCS Electronics, 1995-2007

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

ATtiny13

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

ATtiny15

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

ATtiny25

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

page -149-

© MCS Electronics, 1995-2007

ATtiny45

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

ATtiny85

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

ATtiny26

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

page -150-

© MCS Electronics, 1995-2007

ATtiny2313

This page is intended to show the outline of the chip and to provide additional information that might not be clear from the datasheet.

page -151-