Download: 8-bit RISC Microcontroller Application Note AVR335: Digital Sound Recorder with AVR and Serial DataFlash Features

8-bit RISC Microcontroller Application Note Rev. 1456B–01/04 AVR335: Digital Sound Recorder with AVR and Serial DataFlash Features • Digital Voice Recorder • 8-bit Sound Recording • 8 KHz Sampling Rate • Sound Frequency up to 4000 Hz • Maximum Recording Time 2 1/4 Minutes • Very Small Board Size • Only 550 Bytes of Code Introduction This application note describes how to record, store and play back sound using any AVR microcontroller with A/D converter, the AT45DB161 DataFlash memory and a few extra components. This application note shows in detail the usage of the A/D Converter for sound reco...
Author: Zoble1980 Shared: 8/19/19
Downloads: 37 Views: 401

Content

8-bit RISC

Microcontroller Application Note

Rev. 1456B–01/04

AVR335: Digital Sound Recorder with AVR and Serial DataFlash Features

• Digital Voice Recorder • 8-bit Sound Recording • 8 KHz Sampling Rate • Sound Frequency up to 4000 Hz • Maximum Recording Time 2 1/4 Minutes • Very Small Board Size • Only 550 Bytes of Code

Introduction

This application note describes how to record, store and play back sound using any AVR microcontroller with A/D converter, the AT45DB161 DataFlash memory and a few extra components. This application note shows in detail the usage of the A/D Converter for sound record- ing, the Serial Peripheral Interface (SPI) for accessing the external DataFlash memory and the Pulse Width Modulation (PWM) for playback. Typical applications that would require one or more of these blocks are temperature loggers, telephone answering machines, or digital voice recorders. The AT45DB161 DataFlash is a 2.7-volt only, serial interface Flash memory. Its 16 Mbit of memory are organized as 4096 pages of 528 bytes each. In addition to its main memory, the DataFlash contains two SRAM data buffers of 528 bytes each. The buffers allow a continuous data stream from or to the DataFlash. The AT45DB161 uses an SPI serial interface to sequentially access its data. This interface facilitates hardware layout, increases system reliability, minimizes switching noise, and reduces package size and active pin count. Typical applications are image storage, data storage and digital voice storage. The DataFlash operates at SPI clock frequencies up to 13 MHz with a typical active read current consumption of 4 mA. It operates from a single power supply, up from 2.7V, for both the write and read operations. Its serial interface is compatible to the Serial Peripheral Interface (SPI) modes 0 and 3, thus it can easily be interfaced to the AVR microcontroller. In this application note the AVR ATmega8535 is used to take analog samples from a microphone and convert them to digital values. Its built-in SPI controls data transfers to and from the DataFlash. The PWM feature of the AVR is used for playback.,

Theory of Operation Before the analog speech signal can be stored in the DataFlash it has to be converted

into a digital signal. This is done in multiple steps. Figure 1. The Example Analog Signal X(t) t First, the analog signal (Figure 1) is converted into a time discrete signal by taking peri- odic samples (Figure 2). The time interval between two samples is called the “sampling period” and its reciprocal the “sampling frequency”. According to the sampling theorem, the sampling frequency has to be at least double the maximum signal frequency. Other- wise the periodic continuation of the signal in the frequency domain would result in spectral overlap, called “aliasing”. Such an aliased signal can not be uniquely recovered from its samples. A speech signal contains its major information below 3000 Hz. Therefore a low-pass fil- ter can be used to band-limit the signal. For an ideal low-pass filter with a cut-off frequency of 3000 Hz the sampling frequency must be 6000 Hz. Depending on the filter, the filter slope is more or less steep. Espe- cially for a first order filter like the RC-filter used in this application it is necessary to choose a much higher sampling frequency. The upper limit is set by the features of the A/D-converter. Determining the digital values that represent the analog samples taken at this sampling frequency is called “quantization”. The analog signal is quantized by assigning an ana- log value to the nearest “allowed” digital value (Figure 3). The number of digital values is called “resolution” and is always limited, e.g. to 256 values for an 8-bit digital signal or 10 values in this example. Therefore quantization of analog signals always results in a loss of information. This “quantization error” is inverse proportional to the resolution of the digital signal. It is also inverse proportional to the signal’s “dynamic range”, the range between minimum and maximum values (3 to 8 in this example). The A/D con- verter of the ATmega8535 microcontroller can be adjusted to the dynamic range of the signal by setting AGND and AREF to the minimum and maximum signal values. On the other hand the microphone amplifier can be adjusted to cover the ADC’s dynamic range as presented later. Both methods reduces the quantization error. In addition the latter method also increases the signal to noise ratio (SNR) and should therefore be preferred. Figure 4 shows the digital values that represent the analog signal. These are the values that are read as ADC conversion results. In this application the signal has a minimum and a maximum value, which are never exceeded. The parts of the signal below the minimum and above the maximum value do not contain any information. They can be removed in order to save memory. This is done by downshifting the whole signal and discarding the part above the “max” value (Figure 5). 2 AVR335,

AVR335

Figure 2. The Time Discrete Signal X(t) n0123456789Figure 3. The Quantized Signal X(t) n0123456789Figure 4. The Digital Signal X(t) n0123456789Figure 5. The Bit-Reduced Digital Signal X(t) 7 maxn0123456789In this application the resulting signal has 8 bit. This signal can now be stored in the DataFlash. The dataFlash it has to be erased before data is stored. Erasing the AT45DB161 DataFlash can be done in combination with programming a page, as single page erase or as block erase, with a block being eight pages in size., The first method is the most code efficient, as no extra erase cycles have to be imple- mented. But for sound recording it is necessary to store large amounts of sequential data. Because of this, the block erase method is preferred, as this is the fastest way of erasing large blocks of memory. Depending on the clock frequency of the system the whole erasing procedure takes up to a few seconds. After the memory has been erased, data can be recorded until all pages are filled up. For writing to the DataFlash the Buffer1 is used. When this buffer is filled up (with 528 samples) the buffer is written to the main memory while the 529th conversion is done. Data is recorded until the “Record” button is released or the memory is full. If the entire memory is filled up, no new data can be stored before the DataFlash is erased. If the memory is only partly filled and the “Record” button is pressed a second time, the new data is appended directly to the existing data. Playback of sound is always started at the beginning of the DataFlash. It stops when either all recorded data is played back or when the “Playback” button is released. The DataFlash allows reading back data either directly from a main memory page or by copying a page to one of the two buffers and reading from the buffer. The direct access method is not suitable for this application as two addresses, one for page and one for byte position, and a long initialization sequence have to be transferred to the DataFlash for each single byte. This takes much longer than one PWM cycle, which is 510 clock cycles for an 8-bit PWM signal. Therefore one memory page is copied to one of the two buffers. While data is read from this buffer the next memory page is copied into the other buffer. When all data has been read from the first buffer reading continues on the other buffer, while the first one is reloaded. Reading data from the DataFlash buffer is synchronized to the PWM frequency. Figure 6. Two Example PWM Cycles WM Counter PWM Cycle Numbe012345678765432101234567876543210The digital value is played back by using pulse width modulation (PWM). In Figure 6 the samples 2 and 3 of the example signal are shown. One cycle of the PWM signal con- sists of a counter counting up to the maximum value that can be represented by the given resolution (8 in this example), and counting down to zero again. The output is switched on when the PWM counter matches the value of the digital signal value and is switched off when it falls below this value again. Therefore the dark area represents the power of the signal at that sample. Figure 7 shows the PWM output signal for the exam- ple signal. The PWM frequency has to be at least twice the signal frequency. A PWM frequency at least four times higher is recommended, depending on the output filter. 4 AVR335,

AVR335

This can be achieved either by reducing signal frequency, increasing system clock fre- quency or reducing signal resolution. Figure 7. The Filtered PWM Output Signal X(t) 7 maxn0123456789In this application the cut-off frequency of the output filter is set to 4000 Hz, which is roughly one quarter of the PWM frequency (15,686 Hz). The system clock speed and the PWM resolution determines the PWM frequency. With an 8 MHz system clock the frequency for a 10-bit PWM is 3922 Hz ( 8 MHz / 2*(2^10) = 3922 Hz), for 9 bit it is 7843 Hz and for an 8-bit resolution 15,686 Hz. Only the last value is high enough to serve as carrier frequency for the 4000 Hz signal. Therefore the original 10-bit digital sample is converted to 8 bit. The output filter smoothens the output signal and removes the high-frequency PWM carrier signal. The resulting output signal for the example signal now looks somehow like the drawing in Figure 8. Except for the quantization errors (which are very big in this example as only 8 digital values are used) and a missing amplification the signal looks almost like the analog input signal (Figure 1). Figure 8. The PWM Output Signal X(t) n0123456789,

Microcontroller and Figure 9. Microcontroller and Memory Circuit Diagram Memory Circuit Vcc

Vcc Vcc 10K 1K Vcc PB0 RES PB1 RDY PB2 WP PB4 CS PB3 MOSI SI MISO SO SCK SCK from microphone circuit ADC0 OC1B to filter and amplifier circuit (Connector Pin 2) (Connector Pin 3)

AVR

erase AT90S8535 Vcc PD0 record PD1 playback PD2 100R AGND AVcc GND AREF

GND

XTAL1 XTAL2 100nF GND GND 8MHz 22pF 22pF

GND

The user can control the sound system with three pushbuttons, called “erase”, “record” and “playback”. If the pushbuttons are not pressed the internal pull-up resistors provide Vcc at PD0 - PD2. Pushing a button pulls the input line to GND. As feedback for the user, an LED indicates the status of the system. The DataFlash is directly connected to the AVR microcontroller using the SPI bus. In case the ISP feature is used to reprogram the AVR, the pull-up resistor on the CHIP SELECT line (“CS”) prevents the DataFlash from getting active. If the ISP feature is not used this resistor can be omitted. The analog voltage, AVCC, is connected to VCC by an RC low-pass filter. The refer- ence voltage is set to AVCC. The oscillator crystal with two 22pF decoupling capacitors generates the system clock. ISP (MOSI) ISP (MISO) ISP (SCK) 6 AVR335,

AVR335 Microphone and Figure 10. Microphone and Speaker Circuit Diagram Speaker Circuit R1

10K Vcc Vcc R3 Vcc 10K R4 U1A 1K 3 4+ 1 R5 C1 R9 2 - 12K 1µF 1K 11 LM 324 R2 C8 10K GND 4n7 GND GND C2 C5 1µF 100nF U1D U1C - 9 14 C3 U1B - 6 - 8 R11 12 + 7 R7 R10 1µF 10 + LM 324 R6 12K5 + 1K8 LM 32415K C4 5K LM 324 C9 C7 22nF 2n2 1nF GND GND GND The microphone amplifier is a simple inverting amplifier. The gain is set with R1 and R9 (gain = R1/R9). R4 is used to power the microphone and C1 blocks any DC component to the amplifier. R2 and R3 set the offset. R5 and C8 form a simple first order low pass filter. In addition R5 protects the amplifier from any damage if the output is short- circuited. The speaker circuit consists of a 5th order low-pass Chebychev filter and a unary gain amplifier. The filter is made up by two stagger-tuned 2nd order Chebychev filters (R6, R7, R8, C2, C7 and R7, R10, R11, C9, C5) and a passive first order filter (R11, C4). The cut-off fre- quencies of these three filters are slightly shifted against each other (“staggered”) to limit passband ripple of the whole filter circuit. The overall cut-off frequency is set to 4000Hz, which is roughly one quarter of the PWM frequency (15,686 Hz). The unary gain amplifier prevents the circuit from getting feedback from the output. C3 blocks any DC component to the speaker.

Implementation Setup When the program is started the ports have to be set up. This is done in the “setup”

subroutine. The SPI protocol defines one device as a master and the other devices connected to this master as slaves. In this application the AVR microcontroller functions as a master and the DataFlash as a slave. As the ATmega8535 is the only master in this application the SS pin can be used as an I/O pin., The SPI of the ATmega8535 is defined as an alternative function of Port B (PB5 to PB7). In this application the control signals for the DataFlash are also set up on Port B (PB0 to PB2 and PB4). The free pin (PB3) is used to control the status LED. For master setup, the signals Serial Clock (SCK), Master Out / Slave In (MOSI), Chip Select (CS), Write Protect (WP) and Reset (RST) are outputs, whereas Master In/ Slave Out (MISO) and Ready/Busy (RDY/BSY) are inputs. With PB3 for the LED also defined as an output the Data Direction Register for Port B is set up as 0xBD. Then the PortB is set to a defined status with all outputs high and internal pull-up resis- tors on the inputs. The A/D converter of the ATmega8535 is connected to PortA. Therefore PortA is defined as a high impedance input. PortD serves as an input for the pushbuttons and as an output for the PWM signal. Here the PWM function of Timer1 on the output pin PD4 is used. In the end, interrupts are enabled. In this application two interrupts (“ADC” and “Timer1 Overflow”) are used, which are enabled and disabled directly in the subroutine when they are required.

The Main Loop In the main loop the three pushbuttons are scanned. If one of them is pressed the LED

is turned on to show that the system is busy, and the corresponding subroutine is called. As a software debounce for the “Erase” and “Playback” functions an extra loop is per- formed until the button is released. During the main loop the LED is turned off to indicate that the system is running idle. 8 AVR335,

AVR335 Figure 11. The Main Loop

Start Setup Ports Record button YES Record pressed ?

NO

Erase Erase button YES NObutton pressed Erase released ? ? NO YES Play back YES Play back NO button Play back button pressed released ? ? NO YES LED off

Erase Before data can be written into the memory the DataFlash has to be erased.

, Figure 12. Erase Erase Set block counter to zero Set new-data flag Enable SPI

YES

All blocks erased ?

NO

Enable DataFlash Disable SPI Transmit Return "block erase" opcode Transmit block address Transmit don't cares Disable DataFlash Increment block counter

NO

Block erase ready ?

YES

When the “erase” subroutine is called a flag is set which indicates that in the next recording cycle the new data can be stored at the beginning of the DataFlash. The SPI has to be set up for accessing the DataFlash. No interrupts are used here. The data order for the DataFlash is MSB first and the ATmega8535 is the master. The DataFlash accepts either the SCK signal being low when CS toggles from high to low (SPI mode 0) or the SCK signal being high when CS toggles from high to low (SPI mode 3) with a positive clock phase. In this application the SPI is set up in mode 3. In order to get the fastest data transfer possible the lowest clock division is chosen, run- ning the SPI bus at 2 MHz if an oscillator crystal of 8 MHz is used. 10 AVR335,

AVR335

To perform a block erase, the CS line is driven low and the opcode 0x50 is loaded into the DataFlash, followed by two reserved bits (zeros), the 9-bit block address and 13 don’t care bits. This sequence is transferred to the slave bytewise. After each byte the SPI Status Register (SPSR) is checked until the SPI Interrupt Flag indicates that the serial transfer is complete. After the whole sequence is written, erasing of the block is started when the CS line is driven high. The Ready/Busy pin is driven low by the DataFlash until the block is erased. Then the next block will be erased in the same way as the current. This takes place until all 512 blocks are erased. An erased location reads 0xFF.

Record The record subroutine consists of the setup of the A/D converter and an empty loop,

which is performed as long as the “record” button is pressed. The ADC0 pin is used in this application, which requires the ADC Multiplexer Select Register (ADMUX) being set to zero. In the ADC Control and Status Register (ADCSR) the ADC is enabled with a clock division factor of 32, set to single conversion mode, interrupts enabled and the interrupt flag is cleared. The A/D conversion is also immediately started. The first con- version takes longer than the following conversions (832 oscillator cycles instead of 448). After this time the ADC interrupt occurs, indicating that the conversion is finished and the result can be read out of the ADC Data Register. The analog signal from the microphone circuit is sampled at 15,686 Hz. This is the same frequency as the output (PWM) frequency. To achieve a sampling frequency of 15,686 Hz a sample has to be taken every 510 cycles (15,686 Hz * 510 = 8 MHz). To get one A/D conversion result each 510 clock cycles the ADC is run in single conversion mode with an ADC clock division by 32. A single conversion takes 14 ADC cycles. Therefore a conversion will be ready after 14 * 32 = 448 cycles. When a conversion is finished an interrupt occurs. The interrupt routine then performs a loop to fill in the missing 510 - 448 = 62 cycles, before a new A/D conversion is started. The 10-bit conversion result represents the value at the A/D converter input pin 2 cycles after the conversion has started. These 10 bits cover the range from AGND to AREF, which is 0 to 5V in this application. The microphone circuit output signal, however, is lim- ited to the range of 2.3 V to 3.5 V. Therefore the 10 bit conversion result is subtracted by a value representing the minimum input voltage. This is 0x1D5 for 2.3V. The part of the data representing signal values above 3.5V is removed by cutting off the two MSBs. This is done automatically when the conversion result is handed over to the “write to flash” subroutine, as its variable “flash_data” is defined as type “char” (8-bit). The final 8- bit data has then to be written to the DataFlash before the next A/D conversion interrupt occurs.,

Figure 13. Record

record Initialize SPI Initialize and start ADC Record button NO pressed ?

YES

Return

NO

ADC ready ?

YES

Loop for 62 cycles Start A/D conversion Read data from ADC Convert data to 8 bit Write to flash 12 AVR335,

AVR335 Write to Flash Figure 14. Write to Flash

write to flash

NO

New-data flag set ?

YES

Set page counter and buffer counter to zero Clear new-data flag

YES

DataFlash busy ?

NO

Enable DataFlash Transmit "buffer write" opcode, buffer address and data Disable DataFlash

NO

Buffer full ?

YES

Set buffer counter to zero

YES

Memory full ?

NO

Enable DataFlash LED off Transmit "buffer to page" opcode, page address and don't cares Record button NO released ? Disable DataFlash

YES

Increment page counter Return, Writing data to the DataFlash is done by writing first to a buffer and when this buffer is full writing it’s contents to one page of the main memory. In the subroutine “write_to_flash” the variable “j” represents the byte number in the buffer and the variable “k” the page number the buffer will be written to. If the new-data flag indicates that the DataFlash is empty, both counters are set to zero. If the memory already contains some data, the variables indicate the next free location in memory, which ensures that new data is directly appended to the memory contents. In order to preserve the contents of these variables across two function calls, they are declared as static variables. To write data to the buffer the CS line is driven low and the opcode 0x84 is loaded into the DataFlash. This is followed by 14 don’t care bits and the 10-bit address for the posi- tion within the buffer. Then the 8 bit data is entered. This sequence is transferred to the slave bytewise. After each byte the SPI Status Reg- ister (SPSR) is checked until the SPI Interrupt Flag indicates that the serial transfer is complete. After the whole sequence is written the CS line is driven high. If the buffer is full and there are empty pages left, the buffer is copied to the next page of the DataFlash. As the memory has been erased earlier, data can be written without additional erasing. If the memory is filled up a loop is executed until the “record” button is released. Any data recorded while the memory is full will be lost.

Playback In the subroutine “playback” the contents of the DataFlash are read out and modulated

as an 8-bit PWM, running at 15,686 Hz. To achieve higher speed, data is not read out directly from the main memory but alternately transferred to one of the two buffers and then read from the buffer. In the meantime the next memory page is copied into the other buffer. For the PWM the 16 bit Timer/Counter1 is used, with the PWM output on OC1B. This is defined in the Timer/Counter Control Registers A and B (TCCRA / TCCRB). For running the PWM at the highest possible frequency the PWM clock divider is set to 1. When the set-up is done the first page is copied into buffer 1 by driving the CS line low and transferring the appropriate commands to the DataFlash. The page to buffer trans- fer is started when the CS line is driven high again. When the Ready/Busy pin is driven high by the DataFlash, buffer 1 contains valid data. Then the next page transfer to buffer 2 is started. As both buffers are independent from each other, data can already be read from buffer 1 while the DataFlash is still busy copying data from the second page to buffer 2. For reading a byte from a buffer a dummy value has to be written to the DataFlash. A write action of the master to an SPI slave causes their SPI Data Register (SPDR) to be interchanged. After writing a dummy byte to the DataFlash the SPDR of the AVR micro- controller contains the output data from the DataFlash. 14 AVR335,

AVR335 Figure 15. Playback

Playback Set page counter to zero Initialize PWM Initialize SPI next page to next buffer next page NO to next buffer ready ?

YES

End of memory YES reached ?

NO

button NO for playback Stop PWM pressed ? YES Stop SPI Increment page counter Return next page to next buffer active buffer to speaker Toggle active buffer

When the PWM counter contains the value “0”, a Timer1 overflow interrupt occurs. This

interrupt is used to synchronize data output from the DataFlash to the PWM frequency.

When a value from the buffer has been shifted to the AVR microcontroller, a loop is per-

formed until the Timer1 overflow interrupt occurs. Then the data is written to the

Timer/Counter1 Output Compare Register B (OCR1B), being automatically latched to

the PWM output when the PWM counter contains its maximum value (255 for 8-bit

PWM). After the last value of the buffer is read, the active buffer is toggled. If the entire memory has been played back, all interrupts are disabled and the Timer/Counter1 is stopped.

,

Figure 16. Next Page to Next Buffer

next page to next buffer DataFlash YES busy?

NO

Enable DataFlash Transmit "page to buffer" opcode, page number and don't cares Disable DataFlash Return 16 AVR335,

AVR335 Figure 17. Active Buffer to Speaker

active buffer to speaker Set buffer counter to zero Enable DataFlash Transmit "buffer read" opcode, start buffer address and don't cares complete buffer YES read ?

NO

Send dummy value Enable DataFlash to DataFlash Return DataFlash NO busy ?

YES

Copy data from SPI data register to PWM data register Increment buffer counter,

Using the STK200 The application described in this note can be tested and modified using the STK200 Development Board Development Board. In this case some points have to be noticed. Chip Socket This application uses the A/D converter. Therefore the microcontroller has to be placed

in the socket labelled “A/D parts” and the microphone amplifier output connected to the header connectors labelled “Analog”.

Jumpers According to the set-up in the “setup_all” subroutine all jumpers on pins used for other

purposes than pushbuttons or the LED have to be removed. For the described applica- tion these are on Port B the jumpers 0 to 2 and 4 to 7 and on Port D jumper 4.

SPI resistors In order to avoid interference between the on-board SPI and devices connected to the

pin headers labelled “Port B” 10k resistors are inserted between the chip socket and the Port B headers PB 5 to PB 7. If the DataFlash is going to be connected to these Pin headers the resistors have to be bypassed by soldering a bridge across their connectors on the reverse side of the STK200.

Using the on board SPI Short circuiting the resistors between the chip socket and the Port B header connectors

may cause some problems if using the on-board SPI for program download and verifica- tion, when a device is connected to the Port B header connectors. If problems occur it will help either to disconnect the device during program download and verification, or to solder a 10k resistor between PB4 and VCC according to Figure 9.

Modification and The microphone output signal may vary depending on the type of microphone used. To Optimization achieve best results it is important to choose the microphone amplifier gain that delivers

a maximum output signal closest to AREF. Data is written into the DataFlash almost as it is read from the A/D converter. Compress- ing this data might be possible and useful if a longer recording time or a stereo signal is required. In this application two ways of implementing a status flag are shown. One way is to use a global variable (i.e. the “wait” variable used in the “playback” sub- routine). The other way is to use an unused bit in a register. In the “erase” subroutine the ACIS1 bit of the Analog Comparator Control And Status Register (ACSR) is used to indi- cate that new data has to be stored next. As long as the analog comparator is not used this does not have any negative effects on the program performance, but frees one reg- ister from a blocking global variable. The sampling frequency of 15,686 Hz (respectively 510 clock cycles) is generated by an ADC interrupt and a delay loop. This can be replaced by an independent timer (Timer/Counter0 or Timer/Counter2), if they are not used on other purposes.

References • Proakis, J.G. and Manolakis, D.G. (1992)

Digital Signal Processing: Principles, Algorithms, and Applications Second Edition • Datasheets: – ATMEL AVR ATmega8535 – ATMEL AT45DB161 Serial DataFlash 18 AVR335,

AVR335 Resources

Table 1. Peripheral Usage Peripheral Description Interrupts Timer 1 8-bit PWM Timer 1 Overflow (PWM counter at zero) 3 I/O pins PORT B SPI to access DataFlash 4 I/O pins PORT B DataFlash control lines 1 I/O pin PORT B Status LED 1 I/O pin PORT A ADC input A/D conversion ready 3 I/O pins PORT D pushbuttons 1 I/O pin PORT D PWM output

Bill of Materials

Table 2. Microcontroller and Memory Circuit Component Value Description R1 10K Pull-up resistor for DataFlash “Chip Select” line R2 1K LED resistor R3 100Ω Analog voltage filter resistor LED Status indicator C1, C2 22pF Clock signal circuit capacitors C3 100nF Analog voltage filter capacitor Oscillator Crystal 8MHz Clock signal generation DataFlash AT45DB161 16-Mbit single supply nonvolatile memory AVR ATmega8535 Enhanced RISC flash microcontroller Table 3. Microphone and Speaker Circuit Component Value Description R1 10K Feedback resistor for microphone amplifier R2 10K Offset for microphone amplifier R3 10K Offset for microphone amplifier R4 1K Microphone power resistor R5 12K Microphone RC filter resistor R6 5K Chebychev filter resistor R7 1K8 Chebychev filter resistor R8 470R Chebychev filter resistor R9 1K Input resistor for microphone amplifier R10 15K Chebychev filter resistor R11 12K Earphones RC filter resistor, Table 3. Microphone and Speaker Circuit (Continued) Component Value Description C1 1µF AC coupling for microphone C2 1µF Chebychev filter capacitor C3 1µF AC coupling for earphones C4 22nF Earphones RC filter capacitor C5 100nF Chebychev filter capacitor C6 100nF De-coupling capacitor C7 1nF Chebychev filter capacitor C8 4.7nF Earphones RC filter capacitor C9 2.2nF Chebychev filter capacitor U1 LM324 Quad Op-Amp 2 standard jack sockets 3.5 mm Microphone Standard PC microphone with 3.5 mm connector Earphones Standard with 3.5 mm connector 20 AVR335,

AVR335 Sample C-Code

/* Check the Atmel Website for latest version of the code. /* Erase all pages if desired. Write data to buffer 1. If buffer is full, write buffer to page. Read DataFlash alternating through buffer1 and buffer2 into the data register. */ #include “io8535.h” #include #include “stdlib.h” #include “dataflash.h” // prototypes void setup (void); void erasing (void); void recording (void); void interrupt[ADC_vect] sample_ready (void); void write_to_flash (unsigned char ad_data); void playback (void); void next_page_to_next_buffer (unsigned char active_buffer, unsigned int page_counter); void interrupt[TIMER1_OVF1_vect] out_now(void); void active_buffer_to_speaker (unsigned char active_buffer); // global variables volatile unsigned char wait = 0; void setup(void) { DDRB = 0xBD; // SPI Port initialisation // SCK, MISO, MOSI, CS, LED, WP , RDYBSY, RST // PB7, PB6, PB5, PB4, PB3, PB2 , PB1, PB0 // OIOOOOIO// 10111101PORTB = 0xFF; // all outputs high, inputs have pullups (LED is off) DDRA = 0x00; // define port A as an input PORTA = 0x00; DDRD = 0x10; // define port D as an input (D4: output) _SEI(); // enable interrupts } void erasing(void) { unsigned int block_counter = 0; unsigned char temp = 0x80;, ACSR |= 0x02; // set signal flag that new data has to be recorded next // interrupt disabled, SPI port enabled, master mode, MSB first, SPI mode 3, Fcl/4 SPCR = 0x5C; while (block_counter < 512) { PORTB &= ~DF_CHIP_SELECT; // enable DataFlash SPDR = BLOCK_ERASE; while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = (char)(block_counter>>3); while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = (char)(block_counter<<5); while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = 0x00; // don’t cares while (!(SPSR & temp)); // wait for data transfer to be completed PORTB |= DF_CHIP_SELECT; // disable DataFlash block_counter++; while(!(PINB & 0x02)); // wait until block is erased } SPCR = 0x00; //disable SPI } void recording(void) { // interrupt disabled, SPI port enabled, master mode, MSB first, SPI mode 3, Fcl/4 SPCR = 0x5C; ADMUX = 0x00; // A/D converter input pin number = 0 ADCSR = 0xDD; // single A/D conversion, fCK/32, conversion now started while (!(PIND & 8)); // loop while button for recording (button 3) is pressed ADCSR = 0x00; // disable AD converter SPCR = 0x00; // disable SPI } void interrupt[ADC_vect] sample_ready(void) { unsigned char count = 0; while (count < 6) count++; // wait some cycles ADCSR |= 0x40; // start new A/D conversion write_to_flash(ADC-0x1D5); // read data, convert to 8 bit and store in flash } void write_to_flash(unsigned char flash_data) 22 AVR335,

AVR335

{ static unsigned int buffer_counter; static unsigned int page_counter; unsigned char temp = 0x80; if((ACSR & 0x02)) // if flag is set that new data has to be written { buffer_counter = 0; page_counter = 0; // reset the counter if new data has to be written ACSR &= 0xFD; // clear the signal flag } while(!(PINB & 0x02)); // check if flash is busy PORTB &= ~DF_CHIP_SELECT; // enable DataFlash SPDR = BUFFER_1_WRITE; while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = 0x00; // don’t cares while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = (char)(buffer_counter>>8); // don’t cares plus first two bits of buffer address while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = (char)buffer_counter; // buffer address (max. 2^8 = 256 pages) while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = flash_data; // write data into SPI Data Register while (!(SPSR & temp)); // wait for data transfer to be completed PORTB |= DF_CHIP_SELECT; // disable DataFlash buffer_counter++; if (buffer_counter > 528) // if buffer full write buffer into memory page { buffer_counter = 0; if (page_counter < 4096) // if memory is not full { PORTB &= ~DF_CHIP_SELECT; // enable DataFlash SPDR = B1_TO_MM_PAGE_PROG_WITHOUT_ERASE; // write data from buffer1 to page while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = (char)(page_counter>>6); while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = (char)(page_counter<<2); while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = 0x00; // don’t cares while (!(SPSR & temp)); // wait for data transfer to be completed PORTB |= DF_CHIP_SELECT; // disable DataFlash page_counter++;, } else { PORTB |= 0x08; // turn LED off while (!(PIND & 8)); // wait until button for recording (button 3) is released } } } void playback(void) { unsigned int page_counter = 0; unsigned int buffer_counter = 0; unsigned char active_buffer = 1; // active buffer = buffer1 unsigned char temp = 0x80; TCCR1A = 0x21; // 8 bit PWM, using COM1B TCNT1 = 0x00; // set counter1 to zero TIFR = 0x04; // clear counter1 overflow flag TIMSK = 0x04; // enable counter1 overflow interrupt TCCR1B = 0x01; // counter1 clock prescale = 1 OCR1B = 0x00; // set output compare register B to zero // interrupt disabled, SPI port enabled, master mode, MSB first, SPI mode 3, Fcl/4 SPCR = 0x5C; next_page_to_next_buffer (active_buffer, page_counter); // read page0 to buffer1 while (!(PINB & 0x02)); // wait until page0 to buffer1 transaction is finished while ((page_counter < 4095)&(!(PIND & 2))) // while button for playback (button 1) is pressed { page_counter++; // now take next page next_page_to_next_buffer (active_buffer, page_counter); active_buffer_to_speaker (active_buffer); if (active_buffer == 1) // if buffer1 is the active buffer { active_buffer++; // set buffer2 as active buffer } else // else { active_buffer-; // set buffer1 as active buffer } } TIMSK = 0x00; // disable all interrupts TCCR1B = 0x00; // stop counter1 SPCR = 0x00; // disable SPI 24 AVR335,

AVR335

} void next_page_to_next_buffer (unsigned char active_buffer, unsigned int page_counter) { unsigned char temp = 0x80; while(!(PINB & 0x02)); // wait until flash is not busy PORTB &= ~DF_CHIP_SELECT; // enable DataFlash if (active_buffer == 1) // if buffer1 is the active buffer { SPDR = MM_PAGE_TO_B2_XFER; // transfer next page to buffer2 } else // else { SPDR = MM_PAGE_TO_B1_XFER; // transfer next page to buffer1 } while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = (char)(page_counter >> 6); while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = (char)(page_counter << 2); while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = 0x00; // write don’t care byte while (!(SPSR & temp)); // wait for data transfer to be completed PORTB |= DF_CHIP_SELECT; // disable DataFlash and start transaction } void interrupt[TIMER1_OVF1_vect] out_now(void) { wait = 0; // an interrupt has occured } void active_buffer_to_speaker (unsigned char active_buffer) { // until active buffer not empty read active buffer to speaker unsigned int buffer_counter = 0; unsigned char temp = 0x80; PORTB &= ~DF_CHIP_SELECT; // enable DataFlash if (active_buffer == 1) // if buffer1 is the active buffer { SPDR = BUFFER_1_READ; // read from buffer1 } else // else, { SPDR = BUFFER_2_READ; // read from buffer2 } while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = 0x00; // write don’t care byte while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = 0x00; // write don’t care byte while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = 0x00; // start at buffer address 0 while (!(SPSR & temp)); // wait for data transfer to be completed SPDR = 0x00; // write don’t care byte while (!(SPSR & temp)); // wait for data transfer to be completed while (buffer_counter < 528) { SPDR = 0xFF; // write dummy value to start register shift while (!(SPSR & temp)); // wait for data transfer to be completed while(wait); // wait for timer1 overflow interrupt OCR1B = SPDR; // play data from shift register wait = 1; // clear the signal flag buffer_counter++; } PORTB |= DF_CHIP_SELECT; // disable DataFlash } void main(void) { setup(); for(;;) { if (!(PIND & 8)) // if button for recording (button 3) is pressed { PORTB &= 0xF7; // turn LED on recording(); } if (!(PIND & 4)) // if button for erasing (button 2) is pressed { PORTB &= 0xF7; // turn LED on erasing(); while (!(PIND & 4)); // wait until button for erasing (button 2) is released } if (!(PIND & 2)) // if button for playback (button 1) is pressed { PORTB &= 0xF7; // turn LED on playback(); while (!(PIND & 2)); // wait until button for playback (button 1) is released } PORTB |= 0x08; // turn LED off while running idle 26 AVR335,

AVR335

} }

DataFlash.h

// changed on 19.04.1999 // for use with the 8535 #include “ina90.h” #pragma language=extended // DataFlash reset port pin (PB 0) #define DF_RESET 0x01 // DataFlash ready/busy status port pin (PB 1) #define DF_RDY_BUSY 0x02 // DataFlash boot sector write protection (PB 2) #define DF_WRITE_PROTECT 0x04 // DataFlash chip select port pin (PB 4) #define DF_CHIP_SELECT 0x10 // buffer 1 #define BUFFER_1 0x00 // buffer 2 #define BUFFER_2 0x01 // defines for all opcodes // buffer 1 write #define BUFFER_1_WRITE 0x84 // buffer 2 write #define BUFFER_2_WRITE 0x87 // buffer 1 read #define BUFFER_1_READ 0x54 // buffer 2 read #define BUFFER_2_READ 0x56 // buffer 1 to main memory page program with built-in erase #define B1_TO_MM_PAGE_PROG_WITH_ERASE 0x83 // buffer 2 to main memory page program with built-in erase #define B2_TO_MM_PAGE_PROG_WITH_ERASE 0x86, // buffer 1 to main memory page program without built-in erase #define B1_TO_MM_PAGE_PROG_WITHOUT_ERASE 0x88 // buffer 2 to main memory page program without built-in erase #define B2_TO_MM_PAGE_PROG_WITHOUT_ERASE 0x89 // main memory page program through buffer 1 #define MM_PAGE_PROG_THROUGH_B1 0x82 // main memory page program through buffer 2 #define MM_PAGE_PROG_THROUGH_B2 0x85 // auto page rewrite through buffer 1 #define AUTO_PAGE_REWRITE_THROUGH_B1 0x58 // auto page rewrite through buffer 2 #define AUTO_PAGE_REWRITE_THROUGH_B2 0x59 // main memory page compare to buffer 1 #define MM_PAGE_TO_B1_COMP 0x60 // main memory page compare to buffer 2 #define MM_PAGE_TO_B2_COMP 0x61 // main memory page to buffer 1 transfer #define MM_PAGE_TO_B1_XFER 0x53 // main memory page to buffer 2 transfer #define MM_PAGE_TO_B2_XFER 0x55 // DataFlash status register for reading density, compare status, // and ready/busy status #define STATUS_REGISTER 0x57 // main memory page read #define MAIN_MEMORY_PAGE_READ 0x52 // erase a 528 byte page #define PAGE_ERASE 0x81 // erase 512 pages #define BLOCK_ERASE 0x50 #define TRUE 0xff #define FALSE 0x00 28 AVR335,

Atmel Corporation Atmel Operations

2325 Orchard Parkway Memory RF/Automotive San Jose, CA 95131, USA 2325 Orchard Parkway Theresienstrasse 2 Tel: 1(408) 441-0311 San Jose, CA 95131, USA Postfach 3535 Fax: 1(408) 487-2600 Tel: 1(408) 441-0311 74025 Heilbronn, Germany Fax: 1(408) 436-4314 Tel: (49) 71-31-67-0 Fax: (49) 71-31-67-2340

Regional Headquarters Microcontrollers

Europe 2325 Orchard Parkway 1150 East Cheyenne Mtn. Blvd. Atmel Sarl San Jose, CA 95131, USA Colorado Springs, CO 80906, USA Route des Arsenaux 41 Tel: 1(408) 441-0311 Tel: 1(719) 576-3300 Case Postale 80 Fax: 1(408) 436-4314 Fax: 1(719) 540-1759 CH-1705 Fribourg Switzerland La Chantrerie Biometrics/Imaging/Hi-Rel MPU/ Tel: (41) 26-426-5555 BP 70602 High Speed Converters/RF Datacom Fax: (41) 26-426-5500 44306 Nantes Cedex 3, France Avenue de Rochepleine Tel: (33) 2-40-18-18-18 BP 123 Asia Fax: (33) 2-40-18-19-60 38521 Saint-Egreve Cedex, France Room 1219 Tel: (33) 4-76-58-30-00 Chinachem Golden Plaza ASIC/ASSP/Smart Cards Fax: (33) 4-76-58-34-80 77 Mody Road Tsimshatsui Zone Industrielle East Kowloon 13106 Rousset Cedex, France Hong Kong Tel: (33) 4-42-53-60-00 Tel: (852) 2721-9778 Fax: (33) 4-42-53-60-01 Fax: (852) 2722-1369 1150 East Cheyenne Mtn. Blvd. Japan Colorado Springs, CO 80906, USA 9F, Tonetsu Shinkawa Bldg. Tel: 1(719) 576-3300 1-24-8 Shinkawa Fax: 1(719) 540-1759 Chuo-ku, Tokyo 104-0033 Japan Scottish Enterprise Technology Park Tel: (81) 3-3523-3551 Maxwell Building Fax: (81) 3-3523-7581 East Kilbride G75 0QR, Scotland Tel: (44) 1355-803-000 Fax: (44) 1355-242-743 Literature Requests www.atmel.com/literature Disclaimer: Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company’s standard warranty which is detailed in Atmel’s Terms and Conditions located on the Company’s web site. The Company assumes no responsibility for any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and does not make any commitment to update the information contained herein. No licenses to patents or other intellectual property of Atmel are granted by the Company in connection with the sale of Atmel products, expressly or by implication. Atmel’s products are not authorized for use as critical components in life support devices or systems. © Atmel Corporation 2003. All rights reserved. Atmel® and combinations thereof, AVR®, and AVR Studio® are the registered trademarks of Atmel Corporation or its subsidiaries. Microsoft®, Windows®, Windows NT®, and Windows XP® are the registered trademarks of Microsoft Corpo- ration. Other terms and product names may be the trademarks of others Printed on recycled paper.]
15

Similar documents

USB in a Nutshell. Making Sense of the USB Standard.
USB in a Nutshell. Making Sense of the USB Standard. Starting out new with USB can be quite daunting. With the USB 2.0 specification at 650 pages one could easily be put off just by the sheer size of the standard. This is only the beginning of a long list of associated standards for USB. There are U
What is USB Enumeration? What does enumeration look like?
What is USB Enumeration? Enumeration is the process by which a USB device is attached to a system and is assigned a specific numerical address that will be used to access that particular device. It is also the time at which the USB host controller queries the device in order to decide what type of d
Draft
CYCLIC REDUNDANCY CHECKS IN USB Introduction The USB specification calls for the use of Cyclic Redundancy Checksums (CRC) to protect all non-PID fields in token and data packets from errors during transmission. This paper describes the mathematical basis behind CRC in an intuitive fashion and then e
File: X:\USERS\IGOR\DOC\WORD\Atmel\USB to RS232 Application Note\Firmware\USBtoRS232_ATmega8\AVR Studio 4 project\USBtoRS232.asm 1.2.2004
1 ;*************************************************************************** 2 ;* USBSTACKFORTHEAVRFAMILY3;* 4 ;* File Name :"USBtoRS232.asm" 5 ;* Title :AVR309:USB to UART protocol converter 6 ;* Date :01.02.2004 7 ;* Version :2.8 8 ;* Target MCU :ATmega8 9 ;* AUTHOR :Ing. Igor Cesko 10 ;* Slovak
File: X:\USERS\IGOR\DOC\WORD\Atmel\USB to RS232 Application Note\Firmware\USBtoRS232_AT90S2313\AVR Studio 4 project\USB90S2313.asm 26.1.2004
1 ;*************************************************************************** 2 ;* USBSTACKFORTHEAVRFAMILY3;* 4 ;* File Name :"USB90S2313.asm" 5 ;* Title :AVR309:USB to UART protocol converter (simple - small FIFO) 6 ;* Date :26.01.2004 7 ;* Version :2.2 8 ;* Target MCU :AT90S2313-10 9 ;* AUTHOR :I
AVR309: Software Universal Serial Bus (USB)
AVR309: Software Universal Serial Bus (USB) Features • USB (Universal Serial Bus) protocol implemented in firmware • Supports Low Speed USB (1.5Mbit/s) in accordance with USB2.0 • Implementation runs on very small AVR devices, from 2kBytes and up • Few external components required - One resistor for
Application Note
8-bit Microcontrollers Application Note AVR270: USB Mouse Demonstration Features • Runs with AT90USB Microcontrollers at 8MHz • USB Low Power Bus Powered Device (less then 100mA) • Supported by any PC running Windows® (98SE or later), Linux® or Mac OS®. • 3Kbytes of Code Required • X, Y Movement, Le
8-bit Microcontroller Application Note
8-bit Microcontroller Application Note Rev. 2547A–AVR–11/03 AVR244: AVR UART as ANSI Terminal Interface Features • Make use of standard terminal software as user interface to your application. • Enables use of a PC keyboard as input and ascii graphic to display status and control information. • Driv
MPASM USER'S GUIDE with MPLINK and MPLIB MPASM USER'S GUIDE with MPLINK and MPLIB
Adjust Spine to fit MPASM USER'S GUIDE with MPLINK and MPLIB Microchip Technology Inc. 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 602.786.7200 Fax: 602.899.9210 © 1999 Microchip Technology Inc., Printed in the U.S.A. 3/99 DS33014 MPASM USER'S GUIDE with MPLINK and MPLIB Information only.
Microcontroller Core Features: RA5/SS/AN4 7 34 RB1RE0/RD/AN5 8 33 RB0/INT
Device Pins A/D PSP Pin Diagram PIC16C63A 28 NO NO PDIP, Windowed CERDIP PIC16C73B 28 YES NO MCLR/VPP 1 40 RB7 PIC16C65B 40 NO YES RA0/AN0 2 39 RB6 RA1/AN1 3 38 RB5 PIC16C74B 40 YES YES RA2/AN2 4 37 RB4 RA3/AN3/VREF 5 36 RB3 RA4/T0CKI 6 35 RB2 Microcontroller Core Features: RA5/SS/AN4 7 34 RB1RE0/RD
PACKAGE OPTION ADDENDUM
PCM2704 and PCM2705 Not Recommended For New Designs PCM2704, PCM2705 PCM2706, PCM2707 Burr-Brown Audio www.ti.com... SLES081F–JUNE 2003–REVISED JANUARY 2009 STEREO AUDIO DAC WITH USB INTERFACE, SINGLE-ENDED HEADPHONE OUTPUT AND S/PDIF OUTPUT 1FEATURES – External ROM Interface (PCM2704/6) 2345• On-Ch
14 + 14W STEREO AMPLIFIER WITH MUTE & ST-BY
TDA7269A 14 + 14W STEREO AMPLIFIER WITH MUTE & ST-BY WIDE SUPPLY VOLTAGE RANGE UP TO ±20V SPLIT SUPPLY HIGH OUTPUT POWER 14 + 14W @ THD =10%, RL = 8Ω, VS = +16V NO POP AT TURN-ON/OFF MUTE (POP FREE) STAND-BY FEATURE (LOW Iq) SHORT CIRCUIT PROTECTION TO GND THERMAL OVERLOAD PROTECTION Multiwatt11 OR
FOREWORD This repair manual has been prepared to provide essential in-
FOREWORD This repair manual has been prepared to provide essential in- formation on body panel repair methods (including cutting and welding operations, but excluding painting) for the TOYOTA YARIS. Applicable models: KSP90 series Applicable models: NCP90, 91 series This manual consists of body repa
MPASM and MPLINK PICmicro® QUICK REFERENCE GUIDE
MPASM and MPLINK PICmicro® QUICK REFERENCE GUIDE The Embedded Control Solutions Company® MPASM Quick Reference Guide This Quick Reference Guide gives all the instructions, directives, and command line options for the Microchip MPASM Assembler. MPASM Directive Language Summary Directive Description S
M INTRODUCTION
M Author: Mark Palmer Microchip Technology Inc. INTRODUCTION The PICmicro™ families of RISC microcontrollers are designed to provide advanced performance and a cost-effective solution for a variety of applications. To address these applications, there is the PIC16CXXX microcontroller family of produ
M ENGINE ON-VEHICLE INSPECTION ASSEMBLY
1NZ-FE ENGINE MECHANICAL – ENGINE EM–1 M ENGINE ON-VEHICLE INSPECTION 1. INSPECT ENGINE COOLANT (See page CO-1) 2. INSPECT ENGINE OIL (See page LU-1) 3. INSPECT BATTERY (See page CH-4) 4. INSPECT AIR CLEANER FILTER ELEMENT SUB- ASSEMBLY (a) Remove the air cleaner filter element sub-assembly. (b) Vis
FOREWORD This wiring diagram manual has been prepared to provide information on the electrical system of the 2007 YARIS. Applicable models: NCP91, 93 Series
FOREWORD This wiring diagram manual has been prepared to provide information on the electrical system of the 2007 YARIS. Applicable models: NCP91, 93 Series Refer to the following manuals for additional service specifications and repair procedures for these models: Manual Name Pub. No. 2007 YARIS Re
X AUTOMATIC TRANSAXLE SYSTEM PRECAUTION
U340E AUTOMATIC TRANSAXLE – AUTOMATIC TRANSAXLE SYSTEM AX–1 X AUTOMATIC TRANSAXLE SYSTEM PRECAUTION NOTICE: • Perform the RESET MEMORY (AT initialization) when replacing the automatic transaxle assembly, engine assembly or ECM (See page AX-14). • Perform the REGISTRATION (VIN registration) when repl
ON Semiconductor 2N5550 Amplifier Transistors NPN Silicon 2N5551*
ON Semiconductor 2N5550 Amplifier Transistors NPN Silicon 2N5551* *ON Semiconductor Preferred Device MAXIMUM RATINGS Rating Symbol 2N5550 2N5551 Unit Collector–Emitter Voltage VCEO 140 160 Vdc Collector–Base Voltage VCBO 160 180 Vdc Emitter–Base Voltage VEBO 6.0 Vdc Collector Current — Continuous IC
GENERAL DESCRIPTION QUICK REFERENCE DATA PINNING - TO92 variant PIN CONFIGURATION SYMBOL
GENERAL DESCRIPTION QUICK REFERENCE DATA Glass passivated sensitive gate SYMBOL PARAMETER MAX. UNIT thyristor in a plastic envelope, intended for use in general purpose VDRM, Repetitive peak off-state voltages 200 V switching and phase control VRRM applications. This device is intended IT(AV) Averag
N-Channel JFETs
N-Channel JFETs 2N4117A PN4117A SST4117 2N4118A PN4118A SST4118 2N4119A PN4119A SST4119 Part Number VGS(off) (V) V(BR)GSS Min (V) gfs Min (S) IDSS Min (A) 4117 –0.6 to –1.8 –40 70 30 4118 –1 to –3 –40 80 80 4119 –2 to –6 –40 100 200 Ultra-Low Leakage: 0.2 pA Insignificant Signal Loss/Error Voltage
Order this document SEMICONDUCTOR TECHNICAL DATA by 2N3903/D NPN Silicon
Order this document SEMICONDUCTOR TECHNICAL DATA by 2N3903/D NPN Silicon *Motorola Preferred Device COLLECTOR BASE EMITTER 1 MAXIMUM RATINGS Rating Symbol Value Unit CASE 29–04, STYLE 1 TO–92 (TO–226AA) Collector–Emitter Voltage VCEO 40 Vdc Collector–Base Voltage VCBO 60 Vdc Emitter–Base Voltage VEB
DISCRETE SEMICONDUCTORS DATA SHEET 2N2222; 2N2222A NPN switching transistors Product specification 1997 May 29 Supersedes data of September 1994 File under Discrete Semiconductors, SC04
DISCRETE SEMICONDUCTORS DATA SHEET M3D125 2N2222; 2N2222A NPN switching transistors Product specification 1997 May 29 Supersedes data of September 1994 File under Discrete Semiconductors, SC04 FEATURES PINNING • High current (max. 800 mA) PIN DESCRIPTION • Low voltage (max. 40 V). 1 emitter 2 base A
Small-signal Transistors Selection guide
Philips Semiconductors Small-signal Transistors Selection guide V TYPE CEO IC Ptot fhhTPNP PACKAGE max. max. max. FE FE min. PAGE NUMBER min. max. COMPL. (V) (mA) (mW) (MHz) BC846 SOT23 65 100 250 110 450 100 BC856 305 BC846A SOT23 65 100 250 110 220 100 BC856A 305 BC846AT SC-75 65 100 150 110 220 1
Small-signal Transistors Selection guide
Philips Semiconductors Small-signal Transistors Selection guide SURFACE-MOUNT DEVICES NPN GENERAL PURPOSE LOW-POWER TRANSISTORSVIPfTYPE CEO C tothhTPNP PACKAGE max. max. max. FE FE min. PAGE NUMBER min. max. COMPL. (V) (mA) (mW) (MHz) 2PC4081 SC-70 40 100 200 120 560 100 2PA1576 210 2PC4081Q SC-70 4
Small-signal Transistors Selection guide
Philips Semiconductors Small-signal Transistors Selection guide LEADED DEVICES (continued) NPN HIGH-VOLTAGE POWER TRANSISTORSVIPfTYPE CEO C tothhTPACKAGE max. max. max. FE FE PNP min. PAGE NUMBER min. max. COMPL. (V) (mA) (mW) (MHz) BF419 TO-126 250 300 6000 45 typ. >45 90 – 532 BF457 TO-126 160 100
DISCRETE SEMICONDUCTORS DATA SHEET 1PS302 High-speed double diode Product specification 1996 Apr 03 File under Discrete Semiconductors, SC01
DISCRETE SEMICONDUCTORS DATA SHEET handbook, halfpage M3D114 1PS302 High-speed double diode Product specification 1996 Apr 03 File under Discrete Semiconductors, SC01 FEATURES DESCRIPTION PINNING • Very small plastic SMD package The 1PS302 consists of two PIN DESCRIPTION • High switching speed: max.
Small-signal Transistors Selection guide
Philips Semiconductors Small-signal Transistors Selection guide LEADED DEVICES NPN GENERAL PURPOSE LOW-POWER TRANSISTORSVIPfTYPE CEO C tothhTPACKAGE max. max. max. FE FE PNP min. PAGE NUMBER min. max. COMPL. (V) (mA) (mW) (MHz) 2N2484 TO-18 60 50 360 250 800 60 – 131 2N4124 TO-92 25 200 500 120 360
DISCRETE SEMICONDUCTORS DATA SHEET 1PS301 High-speed double diode Product specification 1996 Apr 03 File under Discrete Semiconductors, SC01
DISCRETE SEMICONDUCTORS DATA SHEET handbook, halfpage M3D114 1PS301 High-speed double diode Product specification 1996 Apr 03 File under Discrete Semiconductors, SC01 FEATURES DESCRIPTION PINNING • Very small plastic SMD package The 1PS301 consists of two PIN DESCRIPTION • High switching speed: max.
DISCRETE SEMICONDUCTORS DATA SHEET 1PS300 High-speed double diode Product specification 1996 Apr 03 File under Discrete Semiconductors, SC01
DISCRETE SEMICONDUCTORS DATA SHEET handbook, halfpage M3D114 1PS300 High-speed double diode Product specification 1996 Apr 03 File under Discrete Semiconductors, SC01 FEATURES DESCRIPTION PINNING • Very small plastic SMD package The 1PS300 consists of two PIN DESCRIPTION • High switching speed: max.