AT85C51SND3B1 ATMEL | Alldatasheet
Document overview
- Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
- PDF pages: 263
Technical content
Features
Audio Processor – Proprietary Digital Signal Processor – MP3 (Full MPEG I/II-Layer 3) Decoder (1) – Windows Media ® Audio (WMA) Decoder (1) – OGG (Vorbis) Decoder (2) – WAV PCM Decoder/Encoder – ADPCM Decoder/Encoder (G726: 40, 32, 24, 16 Kbps) Audio Codec – 16-bit Stereo D/A Converters(3) – Headphone Amplifier with Analog Volume Control(3) – Microphone Pre-Amplifier with Bias Control – 16-bit Mono A/D Converter: Microphone or Line Inputs Recording – Stereo Lines Input for FM Playback or Mono Recording – Baseband Sound Processor with Digital Volume Control, Bass, Medium, and Treble Control, Bass Boost and Virtual Surround Effects Digital Audio DAC Interface –P C M / I2S Format Compatible USB Rev 2.0 Controller – High Speed Mode (480 Mbps) – Full Speed Mode (12 Mbps) – On The Go Full Speed Mode Data Flow Controller – 16-bit Multimedia Bus with 2 DMA Channels for high speed transfer with USB Nand Flash Controller – Up to four Memories with Page Size: 512B, 1KB, 2KB or 4KB – Built-in ECC and Hardware Write Protection – xD-Picture Card™ and SmartMedia ® Card Interface MultiMediaCard® Controller – MultiMediaCard 1-bit / 4-bits Modes (V4.0 compatible) – Secure Digital Card 1-bit / 4-bit Modes Man Machine Interface – Glueless Generic LCD Interface – Keyboard Interface Remote Controlled / Streaming – PSI I80 Slave Interface (EBI Compatible) up to 6Mbyte/s – SPI Master and Slave Modes – Full Duplex UART with Baud Rate Generator up to 6 Mbit/s (Rx, Tx, RTS, CTS) Control Processor – Enhanced 8-bit MCU C51 Core (FMAX = 24 MHz) – 64K Bytes of Internal RAM for application code and data – Boot ROM Memory: Secured Nand Flash Boot Strap (standard), USB Boot Loader – Two 16-bit Timers/Counters – Hardware Watchdog Timer Power Management – 1.8V 40 mA Single AAA or AA Battery Powered(4) – Direct USB VBUS Supply – 3V - 50 mA Regulator Output – 1.8V - 50 mA Regulator Output – Battery Voltage Monitoring – Power-on Reset – Software Programmable MCU Clock – Idle, Power-Down, Power-Off Modes On Chip Debug Operating Conditions – Supply 0.9V to 5V – 25 mA Typical Operating at 25°C (estimation to be confirmed) – Temperature Range: -40°C to +85°C Single-Chip Digital Audio Decoder - Encoder with USB 2.0 Interface AT85C51SND3B1 AT85C51SND3B2 AT85C51SND3B3 Preliminary
2 AT85C51SND3Bx
7632A–MP3–03/06 Packages – LQFP100, BGA100, Dice Notes: 1. See Ordering Information 2. Future product 3. AT85C51SND3B2 & AT85C51SND3B3 only 4. AT85C51SND3B3 only Description Digital Music Players, Mobile Phones need ready to use low-cost solutions for very fast time to market. The AT85C51SND3Bx with associated firmware embeds in a single chip all features, hardware and software, for Digital Music Players, Mobile Phones and Car Audio Systems: MP3 decoder, WMA decoder, Display interface, serial interface, parallel interface, USB high speed and USB host. Close to a plug and play solution for most applications, the AT85C51SND3Bx drastically reduces system development for the best time to market. The AT85C51SND3Bx han dles full file system management with Nand Flash and Flash Cards, including full detection and operation of a thumb drive. The AT85C51SND3A is used either as a mas ter controller, or as a slave controller interfacing easily with most of the base-band or host processors available on the market. In addition to the MP3 and WMA format, the AT85C51SND3Bx associated firmware will also later support, the OGG format, basic MIDI features for low cost mobile phones and JPEG still pictures decoding. The AT85C51SND3B is ideally fitting mass production markets. The AT85C51SND3Bx includes Power Management with: 5V USB VBUS direct supply, Nand Flash or Flash Card can be supplied by the AT85C51SND3B at 1.8V or 3V. The AT85C51SND3Bx supports many applications including: mobile phones, music players, portable navigation, car audio, music in shopping centers, applications includ ing MMC/SD Flash Cards in Industrial applications. To facilitate custom applications with the AT85C51SND3Bx, a development kit AT85DVK-07 is available with hardware and firmware database. Key Features Firmware to support –M P 3 –W M A – ADPCM/WAV voice or line recording – and coming soon OGG, MIDI and JPEG Decoder Audio Codec – Internal DAC – FM inputs Memory Support – Up to 4x Nand-Flash – SD/MMC cards U S B – High Speed, Full Speed – OTG (reduced Host)
Figure 1. AT85C51SND3Bx Block Diagram
- AT85C51SND3B2 & AT85C51SND3B3 only
4 AT85C51SND3Bx
7632A–MP3–03/06
Application Information
The AT85C51SND3Bx allow design of 2 typical applications which differentiate by the power supply voltage: The Very Low Voltage System The player operates at 1.8V and allows very low power consumption. The Low Voltage System The player operates at 3V and allows low power consumption. Very Low Voltage 1.8V System Figure 2. Typical Very Low Voltage 1.8V Application
Figure 3. Typical Low Voltage 3V Application
6 AT85C51SND3Bx
Figure 4. AT85C51SND3Bx 100-pin QFP Package
- Leave these pins unconnected for AT85C51SND3B1 product
Table 2. Ports Signal Description to be reset by connecting a capacitor between this pin and VSS . returns the chip to normal operation. reaches its time-out period. P2 is an 8-bit bidirectional I/O port with internal pull-ups. P3 is a 7-bit bidirectional I/O port with internal pull-ups.
8 AT85C51SND3Bx
Table 3. Timer 0 and Timer 1 Signal Description P4 is a 7-bit bidirectional I/O port with internal pull-ups. P5 is a 4-bit bidirectional I/O port with internal pull-ups.
Table 6. Nand Flash / SmartMedia Card Controller Signal Description pin. X1 is the clock source for internal timing. this pin. If an external oscillator is used, leave X2 unconnected. signal and SDDAT3:1 are not used and can be reused as I/O ports. the card is present in its slot. Note: This signal is generated by the SD/MMC card connector. indicates the card is write protected. Note: This signal is generated by the SD/MMC card connector.
10 AT85C51SND3Bx
7632A–MP3–03/06 USB Controller Table 7. USB Controller Signal Description NFCLE O Command Latch Enable Signal Asserted high during command write cycle. - NFRE O Read Enable Signal Read signal asserted low during NF/SMC read operation. - NFWE O Write Enable Signal Write signal asserted low during NF/SMC write operation. - NFCE0 O Nand Flash 0 Chip Enable NFCE0 is active low and is asserted by the nand flash controller each time it makes access to the device 0. NFCE1 SMLCK O I Nand Flash 1 Chip Enable NFCE1 is active low and is asserted by the nand flash controller each time it makes access to the selected device. SmartMediaCard/xD-Picture Card Write Lock Signal SMLCK is the card write protected input. A low level on this pin indicates the card is write protected. Note: When used as SMLCK input, pad has internal pull-up. P4.4 NFCE2 SMINS O I Nand Flash 2 Chip Enable NFCE2 is active low and is asserted by the nand flash controller each time it makes access to the selected device. SmartMediaCard/xD-Picture Card Insertion Signal SMINS is the card presence signal. A low level on this input indicates the card is present in its slot. Note: When used as SMINS input, pad has internal pull-up. P4.5 NFCE3 SMCE O Nand Flash 3 Chip Enable NFCE3 is active low and is asserted by the nand flash controller each time it makes access to the selected device. SmartMediaCard/xD-Picture Card Chip Enable SMCE is active low and is asserted by the nand flash controller each time it makes access to the card. P4.6 NFWP O Write Protect Signal NFWP is the Nand Flash / SmartMediaCard/xD-Picture Card write protect signal. This signal is active low and is set to low during reset in order to protect the memory against parasitic writes. Signal Name Type Description Alternate Function Signal Name Type Description Alternate Function DPF I/O USB Full Speed Positive Data Upstream Port - DMF I/O USB Full Speed Minus Data Upstream Port - DPH I/O USB High Speed Plus Data Upstream Port - DMH I/O USB High Speed Minus Data Upstream Port - UVCON O USB VBUS Control line UVCON is used to control the external VBUS power supply ON or OFF. Note: This output is requested for OTG mode. P3.6
Table 9. Audio Codec Description This pin monitors the function of the OTG device. Note: This input is requested for OTG mode. Connect this pin to external resistor and capacitor.
12 AT85C51SND3Bx
Table 12. SIO Signal Description Low Voltage system: connect this pin to LVDD pin. High voltage system: connect this pin to external +3V power supply. Low Voltage system: connect this pin to LVSS pin. High voltage system: connect this pin to external +3V ground. 8-bit bidirectional data bus. Read signal asserted low during external host read operation. Write signal asserted low during external host write operation. Select signal asserted low during external host read or write operation. Address signal asserted during external host read or write operation. When in master mode, MISO receives data from the slave peripheral. When in slave mode, MISO outputs data to the master controller. When in master mode, MOSI outputs data to the slave peripheral. When in slave mode, MOSI receives data from the master controller. When in master mode, SCK outputs clock to the slave peripheral. When in slave mode, SCK receives clock from the master controller. When in controlled slave mode, SS enables the slave mode. serial I/O modes 1, 2 and 3.
Table 14. LCD Interface Signal Description serial I/O modes 1, 2 and 3. Asserted low by hardware when SIO is ready to receive data. Asserted low by external hardware when SIO is allowed to send data. 8-bit bidirectional data bus. 8080: Read signal asserted low during display read access. 6800: Enable signal asserted high during display access. 8080: Write signal asserted low during display write access. Select signal asserted low during display access. Address signal asserted during display access. Connect low ESR inductance to DCLI and BVDD.
14 AT85C51SND3Bx
7632A–MP3–03/06 OCD Interface Table 16. OCD Signal Description BVSS GND Battery Ground Connect this pin to the negative pin of the battery. - LVDD PWR Low Voltage DC-DC Power Supply output This pin outputs +1.8V typ. from internal DC-DC (battery powered).- RLVDD PWR Low Voltage Regulator Power Supply Output This pin outputs +1.8V typ. from internal regulator (USB powered or +3V external power supply). Connect this pin to LVDD incase of internal DC-DC usage. HVDD PWR High Voltage Power Supply This pin outputs +3V typ. from internal regulator (USB powered). Connect this pin to +3V external power supply. VSS GND Power Ground Connect this pin to the system ground. - CVSS GND Core Ground Connect this pin to VSS pin. - IOVDD PWR Input/Output Supply voltage Connect this pin to LVDD or HVDD pin. - IOVSS GND Input/Output Circuit Ground Connect this pin to VSS pin. - Signal Name Type Description Alternate Function Signal Name Type Description Alternate Function OCDR I On Chip Debug Receive Input OCDR receives data. - OCDT I/O On Chip Debug Transmit Output OCDT transmits data. ISP
7632A–MP3–03/06 Internal Pin Structure Table 17. Detailed Internal Pin Structure Circuit(1) Type Pins Input/Output RST Input/Output P0.7:0 P1.7:0 P2.7:0 P3.5:0 P4.6:0 P5.3:0 OCDT Input/Output P3.7:6 Input KIN3:0 SDINS SDLCK SMINS SMLCK TST ISP UID INT0 INT1 RXD OCDR Input SWR SA0 SRD SCS SS Input/Output NFD7:0 SD7:0 LD7:0 SDCMD SDDAT3:0 MISO MOSI R RST IOVSS N IOVDD N Ps IOVDD IOVDD2 osc Latch Output periods Pm Pw IOVDD IOVSS N Ps HVDD HVDD2 osc Latch Output periods Pm Pw HVDD IOVSS Pm Pw IOVSS IOVDDIOVDD N P IOVSS IOVDD
16 AT85C51SND3Bx
7632A–MP3–03/06 Output SDCLK SCK NFCE3:0 NFCLE NFALE NFWE NFRE NFWP SMCE DSEL DDAT DCLK OCLK LWR /LE LA0/LRS LRD /LRW LCS UVCON TXD Input/Output DPF DMF Input/Output DPH DMH Input DCPWR (2) - DCLI(2) Circuit(1) Type Pins N P IOVSS IOVDD DPF DMF DPH DMH BVDD R DCP N P CVSS LVDD
7632A–MP3–03/06 Notes: 1. For information on resistor value, input/output levels, and drive capability, refer to Section “DC Characteristics”, page 241. 2. AT85C51SND3B3 only 3. AT85C51SND3B2 & AT85C51SND3B3 only Output MICBIAS Input MICIN LINR LINL Output OUTR (2) OUTL (2) Circuit(1) Type Pins AVSS AVSS
18 AT85C51SND3Bx
as well as power failure detector and reset circuitry. ate from either USB power supply (5V nominal) or from an external 3 volts supply. Figure 5. Power Supply Diagram Note: 1. External connection mandatory when 1.8V DC-DC is used. pin. Its nominal voltage output is 3V. through RLVDD power pin. Its nominal voltage output is 1.8V. characteristics are specified in the section “DC characteristics”.
1.8 V DC-DC
20 AT85C51SND3Bx
version range as detailed in Table 18. Table 18. Battery Voltage Value tional delay of 16 cycles is required before lauching any conversion. VBERR is cleared and conversion value is set in VB4:0 according to Table 18. VBERR is set and value reported by VB4:0 is indeterminate. to an hardware bit: PMLCK in PCON. event. It is cleared by software after exiting power reduction mode. and PD bits in PCON can not be set and idle or power down modes are not entered. Figure 9. Power Reduction Controller Block Diagram
7632A–MP3–03/06 Idle Mode Idle mode is a power reduction mode that reduces the power consumption. In this mode, program execution halts. Idle mode freezes the clock to the CPU at known states while the peripherals continue to be clocked (refer to Section “System Clock Generator”, page 29). The CPU status before entering Idle mode is preserved, i.e., the program counter and program status word register retain their data for the duration of Idle mode. The contents of the SFRs and RAM are also retained. Entering Idle Mode To enter Idle mode, the user must set the IDL bit in PCON register while PMLCK is cleared. The AT85C51SND3B enters Idle mode upon execution of the instruction that sets IDL bit. The instruction that sets IDL bit is the last instruction executed. Note: If IDL bit and PD bit are set simultaneously, the AT85C51SND3B enter Power-down mode. Then it does not go in Idle mode when exiting Power-down mode. Exiting Idle Mode There are 2 ways to exit Idle mode: 1. Generate an enabled interrupt. – Hardware clears IDL bit in PCON register which restores the clock to the CPU. Execution resumes with the interrupt service routine. Upon completion of the interrupt service routine, program execution resumes with the instruction immediately following the instruction that activated Idle mode. The general- purpose flags (GF1 and GF0 in PCON register) may be used to indicate whether an interrupt occurred during normal operation or during Idle mode. When Idle mode is exited by an interrupt, the interrupt service routine may examine GF1 and GF0. 2. Generate a reset. – A logic high on the RST pin clears IDL bit in PCON register directly and asynchronously. This restores the clock to the CPU. Program execution momentarily resumes with the instruction immediately following the instruction that activated the Idle mode and may continue for a number of clock cycles before the internal reset algorithm takes control. Reset initializes the AT85C51SND3B and vectors the CPU to address 0000h. Note: During the time that execution resumes, the internal RAM cannot be accessed; however, it is possible for the Port pins to be accessed. To avoid unexpected outputs at the Port pins, the instruction immediately following the instruction that activated Idle mode should not write to a Port pin or to the external RAM. Power-down Mode The Power-down mode places the AT85C51SND3B in a very low power state. Power- down mode stops the oscillator and freezes all clocks at known states (refer to the Section “Oscillator”, page 27). The CPU status prior to entering Power-down mode is preserved, i.e., the program counter, program status word register retain their data for the duration of Power-down mode. In addition, the SFRs and RAM contents are preserved. Entering Power-down Mode To enter Power-down mode, set PD bit in PCON register while PMLCK is cleared. The AT85C51SND3B enters the Power-down mode upon execution of the instruction that sets PD bit. The instruction that sets PD bit is the last instruction executed. Exiting Power-down Mode There are 2 ways to exit the Power-down mode: 1. Generate an enabled external interrupt. – The AT85C51SND3B provides capability to exit from Power-down using INT0, INT1, and KIN3:0 inputs. In addition, using KIN input provides high or low level exit capability (see Section “Keyboard Interface”, page 239). Hardware clears PD bit in PCON register which starts the oscillator and restores
22 AT85C51SND3Bx
pressed. In both cases, execution resumes with the interrupt service routine. execution will only resume when the interrupt is de-asserted.
- Exit from power-down by external interrupt does not affect the SFRs nor the internal
Figure 10. Power-down Exit Waveform Using INT1:0 Figure 11. Power-down Exit Waveform Using KIN3:0 Note: 1. KIN3:0 can be high or low-level triggered. Power-down mode should not write to a Port pin or to the external RAM.
- Exit from power-down by reset redefines all the SFRs, but does not affect the internal
24 AT85C51SND3Bx
Figure 13. Reset Circuitry and Power-On Reset periods is mode independent (X2 or X1). tor must be added as shown in Figure 14. Figure 14. Reset Circuitry for WDT Reset-out Usage
Table 20. PCON Register
7 VBCEN
Set to enable the clock of the battery monitoring. Clear to disable the clock of the battery monitoring.
6 VBPEN
Set to power the battery monitoring. Clear to unpower the battery monitoring.
5 DCPBST
Set to disable DC-DC high power boost mode. Clear to enable DC-DC high power boost mode.
4 GF0
3 DCEN
2 PMLCK
Clear to unlock power-down or Idle mode entry. Cleared by hardware when an interrupt or reset occurs. Set to activate the Power-down mode when PMLCK is cleared. If IDL and PD are both set, PD takes precedence.
0 IDL
Cleared by hardware when an interrupt or reset occurs. Set to activate the Idle mode when PMLCK is cleared. If IDL and PD are both set, PD takes precedence. Table 21. PSTA Register
7 UVDET
Set by hardware when 5V is detected on UVDD pin. Cleared by hardware when 5V is not detected on UVDD pin.
26 AT85C51SND3Bx
Note: 1. Reset value depends on the power supply presence and on the internal reset source.
6 HVDET
Set by hardware when 3V is detected on HVDD pin. Cleared by hardware when 3V is not detected on HVDD pin. The value of these bits is always 0. Do not set these bits.
2 WDTRST
Must be cleared by software at power-up.
1 EXTRST
Set by hardware when the external RST pin is asserted (warm reset). Must be cleared by software at power-up.
0 PFDRST
Must be cleared by software at power-up. Table 22. VBAT Register
7 VBEN
Set to enable the battery monitoring.
6 VBERR Battery Monitor Error Flag
Set by hardware when conversion is out of min/max values. The value read from this bit is always 0. Do not set this bit. Refer to Table 18 for voltage value correspondence.
28 AT85C51SND3Bx
Figure 16. Crystal Connection The clock generation is enabled by setting CKGENE bit in CKEN (see Table 32). detailed in the following sections. Figure 17. Clock Generator Block Diagram and Symbol
480 MHz PLL The AT85C51SND3Bx PLL is based on a Phase Frequency Comparator and Lock
in order to support many oscillator frequencies and to minimize the PLL output jitter.
480 MHz PLLOSC
60 MHz
48 MHz
40 MHz
30 MHz
24 MHz
20 MHz
16 MHz
120 MHz
Figure 18. PLL Block Diagram and Symbol Table 24. PLL Reverse Clock Selection programming values and reverse frequency depending on some oscillator frequency. Table 25. PLL Programming Values versus Input Frequency bits in CKSEL (see Table 34) according to Table 26. Section “Power Management”, page 18.
480 MHz
12 MHz
30 AT85C51SND3Bx
Figure 19. System Clock Generator Block Diagram and Symbols Table 26. System Clock Selection 2 while in X2 mode, it is the oscillator frequency. Figure 20. Mode Switching Waveforms Figure 21 and is based on a frequency selector. Frequency is enabled by setting DNFCKEN bit in CKEN.
00 FOSC (default)
Figure 21. DFC/NFC Clock Generator Block Diagram and Symbol Table 27. DFC/NFC Clock Selection quency selector followed by a frequency divider. Frequency division is done using MMCDIV4:0 bits in MMCCLK according to Table 29. clock generation by setting MMCKEN bit in CKEN. phase), FOSC selection can be divided by 2. Figure 22. MMC Clock Generator Block Diagram and Symbol
000 FOSC (default)
32 AT85C51SND3Bx
Table 28. MMC Clock Selection Table 29. MMC Clock Divider rate when PLL is enabled. SIO clock is enabled by SIOCKEN bit in CKEN register. Figure 23. SIO Clock Generator Block Diagram and Symbol Table 30. SIO Clock Selection
111 FOSC ÷ 2
00000 Disabled (no clock out)
0 FOSC
Table 31. CKCON Register The value read from this bit is always 0. Do not set this bit.
6 WDX2
Clear to select the peripheral clock as watchdog clock input (X2 dependent).
5 OSCAMP
Clear to enable the oscillator amplifier in case of crystal usage (default). Set this bits according to Table 23 to optimize power consumption.
2 T1X2
Clear to select the peripheral clock as timer 1 clock input (X2 dependent).
1 T0X2
Clear to select the peripheral clock as timer 0 clock input (X2 dependent). Set to select 6 clock periods per machine cycle (X2 mode, FCPU = FPER = FOSC ).
34 AT85C51SND3Bx
Table 32. CKEN Register
7 CKGENE
Set to enable the clock generator. Clear to disable the clock generators.
6 PLLEN
Set to enable the 480 MHz PLL. Clear to disable the 480 MHz PLL. The value read from this bit is always 0. Do not set this bit.
4 PLOCK
Set by hardware when the PLL is locked. Cleared by hardware when the PLL is not locked.
3 MMCKEN
Set to enable the MMC controller Clock. Clear to disable the MMC controller Clock. The value read from this bit is always 0. Do not set this bit.
1 SIOCKEN
Set to enable the SIO Clock. Clear to disable the SIO Clock.
0 DNFCKEN
Set to enable the DFC/NFC Clock. Clear to disable the DFC/NFC Clock.
Table 33. CKSEL Register Refer to Table 27 for information on selected clock value. Refer to Table 24 for information on selected clock value.
2 SIOCKS SIO Clock Select Bit
Refer to Table 30 for information on divided clock value. Refer to Table 26 for information on divided clock value. Table 34. PLLCLK Register Table 35. MMCCLK Register Refer to Table 28 for information on selected clock value. Refer to Table 29 for information on divided clock value.
36 AT85C51SND3Bx
accessible through the PPCON (Peripheral Pagination Control) register (see Table 37).
- Setting one bit of PPCON using the setb instruction automatically clears the 7 oth-
By default, after reset selected page is page 0. Figure 24. SFR Pagination Block diagram Table 36. Page Selection Truth Table Table 37. PPCON Register The value read from these bits is always 0. Do not set these bits. Refer to Table 36 for page decoding information.
Table 38. Page Address Notation to Table 58. In these tables, the bit-addressable registers are identified by Note 1. Note: Available in AT85C51SND3B3 only. Table 39. C51 Core SFRs Table 40. Power and System Management Table 41. Clock Management Unit SFRs
38 AT85C51SND3Bx
Table 42. Interrupt SFRs Table 43. I/O Port SFRs Table 44. Timer SFRs Table 45. RAM Interface
Table 46. Memory Management SFRs Table 47. Scheduler SFRs Table 48. Data Flow Controller SFRs Table 49. USB Controller SFRs
40 AT85C51SND3Bx
Table 50. NFC SFRs
42 AT85C51SND3Bx
Table 51. MMC Controller SFRs Table 52. Audio Controller SFRs
Note: Available in AT85C51SND3B2 & AT85C51SND3B3 only. Table 53. Audio Stream Codec SFRs Table 54. PSI Controller SFRs Table 55. SPI Controller SFRs Table 56. Serial I/O Port SFRs
44 AT85C51SND3Bx
Table 57. LCD Interface SFRs Table 58. Keyboard Interface SFRs
Notes: 1. SFR registers with least significant nibble address equal to 0 or 8 are bit-addressable. Table 59. SFR Page 0: Addresses and Reset Values
46 AT85C51SND3Bx
Note: 1. SFR registers with least significant nibble address equal to 0 or 8 are bit-addressable. Table 60. SFR Page 1: Addresses and Reset Values
Notes: 1. SFR registers with least significant nibble address equal to 0 or 8 are bit-addressable.
- Available in AT85C51SND3B2 & AT85C51SND3B3 only.
Table 61. SFR Page 2: Addresses and Reset Values
48 AT85C51SND3Bx
Notes: 1. SFR registers with least significant nibble address equal to 0 or 8 are bit-addressable.
- SVERS reset value depends on the silicon version 1111 1011 for AT85C51SND3B product.
Table 62. SFR Page 3: Addresses and Reset Values
50 AT85C51SND3Bx
Table 63. Register Bank Selection addresses in this area are 00h to 7Fh. Figure 26. Lower 128 Bytes Internal RAM Organization Section “Special Function Registers”, page 36. M E M C B A X ( s e e Table 65) for the code segment base address. M E M D B A X ( s e e Table 66) for the data segment base address. MEMXBAX (see Table 67) for the xdata segment base address. MEMCSX (see Table 68) for the code segment size. MEMXSX (see Table 69) for the code segment size. The data segment is not programmable in size as it is a fixed 256-byte segment.
4 Banks of
8 Registers
start-up. In this figure italicized address are the logical address within segments. Figure 27. Memory Segment Configuration Table 64. PSW Register
7 CY Carry Flag
Carry out from bit 1 of ALU operands.
6 AC Auxiliary Carry Flag
Carry out from bit 1 of addition operands.
5 F0 User Definable Flag 0
Refer to Table 63 for bits description.
2 OV Overflow Flag
Overflow set by arithmetic operations.
1 F1 User Definable Flag 1
Set when ACC contains an odd number of 1’s. Cleared when ACC contains an even number of 1’s.
52 AT85C51SND3Bx
Table 65. MEMCBAX Register 17-bit CODE Base Address: X XXXX XXX0 0000 0000b. 512-byte alignment, no offset. Table 66. MEMDBAX Register 17-bit DATA Base Address: X XXXX XXX1 0000 0000b. 512-byte alignment with 256-byte offset. Table 67. MEMXBAX Register 17-bit CODE Base Address: X XXXX XXX0 0000 0000b. 512-byte alignment, no offset. Table 68. MEMCSX Register
Size is equals to (CSX+1) x 256 bytes. CODE sizes available: from 256 bytes to 64 Kbytes, by 256-byte steps. Table 69. MEMXSX Register Size is equals to (XSX+1) x 256 bytes. XDATA sizes available: from 256 bytes to 64 Kbytes, by 256-byte steps.
54 AT85C51SND3Bx
7632A–MP3–03/06
are enabled or disabled by the system designer and may be manipulated dynamically. AT85C51SND3Bx, latch this event into a flag buffer. handler. A high priority causes the handler to set an interrupt flag. reloads the PC with the start address of a software service routine. and IEN1 registers (see Table 72 and Table 73). sources: IPH0, IPL0, IPH1 and IPL1 registers (see Table 74 to Table 77). ters (IPH0 and IPH1) and one bit in the Interrupt Priority Low registers (IPL0 and IPL1). Table 70. Priority Levels rupts is determined by an internal hardware polling sequence detailed in Table 71.
56 AT85C51SND3Bx
Table 71. Priority Within Same Level
Figure 28. Interrupt Control System
58 AT85C51SND3Bx
must be de-asserted before the end of the interrupt service routine. level signals as detailed in Section “Exiting Power-down Mode”, page 21. Figure 29. INT1:0 Input Circuitry detailed information on these inputs, refer to Section “Keyboard Interface”, page 239. interrupts must hold the request pin low for at least 6 peripheral clock periods. Figure 30. Minimum Pulse Timings
Table 72. IEN0 Register Set to enable all interrupts. Clear to disable all interrupts. clearing its interrupt enable bit.
6 EAUP
Set to enable audio processor interrupt. Clear to disable audio processor interrupt.
5 EDFC
Set to enable data flow interrupt. Clear to disable data flow interrupt. Set to enable serial port interrupt. Clear to disable serial port interrupt.
3 ET1
Set to enable timer 1 overflow interrupt. Clear to disable timer 1 overflow interrupt.
2 EX1
Set to enable external interrupt 1. Clear to disable external interrupt 1.
1 ET0
Set to enable timer 0 overflow interrupt. Clear to disable timer 0 overflow interrupt.
0 EX0
Set to enable external interrupt 0. Clear to disable external interrupt 0.
60 AT85C51SND3Bx
Table 73. IEN1 Register The value read from these bits is always 0. Do not set these bits.
5 EMMC
Set to enable MMC/SD interrupt. Clear to disable MMC/SD interrupt. Set to enable IDE interrupt. Clear to disable IDE interrupt.
3 ESPI
Set to enable SPI interrupt. Clear to disable SPI interrupt.
2 EPSI
Set to enable PSI interrupt. Clear to disable PSI interrupt. Set to enable Keyboard interrupt. Clear to disable Keyboard interrupt. Set this bit to enable USB interrupt. Clear this bit to disable USB interrupt.
Table 74. IPH0 Register The value read from this bit is indeterminate. Do not set this bit.
6 IPHAUP AUP Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
5 IPHDFC DFC Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
4 IPHS SIO Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
3 IPHT1 T1 Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
2 IPHX1 EX1 Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
1 IPHT0 T0 Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
0 IPHX0 EX0 Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
62 AT85C51SND3Bx
Table 75. IPH1 Register The value read from these bits is always 0. Do not set these bits.
5 IPHMMC MMC/SD Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
4 IPHNFC NFC Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
3 IPHSPI SPI Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
2 IPHPSI PSI Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
1 IPHKB KBD Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
0 IPHUSB USB Interrupt Priority Level Msb
Refer to Ta bl e 70 for priority level description.
Table 76. IPL0 Register The value read from this bit is indeterminate. Do not set this bit.
6 IPLAUP AUP Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
5 IPLDFC DFC Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
4 IPLS SIO Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
3 IPLT1 T1 Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
2 IPLX1 EX1 Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
1 IPLT0 T0 Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
0 IPLX0 EX0 Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
64 AT85C51SND3Bx
Table 77. IPL1 Register The value read from these bits is always 0. Do not set these bits.
5 IPLMMC MMC/SD Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
4 IPLNFC NFC Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
3 IPLSPI SPI Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
2 IPLPSI PSI Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
1 IPLKB KBD Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
0 IPLUSB USB Interrupt Priority Level Lsb
Refer to Ta bl e 70 for priority level description.
7632A–MP3–03/06 Timers/Counters The AT85C51SND3Bx implement 2 general-purpose, 16-bit Timers/Counters. They are identified as Timer 0 and Timer 1, and can be independently configured to operate in a variety of modes as a Timer or as an event Counter. When operating as a Timer, the Timer/Counter runs for a programmed length of time, then issues an interrupt request. When operating as a Counter, the Timer/Counter counts negative transitions on an external pin. After a preset number of counts, the Counter issues an interrupt request. The various operating modes of each Timer/Counter are described in the following sections. Timer/Counter Operations For instance, a basic operation is Timer registers THx and TLx (x = 0, 1) connected in cascade to form a 16-bit Timer. Setting the run control bit (TRx ) in TCON register (see Table 81) turns the Timer on by allowing the selected input to increment TLx. When TLx overflows it increments THx ; when THx overflows it sets the Timer overflow flag (TFx) in TCON register. Setting the TRx does not clear the THx and TLx Timer registers. Timer registers can be accessed to obtain the current count or to enter preset values. They can be read at any time but TRx bit must be cleared to preset their values, otherwise, the behavior of the Timer/Counter is unpredictable. The C/Tx# control bit selects Timer operation or Counter operation by selecting the divided-down peripheral clock or external pin Tx as the source for the counted signal. TRx bit must be cleared when changing the mode of operation, otherwise the behavior of the Timer/Counter is unpredictable. For Timer operation (C/Tx# = 0), the Timer register counts the divided-down peripheral clock. The Timer register is incremented once every peripheral cycle (6 peripheral clock periods). The Timer clock rate is F PER /6, i.e., FOSC /12 in standard mode or FOSC /6 in X2 mode. For Counter operation (C/Tx# = 1), the Timer register counts the negative transitions on the Tx external input pin. The external input is sampled every peripheral cycles. When the sample is high in one cycle and low in the next one, the Counter is incremented. Since it takes 2 cycles (12 peripheral clock periods) to recognize a negative transition, the maximum count rate is F PER /12, i.e., FOSC /24 in standard mode or FOSC /12 in X2 mode. There are no restrictions on the duty cycle of the external input signal, but to ensure that a given level is sampled at least once before it changes, it should be held for at least one full peripheral cycle. Timer Clock Controller As shown in Figure 31, the Timer 0 (FT0) and Timer 1 (FT1) clocks are derived from either the peripheral clock (FPER ) or the oscillator clock (FOSC ) depending on the T0X2 and T1X2 bits in CKCON register. These clocks are issued from the Clock Controller block as detailed in Section “Oscillator”, page 27. When T0X2 or T1X2 bit is set, the Timer 0 or Timer 1 clock frequency is fixed and equal to the oscillator clock frequency divided by 2. When cleared, the Timer clock frequency is equal to the oscillator clock fre quency divided by 2 in standard mode or to the oscillator clock frequency in X2 mode.
66 AT85C51SND3Bx
Figure 31. Timer 0 and Timer 1 Clock Controller and Symbols Timer 0 Timer 0 functions as either a Timer or event Counter in four modes of operation. flag (TF0), run control bit (TR0), interrupt flag (IE0) and interrupt type control bit (IT0). It is important to stop Timer/Counter before changing mode. Table 78. Timer/counter 0 Operating Modes 0 0 0 8-bit Timer/Counter (TH0) with 5-bit prescaler (TL0). 1 0 2 8-bit auto-reload Timer/Counter (TL0). 1 1 3 TL0 is an 8-bit Timer/Counter. TH0 is an 8-bit Timer using Timer 1’s TR0 and TF0 bits.
68 AT85C51SND3Bx
Figure 36. Timer/Counter x (x = 0 or 1) in Mode 2 Figure 37. Mode 2 Auto-reload Period Formula Figure 38. Timer/Counter 0 in Mode 3: 2 8-bit Counters Figure 39. Mode 3 Overflow Period Formula
70 AT85C51SND3Bx
It is important to stop the Timer/Counter before changing modes. Table 80. Timer/counter 1 Operating Modes Figure 34). The selected input increments TL1 register. Timer 1 when TR1 run control bit is not available i.e. when Timer 0 is in mode 3. assumes interrupts are globally enabled by setting EA bit in IEN0 register. Figure 41. Timer Interrupt System 0 0 0 8-bit Timer/Counter (TH1) with 5-bit prescaler (TL1). 1 0 2 8-bit auto-reload Timer/Counter (TL1). 1 1 3 Timer/Counter halted. Retains count.
Table 81. TCON Register
7 TF1
Cleared by hardware when processor vectors to interrupt routine. Set by hardware on Timer/Counter overflow, when Timer 1 register overflows.
6 TR1
Clear to turn off Timer/Counter 1. Set to turn on Timer/Counter 1.
5 TF0
Cleared by hardware when processor vectors to interrupt routine. Set by hardware on Timer/Counter overflow, when Timer 0 register overflows.
4 TR0
Clear to turn off Timer/Counter 0. Set to turn on Timer/Counter 0.
3 IE1
Cleared by hardware when interrupt is processed if edge-triggered (see IT1). Set by hardware when external interrupt is detected on INT1 pin.
2 IT1
Clear to select low level active (level triggered) for external interrupt 1 (INT1). Set to select falling edge active (edge triggered) for external interrupt 1.
1 IE0
Cleared by hardware when interrupt is processed if edge-triggered (see IT0). Set by hardware when external interrupt is detected on INT0 pin.
0 IT0
Clear to select low level active (level triggered) for external interrupt 0 (INT0). Set to select falling edge active (edge triggered) for external interrupt 0.
72 AT85C51SND3Bx
Table 82. TMOD Register Clear to enable Timer 1 whenever TR1 bit is set. Set to enable Timer 1 only while INT1 pin is high and TR1 bit is set. Clear for Timer operation: Timer 1 counts the divided-down system clock. Set for Counter operation: Timer 1 counts negative transitions on external pin T1. Clear to enable Timer 0 whenever TR0 bit is set. Set to enable Timer/Counter 0 only while INT0 pin is high and TR0 bit is set. Clear for Timer operation: Timer 0 counts the divided-down system clock. Set for Counter operation: Timer 0 counts negative transitions on external pin T0. Table 83. TH0 Register
Table 84. TL0 Register Table 85. TH1 Register Table 86. TL1 Register
74 AT85C51SND3Bx
Table 87. SCHCLK Register The value read from this bit is always 0. Do not set this bit. Refer to Table 79 for dividing values. The value read from these bits is always 0. Do not set these bits.
76 AT85C51SND3Bx
Figure 44. In this formula, WTOval repre- Figure 44. WDT Time-Out Formula
- These frequencies are achieved in X2 mode when WTX2 = 0: FWDT = FOSC .
Operation of the WDT during power reduction modes deserves special attention. must dedicate some internal or external hardware to service the WDT during Idle mode. eral Timer for the next service period and puts the CPU core back into Idle mode. the WDT just before entering Power-down mode. The WDT is cleared and disabled if the Power-down mode is terminated by a reset. Table 88. WDT Time-Out Computation
6 MHz(1) 8 MHz(1) 10 MHz(1) 12 MHz 16 MHz (2) 20 MHz (2) 24 MHz (2)
Table 89. WDTRST Register Table 90. WDTPRG Register The value read from these bits is indeterminate. Do not set these bits. Refer to Ta bl e 88 for time-out periods.
78 AT85C51SND3Bx
data channels between a source peripheral and a destination peripheral. bus, the multimedia data bus and the DFC control bus. Figure 45. DFC Internal Architecture flow descriptor registers and DFCRC the CRC data register. DFEN bit in DFCON is set, i.e. DFC enabled. to send and receive data respectively.
bers are used to program the SID and the DID in the DFD. Table 91. Data Flow Descriptor Content Table 92. Peripheral ID Number CRC16 operates on channel 0 only. writing two bytes(1) (MSB first) in the DFCRC register. (MSB first) from the DFCRC register. Notes: 1. This double write or read sequence can be reset by clearing the CRCEN bit.
- The CRC value is not reset at start-up of a new data transfer.
0 SID Source Identifier
See Table 92 for peripheral ID number.
1 DID Destination Identifier
See Table 92 for peripheral ID number.
2 DPS
packet size) to 13 (8192-byte packet size).
3 DFSH Data Flow Size
16-bit wide data leading to data flow size from 1 to 216- 1 data packets.
0 C51 RAM
1 USB Controller
2 Audio Controller 1
3 Audio Controller 2
4 PSI Controller
5 SPI Controller
6 SIO Controller
7 Nand Flash Controller
8 MMC/SD Controller
15 Null Device
80 AT85C51SND3Bx
initialized CRC value MSB first. DFPRIO1:0 can be modified at any time while transfer is on-going or not. Table 93. Channel Priority Assignment sponding channel and cleared at the end of transfer or abort. DRDY0, SRDY1, DRDY1 ready flags in DFCSTA. the Data Flow Abort Mode control bit in DFCON. set the End of Flow interrupt flag of the corresponding channel. in case of logical data flow management over a physical channel. 0 0 No priority assigned: channel 0 & channel 1 have same priority. 0 1 Priority assigned to channel 0. 1 0 Priority assigned to channel 1. 1 1 Reserved, do not set both bits.
82 AT85C51SND3Bx
Table 94. DFCON Register The value read from this bit is always 0. Do not set this bit.
6 DFRES Data Flow Controller Reset Bit
Set then clear this bit to reset the Data Flow Controller by software. The value read from this bit is always 0. Do not set this bit.
4 DFCRCEN
Set to enable CRC calculation on channel 0. Clear to disable CRC calculation. Refer to Table 93 for channel priority assignment description.
1 DFABTM
Set to trigger a delayed abort. Clear to trigger an immediate abort.
0 DFEN
Set to enable the Data Flow Controller. Clear to disable the Data Flow Controller. Table 95. DFCSTA Register
7 DRDY1
Set by hardware when the destination peripheral of channel 1 is ready. Cleared by hardware when the destination peripheral of channel 1 is not ready.
6 SRDY1
Set by hardware when the source peripheral of channel 1 is ready. Cleared by hardware when the source peripheral of channel 1 is not ready.
5 EOFI1
Set by hardware at the end of a channel 1 data flow transfer. Cleared by software by setting EOFIA1 in DFCCON. Can not be set by software.
4 DFBSY1
Set by hardware when a transfer is on-going on channel 1. Cleared by hardware when no transfer is on-going on channel 1.
3 DRDY0
Set by hardware when the source peripheral of channel 0 is ready. Cleared by hardware when the source peripheral of channel 0 is not ready.
2 SRDY0
Set by hardware when the destination peripheral of channel 0 is ready. Cleared by hardware when the destination peripheral of channel 0 is not ready.
1 EOFI0
Set by hardware at the end of a channel 0 data flow transfer. Cleared by software by setting EOFIA0 in DFCCON. Can not be set by software.
0 DFBSY0
Set by hardware when a transfer is on-going on channel 0. Cleared by hardware when no transfer is on-going on channel 0. Table 96. DFCCON Register
7 DFABT1
Set to trigger an abort on channel 1. This bit is cleared by hardware.
6 EOFE1
Set to enable channel 1 EOF interrupt. Clear to disable channel 1 EOF interrupt.
5 EOFIA1
Set to acknowledge the channel 1 EOF interrupt (clear EOFI1 flag). Clearing this bit has no effect. The value read from this bit is always 0. The value read from this bit is always 0. Do not set this bit.
3 DFABT0
Set to trigger an abort on channel 0. This bit is cleared by hardware.
2 EOFE0
Set to enable channel 0 EOF interrupt. Clear to disable channel 0 EOF interrupt.
1 EOFIA0
Set to acknowledge the channel 0 EOF interrupt (clear EOFI0 flag). Clearing this bit has no effect. The value read from this bit is always 0. The value read from this bit is always 0. Do not set this bit.
84 AT85C51SND3Bx
Table 97. DFD0 Register Write data flow descriptor to this register as detailed in Table 91. Table 98. DFD1 Register Write data flow descriptor to this register as detailed in Table 91. Table 99. DFCRC Register while second writing writes the LSB.
act as a USB device or a USB host. Full-speed and high-speed device. Full-speed host with OTG compliance. Automatic Data Flow Controller (DFC) transfer without CPU support. – 4 endpoints of 64 bytes max, (one or two banks). detailed in Table 49, page 39. clock for USB high-speed mode support. Figure 49. USB Controller Block Diagram through 2 termination resistors.
2368 Bytes
86 AT85C51SND3Bx
Figure 50. USB Connection Introduction After a hardware reset, the USB controller is disabled. ler. This is performed using the ID detection. on the UID pad) and the USB Device controller is selected. The ID bit is cleared by hardware when a low level has been detected on the ID pin. The Device controller is then disabled and the Host controller enabled. host registers. This is also true for the Host mode. Power-On and Reset Figure 51 shows the USB controller main states after power-on. Figure 51. USB Controller Reset State Machine the Host and Device USB controllers internal states are reset.
88 AT85C51SND3Bx
7632A–MP3–03/06 There are 2 kinds of interrupts: processing (i.e. their generation are part of the normal processing) and exception (errors). Processing interrupts are generated when the following events are triggered: IDTI: ID Pad detection (insert, remove) VBUSTI: VBUS plug-in detection (insert, remove) SRPI: SRP detected ROLEEXI: Role Exc hanged Exception Interrupts are generated when the following events are triggered: VBERRI: Drop on VBUS Detected BCERRI: Error during the B-Connection HNPERRI: HNP Error STOI: Time-out detected during Suspend mode Power modes Idle Mode In this mode, the CPU core is halted (CPU clock stopped). The Idle mode is taken regardless of the USB controller state (running or not). The CPU wakes up on any USB interrupts. Power Down In this mode, the oscillator and PLL are stopped and the CPU and peripherals are fro- zen. The CPU “wakes up” when: the WAKEUPI interrupt is triggered in the Peripheral mode (HOST cleared), the RXRSMI or the SRPI interrupt is triggered in the Host mode (HOST set). the IDTI interrupt is triggered the VBUSTI interrupt is triggered Freeze Clock The firmware has the ability to reduce the power consumption by setting the FRZCLK bit, which freezes the clock of USB controller. When FRZCLK is set, it is still possible to have an access to the following registers: USBCON, USBSTA, USBINT DPRAM direct access (DPADD10:0, UxDATX) UDCON (detach, …) UDINT UDIEN UHCON UHINT UHIEN Moreover, when FRZCLK is set, only the following interrupts may be triggered: WAKEUPI I D T I VBUSTI
or High Speed) is performed automatically by the USB controller during the USB Reset. speed terminations and pull-up. mal operations, SPDCONF1:0 must be cleared. Table 100. Speed configuration Clearing USBE resets SPDCONF1:0. vated on both DMF and DPF lines. The CPU has the capability to directly access to the USB internal memory (DPRAM). The memory access mode is performed using UDPADDH and UDPADDL registers. DPACC bit and the base address DPADD10:0 must be set. ters are discarded in this mode. The aim of this functionality is to use the DPRAM as extra-memory.
00 Normal Mode (default)
Use High-Speed pad in Full-Speed or High-Speed.
01 Full-Speed only mode (Full-Speed pad)
Shall be done before setting USBE.
10 High-Speed only mode (High-Speed pad)
Shall be used in debug mode.
11 Full-Speed only mode (High-Speed pad)
90 AT85C51SND3Bx
When using this mode, there is no influence over the USB controller. and upper Pipe/Endpoint memory does not slide. “slides” down. Note that the “ki+2” and upper Pipe/Endpoint memory does not slide. Figure 54. Allocation and reorganization USB memory flow
4 Conflict
92 AT85C51SND3Bx
Table 101. OTG Timer Configuration Figure 57. Plug-in Detection Input Block Diagram 00 AWaitVrise time-out = 20 ms. 01 AWaitVrise time-out = 50 ms. 10 AWaitVrise time-out = 70 ms. 11 AWaitVrise time-out = 100 ms.
7632A–MP3–03/06 The control logic of the UVCC pad outputs 2 signals: The “session_valid” signal is active high when the voltage on the UVCC pin is higher or equal to 1.4V. The “Va_Vbus_valid” signal is active high when the voltage on the UVCC pin is higher or equal to 4.4V. In the Host mode, the VBUS flag follows the next hysteresis rule: VBUS is set when the voltage on the UVCC pin is higher or equal to 4.4 V. VBUS is cleared when the voltage on the UVCC pin is lower than 1.4 V. In the Peripheral mode, the VBUS flag follows the next rule: VBUS is set when the voltage on the UVCC pin is higher or equal to 1.4 V. VBUS is cleared when the voltage on the UVCC pin is lower than 1.4 V. The VBUSTI interrupt is triggered at each transition of the VBUS flag.
94 AT85C51SND3Bx
Figure 58. ID Detection Input Block Diagram By default, (no A-plug or B-plug), the macro is in the Peripheral mode (internal pull-up). rupt is not triggered when a B-plug (Peripheral) is plugged or unplugged. The IDTI interrupt may be triggered even if the USB controller is disabled. Table 102. USBCON Register
7 USBE
Set to enable the USB controller. to disable the USB controller clock inputs.
6 HOST
Set to access to the Host registers. Clear to access to the Device registers.
5 FRZCLK
Clear to enable the clock inputs.
4 OTGPADE
Clear to disable the OTG pad. detection even if the USB macro is disable). The value read from these bits is always 0. Do not set these bits.
1 IDTE
Set this bit to enable the ID Transition interrupt generation. Clear this bit to disable the ID Transition interrupt generation.
0 VBUSTE
Set this bit to enable the VBUS Transition interrupt generation. Clear this bit to disable the VBUS Transition interrupt generation. Table 103. USBSTA Register The value read from these bits is always 0. Do not set these bits.
2 SPEED
Set by hardware when the controller is in HIGH-SPEED mode. Cleared by hardware when the controller is in FULL-SPEED mode.
1 ID IUD Pin Flag
Set / cleared by hardware and reflects the state of the UID pin.
0 VBUS
Set / cleared by hardware and reflects the level of the UVCC pin. See Section “Plug-in detection” for more details. Table 104. USBINT Register The value read from these bits is always 0. Do not set these bits.
1 IDTI
Shall be cleared by software.
0 VBUSTI
Shall be cleared by software.
96 AT85C51SND3Bx
Table 105. UDPADDH Register
7 DPACC
The value read from these bits is always 0. Do not set these bits. provided by the UDPADDL register. Table 106. UDPADDL Register provided by the UDPADDH register. Table 107. OTGCON Register This bit must be cleared to access the OTGCON register. The value read from these bits is always 0. Do not set these bits.
5 HNPREQ
Set to initiate the HNP when the controller is in the Device mode (B). Set to accept the HNP when the controller is in the Host mode (A). Cleared by hardware after the HNP completion.
4 SRPREQ
Set to initiate the SRP when the controller is in Device mode. Cleared by hardware when the controller is initiating a SRP .
3 SRPSEL
Set to choose VBUS pulsing as SRP method. Clear to choose data line pulsing as SRP method.
2 VBUSHWC
Set to disable the hardware control over the UVCON pin. Clear to enable the hardware control over the UVCON pin.
1 VBUSREQ
generation. This bit shall be used when the controller is in the Host mode. Cleared by hardware when VBUSRQC is set.
0 VBUSRQC
generation. This bit shall be used when the controller is in the Host mode. Cleared by hardware immediately after the set. Table 108. OTGTCON Register
1 PAGE1:0 - - VALUE2:0
This bit must be set to access the OTGTCON register. Set/clear to access a special timer register. See Section “OTG Timers Customizing” for more details. The value read from these bits is always 0. Do not set these bits. Set to initialize the new value of the timer. See Section “OTG Timers Customizing” for more details.
98 AT85C51SND3Bx
Table 109. OTGIEN Register The value read from these bits is always 0. Do not set these bits.
5 STOE
Set to enable the STOI interrupt. Clear to disable the STOI interrupt.
4 HNPERRE
Set to enable the HNPERRI interrupt. Clear to disable the HNPERRI interrupt.
3 ROLEEXE
Set to enable the ROLEEXI interrupt. Clear to disable the ROLEEXI interrupt.
2 BCERRE
Set to enable the BCERRI interrupt. Clear to disable the BCERRI interrupt.
1 VBERRE
Set to enable the VBERRI interrupt. Clear to disable the VBERRI interrupt.
0 SRPE
Set to enable the SRPI interrupt. Clear to disable the SRPI interrupt. Table 110. OTGINT Register The value read from these bits is always 0. Do not set these bits.
5 STOI
Shall be cleared by software. See for more details.
4 HNPERRI
Set by hardware when an error has been detected during the protocol. Shall be cleared by software. See for more details.
7632A–MP3–03/06 Reset Value = 0000 0000b
3 ROLEEXI
Role Exchange Interrupt Flag Set by hardware when the USB controller has successfully swapped its mode, due to an HNP negotiation: Host to Device or Device to Host. Shall be cleared by software. See for more details.
2 BCERRI
B-Connection Error Interrupt Flag Set by hardware when an error occur during the B-Connection. Shall be cleared by software.
1 VBERRI
V-Bus Error Interrupt Flag Set by hardware when a drop on VBus has been detected. Shall be cleared by software.
0 SRPI
Set by hardware when a SRP has been detected. Shall be used in the Host mode only. Shall be cleared by software. Bit Number Bit Mnemonic Description
100 AT85C51SND3Bx
7632A–MP3–03/06 USB Software Operating modes Depending on the USB operating mode, the software should perform some of the follow- ing operations: Power On the USB interface Power-On USB pads regulator Wait USB pads regulator ready state Configure PLL interface Enable PLL Check PLL lock Enable USB interface Configure USB interface (USB speed, Endpoints configuration...) Wait for USB VBUS information connection Attach USB device Power Off the USB interface Detach USB interface Disable USB interface Disable PLL Disable USB pin regulator Suspending the USB interface Clear Suspend Bit Set USB suspend clock Disable PLL Be sure to have interrupts enable to exit sleep mode Make the MCU enter sleep mode Resuming the USB interface Enable PLL Wait PLL lock Clear USB suspend clock Clear Resume information
programmable size FIFO up to 64 bytes, default control endpoint. programmable size FIFO up to 512 bytes in ping-pong mode. programmable size FIFO up to 64 bytes in ping-pong mode. Power-On and Reset Figure 59 shows the USB device controller main states after power-on. Figure 59. USB Device Controller Reset State Machine not need to have the PLL activated to enter in this state. The USB device controller can at any time be reset by clearing USBE. a High-speed reset (High-speed).
102 AT85C51SND3Bx
7632A–MP3–03/06 At the end of the reset process (Full or High), the end of reset interrupt (EORSTI) is gen- erated. Then the CPU should read the SPEED bit to know the speed mode of the device. Note that the USB device controller starts in the Full-speed mode after power on. Endpoint Reset An endpoint can be reset at any time by setting in the UERST register the bit corre- sponding to the endpoint (EPRSTx). This resets: the internal state machine on that endpoint, the Rx and Tx banks are cleared and their internal pointers are restored, the UEINTX, UESTA0X and UESTA1X are restored to their reset value. The data toggle field remains unchanged. The other registers remain unchanged. The endpoint configuration remains active and the endpoint is still enabled. The endpoint reset may be associated with a clear of the data toggle command (RSTDT bit) as an answer to the CLEAR_FEATURE USB command. USB Reset When an USB reset is detected on the USB line, the next operations are performed by the controller: all the endpoints are disabled, except the default control endpoint, the default control endpoint is reset (see Section “Endpoint Reset” for more details). The data toggle of the default control endpoint is cleared. Endpoint Selection Prior to any operation performed by the CPU, the endpoint must first be selected. This is done by: Clearing EPNUMS. Setting EPNUM with the endpoint number which will be managed by the CPU. The CPU can then access to the various endpoint registers and data. In the same manner, if the endpoint must be accessed by the DFC, it must first be selected. This is done by: Setting EPNUMS. Setting EPNUM with the endpoint number which will be managed by the DFC. Setting DFCRDY when the data-flow is ready to take place. The DFC can then access to the banks (read / write). The controller internally keeps in memory the EPNUM for the CPU and the EPNUM for the DFC. In fact, there are 2 EPNUM registers multiplexed by the EPNUMS bit. Each of them can be read or written by the CPU. These two registers permits to easily switch from an endpoint under DFC data transfer to the default control endpoint when a SETUP is received, without reprogramming the EPNUM register: – Set EPNUMS, – EPNUM = endpoint x – Set DFCRDY when the DFC transfer is ready to take place, – SETUP received on endpoint 0 (EPINT0 set, RXSTPI set),
– Set DFCRDY. This resumes the DFC transfer. Endpoint Activation The endpoint is maintained under reset as long as the EPEN bit is not set. Figure 60. Endpoint activation flow: not acknowledge the packets sent by the host. It resets the data toggle field. The DPRAM memory associated to the endpoint is still reserved.
104 AT85C51SND3Bx
7632A–MP3–03/06 the host sends a SETUP command (SET_ADDRESS(addr)), the firmware records that address in UADD, but keep ADDEN cleared, the USB device sends an IN command of 0 bytes (IN 0 Zero Length Packet), then, the firmware can enable the USB device address by setting ADDEN. The only accepted address by the controller is the one stored in UADD. ADDEN and UADD shall not be written at the same time. UADD contains the default address 00h after a power-up or USB reset. ADDEN is cleared by hardware: after a power-up reset, when an USB reset is received, or when the macro is disabled (USBE cleared) When this bit is cleared, the default device address 00h is used. Suspend, Wake-Up and Resume After a period of 3 ms during which the USB line was inactive, the controller switches to the full-speed mode and triggers (if enabled) the SUSPI (suspend) interrupt. The firm- ware may then set the FRZCLK bit. The CPU can also, depending on software architecture, enter in the idle mode to lower again the power consumption. There are two ways to recover from the “Suspend” mode: First one is to clear the FRZCLK bit. This is possible if the CPU is not in the Idle mode. Second way, if the CPU is “idle”, is to enable the WAKEUPI interrupt (WAKEUPE set). Then, as soon as an non-idle signal is seen by the controller, the WAKEUPI interrupt is triggered. The firmware shall then clear the FRZCLK bit to restart the transfer. There are no relationship between the SUSPI interrupt and the WAKEUPI interrupt: the WAKEUPI interrupt is triggered as soon as there are non-idle patterns on the data lines. Thus, the WAKEUPI interrupt can occurs even if the controller is not in the “suspend” mode. When the WAKEUPI interrupt is triggered, if the SUSPI interrupt bit was already set, it is cleared by hardware. When the SUSPI interrupt is triggered, if the WAKEUPI interrupt bit was already set, it is cleared by hardware. Detach The reset value of the DETACH bit is 1. It is possible to re-enumerate a device, simply by setting and clearing the DETACH bit. If the USB device controller is in full-speed mode, setting DETACH will disconnect the pull-up on the D+ or D- pad (depending on full or low speed mode selected). Then, clearing DETACH will connect the pull-up on the D+ or D- pad.
Figure 61. Detach a device in Full-speed: have received a DEVICE_REMOTE_WAKEUP request from the host. remote wake-up can only be sent after a SUSPI interrupt has been triggered. triggered (if enabled). If SUSPI was set, SUSPI is cleared by hardware. RMWKUP is cleared by hardware at the end of the “upstream resume”. interrupt is triggered (if enabled). and the EPINTx interrupt will be triggered (if enabled). The incoming packets will be discarded (RXOUTI and RWAL will not be set). STALLRQC bit and to reset the endpoint. A SETUP request is always ACK’ed. automatically reset (RXSETUPI set, TXINI cleared, STALLI cleared, TXINI cleared...). return to the main task, waiting for the next SETUP request.
106 AT85C51SND3Bx
7632A–MP3–03/06 This function is compliant with the Chapter 8 test from PMTC that send extra status for a GET_DESCRIPTOR. The firmware sets the STALL request just after receiving the sta- tus. All extra status will be automatically STALL’ed until the next SETUP request. STALL Handshake and Retry Mechanism The Retry mechanism has priority over the STALL handshake. A STALL handshake is sent if the STALLRQ request bit is set and if there is no retry required. CONTROL Endpoint Management A SETUP request is always ACK’ed. When a new setup packet is received, the RXSTPI interrupt is triggered (if enabled). The RXOUTI interrupt is not triggered. The FIFOCON and RWAL fields are irrelevant with CONTROL endpoints. The firmware shall thus never use them on that endpoints. When read, their value is always 0. CONTROL endpoints are managed by the following bits: RXSTPI is set when a new SETUP is received. It shall be cleared by firmware to acknowledge the packet and to clear the endpoint bank. RXOUTI is set when a new OUT data is received. It shall be cleared by firmware to acknowledge the packet and to clear the endpoint bank. TXINI is set when the bank is ready to accept a new IN packet. It shall be cleared by firmware to send the packet and to clear the endpoint bank. CONTROL endpoints should not be managed by interrupts, but only by polling the sta- tus bits. Control Write The next figure shows a control write transaction. During the status stage, the controller will not necessary send a NAK at the first IN token: If the firmware knows the exact number of descriptor bytes that must be read, it can then anticipate on the status stage and send a ZLP for the next IN token, or it can read the bytes and poll NAKINI, which tells that all the bytes have been sent by the host, and the transaction is now in the status stage. SETUP RXSTPI RXOUTI TXINI USB line HW SW OUT HW SW OUT HW SW IN IN NAK SW DATASETUP STATUS
7632A–MP3–03/06 Control Read The next figure shows a control read transaction. The USB controller has to manage the simultaneous write requests from the CPU and the USB host: A NAK handshake is always generated at the first status stage command. When the controller detect the status stage, all the data written by the CPU are erased, and clearing TXINI has no effects. The firmware checks if the transmission is complete or if the reception is complete. The OUT retry is always ack’ed. This reception: - set the RXOUTI flag (received OUT data) - set the TXINI flag (data sent, ready to accept new data) software algorithm: set transmit ready wait (transmit complete OR Receive complete) if receive complete, clear flag and return if transmit complete, continue Once the OUT status stage has been received, the USB controller waits for a SETUP request. The SETUP request have priority over any other request and has to be ACK’ed. This means that any other flag should be cleared and the fifo reset when a SETUP is received. WARNING: the byte counter is reset when the OUT Zero Length Packet is received. The firmware has to take care of this. OUT Endpoint Management OUT packets are sent by the host. All the data can be read by the CPU, which acknowl- edges or not the bank when it is empty. Overview The Endpoint must be configured first. “Manual” Mode Each time the current bank is full, the RXOUTI and the FIFOCON bits are set. This trig- gers an interrupt if the RXOUTE bit is set. The firmware can acknowledge the USB interrupt by clearing the RXOUTI bit. The Firmware read the data and clear the FIFO- CON bit in order to free the current bank. If the OUT Endpoint is composed of multiple SETUP RXSTPI RXOUTI TXINI USB line HW SW IN HW SW IN OUT OUT NAK SW SW HW Wr Enable HOST Wr Enable CPU DATASETUP STATUS
108 AT85C51SND3Bx
7632A–MP3–03/06 banks, clearing the FIFOCON bit will switch to the next bank. The RXOUTI and FIFO- CON bits are then updated by hardware in accordance with the status of the new bank. RXOUTI shall always be cleared before clearing FIFOCON. The RWAL bit always reflects the state of the current bank. This bit is set if the firmware can read data from the bank, and cleared by hardware when the bank is empty. “Autoswitch” Mode In this mode, the clear of the FIFOCON bit is performed automatically by hardware each time the Endpoint bank is empty. The firmware has to check if the next bank is empty or not before reading the next data. On RXOUTI interrupt, the firmware reads a complete bank. A new interrupt will be generated each time the current bank contains data to read. The acknowledge of the RXOUTI interrupt is always performed by software. Detailed Description standard Mode Without AUTOSW In this mode (AUTOSW cleared), the data are read by the CPU, following the next flow: When the bank is filled by the host, an endpoint interrupt (EPINTx) is triggered, if enabled (RXOUTE set) and RXOUTI is set. The CPU can also poll RXOUTI or FIFOCON, depending on the software architecture, The CPU acknowledges the interrupt by clearing RXOUTI, The CPU can read the number of byte (N) in the current bank (N=BYCT), OUT DATA (to bank 0) ACK RXOUTI FIFOCON HW OUT DATA (to bank 0) ACK HW SW SW SW Example with 1 OUT data bank read data from CPU BANK 0 OUT DATA (to bank 0) ACK RXOUTI FIFOCON HW OUT DATA (to bank 1) ACK SW SW Example with 2 OUT data banks read data from CPU BANK 0 HW SW read data from CPU BANK 0 read data from CPU BANK 1 NAK
7632A–MP3–03/06 The CPU can read the data from the current bank (“N” read of UEDATX), The CPU can free the bank by clearing FIFOCON when all the data is read, that is: – after “N” read of UEDATX, – as soon as RWAL is cleared by hardware. If the endpoint uses 2 banks, the second one can be filled by the HOST while the current one is being read by the CPU. Then, when the CPU clear FIFOCON, the next bank may be already ready and RXOUTI is set immediately. Standard Mode with AUTOSW In this mode (AUTOSW set), the flow operation is the same as Section “standard Mode Without AUTOSW”, page 108, with the exception that the CPU does not have to free the bank (FIFOCON cleared): this will automatically be done when the CPU read the last byte of the bank. EPINTx (RXOUTE set, RXOUTI set) or polling on RXOUTI=1 or FIFOCON=1, The CPU acknowledges the interrupt by clearing RXOUTI, The CPU read the number of byte (N) in the current bank (N=BYCT) (or already knows the number “N” of bytes at each packet), The CPU can read the data from the current bank (“N” read of UEDATX, or can read while RWAL is set). A clear of FIFOCON does not have any effects in this mode. Using the DFC with AUTOSW In this mode (AUTOSW set, DFC programmed), the data are handled by the DFC with- out any intervention from the CPU. The flow is: programming of the DFC, poll End Of Transfer from the DFC. The bank switching is automatically done: when a bank is emptied, it is freed and the switch occurs. If the End Of Transfer occurs while the bank is not emptied, the CPU has the responsibility to free it. The CPU shall not use UEDATX or the byte counter BYCT in this mode. A clear of FIFOCON does not have any effects in this mode. If a ZLP is received, it will be filtered by the USB device controller, and the flag ZLP- SEEN is set. Using the DFC without AUTOSW In this mode (AUTOSW cleared, DFC programmed), the data are handled by the DFC but the CPU have to acknowledge each bank read. programming of the DFC, EPINTx (RXOUTE set, RXOUTI set) or polling on RXOUTI=1 or FIFOCON=1, The CPU acknowledges the interrupt by clearing RXOUTI, poll the wait of the transfer: (while RWAL is set: wait), Clear FIFOCON which frees the bank and switch to the next one. IN Endpoint Management IN packets are sent by the USB device controller, upon an IN request from the host. All the data can be written by the CPU, which acknowledge or not the bank when it is full. Overview The Endpoint must be configured first. “Manual” Mode The TXINI bit is set by hardware when the current bank becomes free. This triggers an interrupt if the TXINE bit is set. The FIFOCON bit is set at the same time. The CPU
110 AT85C51SND3Bx
7632A–MP3–03/06 writes into the FIFO and clears the FIFOCON bit to allow the USB controller to send the data. If the IN Endpoint is composed of multiple banks, this also switches to the next data bank. The TXINI and FIFOCON bits are automatically updated by hardware regarding the status of the next bank. TXINI shall always be cleared before clearing FIFOCON. The RWAL bit always reflects the state of the current bank. This bit is set if the firmware can write data to the bank, and cleared by hardware when the bank is full. “Autoswitch” Mode In this mode, the clear of the FIFOCON bit is performed automatically by hardware each time the Endpoint bank is full. The firmware has to check if the next bank is empty or not before writing the next data. On TXINI interrupt, the firmware fills a complete bank. A new interrupt will be generated each time the current bank becomes free. Detailed Description Standard Mode without AUTOSW In this mode (AUTOSW cleared), the data are written by the CPU, following the next flow: When the bank is empty, an endpoint interrupt (EPINTx) is triggered, if enabled (TXINE set) and TXINI is set. The CPU can also poll TXINI or FIFOCON, depending the software architecture choice, The CPU acknowledges the interrupt by clearing TXINI, The CPU can write the data into the current bank (write in UEDATX), IN DATA (bank 0) ACK TXINI FIFOCON HW Example with 1 IN data bank write data from CPU BANK 0 Example with 2 IN data banks SW SW SW SW IN IN DATA (bank 0) ACK TXINI FIFOCON write data from CPU BANK 0 SW SW SW SW IN DATA (bank 1) ACK write data from CPU BANK 0 write data from CPU BANK 1 SW HW write data from CPU BANK0 NAK
7632A–MP3–03/06 The CPU can free the bank by clearing FIFOCON when all the data are written, that is: – after “N” write into UEDATX – as soon as RWAL is cleared by hardware. If the endpoint uses 2 banks, the second one can be read by the HOST while the current is being written by the CPU. Then, when the CPU clears FIFOCON, the next bank may be already ready (free) and TXINI is set immediately. Standard Mode with AUTOSW In this mode (AUTOSW set), the flow operation is the same as Section “Standard Mode without AUTOSW”, page 110, with the exception that the CPU does not have to free the bank (FIFOCON cleared): this will automatically be done when the CPU fills the bank. EPINTx (TXINE set, TXINI set) or polling on TXINI=1 or FIFOCON=1, The CPU acknowledges the interrupt by clearing TXINI, The CPU can write the data to the current bank (write in UEDATX) while RWAL is set. A clear of FIFOCON does not have any effects in this mode. Using the DFC with AUTOSW In this mode (AUTOSW set, DFC programmed), the data are handled by the DFC with- out any intervention from the CPU. The flow is: programming of the DFC, poll End Of Transfer from the DFC. The bank switching is automatically done: when a bank is filled, it is freed and the switch occurs. If the End Of Transfer occurs while the bank is not filled, the CPU has the responsibility to free it. The CPU shall not use UEDATX or the byte counter BYCT in this mode. A clear of FIFOCON does not have any effects in this mode. Using the DFC without AUTOSW In this mode (AUTOSW=0, DFC programmed), the data are handled by the DFC but the CPU have to acknowledge each bank written: programming of the DFC, EPINTx (TXINE set, TXINI set) or polling on TXINI=1 or FIFOCON=1, The CPU acknowledges the interrupt by clearing TXINI, poll the wait of the transfer: (while RWAL is set: wait), Clear FIFOCON which frees the bank and switch to the next one. Abort An “abort” stage can be produced by the host in some situations: In a control transaction: ZLP data OUT received during a IN stage, In an isochronous IN transaction: ZLP data OUT received on the OUT endpoint during a IN stage on the IN endpoint The KILLBK bit is used to kill the last “written” bank. The best way to manage this abort is to perform the following operations:
112 AT85C51SND3Bx
Table 111. Abort flow A clear of FIFOCON does not have any effects in this mode. interrupt is triggered and the frame number FNUM10:0 is increased. empty. In this situation, the UNDERFI interrupt is triggered. are already full. Typically, he CPU is not fast enough. The packet is lost. RXOUTI interrupt from being triggered. should write only if the bank is ready to access data (TXINI=1 or RWAL=1). Disable the TXINI interrupt.
Figure 62. USB Device Controller Interrupt System processing) and exception (errors).
114 AT85C51SND3Bx
Figure 63. USB Device Controller Endpoint Interrupt System
Table 112. UDCON Register The value read from these bits is always 0. Do not set these bits.
1 RMWKUP
Set to send an “upstream-resume” to the host for a remote wake-up. Cleared by hardware. Clearing by software has no effect. See Section “Remote Wake-Up” for more details.
0 DETACH
Set to physically detach de device. Clear to reconnect the device. See Section “Detach” for more details. Table 113. UDINT Register The value read from these bits is always 0. Do not set these bits.
6 UPRSMI
“Upstream Resume”. This triggers an USB interrupt if UPRSME is set.
5 EORSMI
signal initiated by the host. This triggers an USB interrupt if EORSME is set. Shall be cleared by software. Setting by software has no effect.
4 WAKEUPI
See Section “Suspend, Wake-Up and Resume” for more details.
116 AT85C51SND3Bx
3 EORSTI
controller. This triggers an USB interrupt if EORSTE is set. Shall be cleared by software. Setting by software has no effect.
2 SOFI
(every 1 ms). This triggers an USB interrupt if SOFE is set.
1 MSOFI
detected (every 125 µs). This triggers an USB interrupt if MSOFE is set.
0 SUSPI
for 3 ms) is detected. This triggers an USB interrupt if SUSPE is set. Shall be cleared by software. Setting by software has no effect. See Section “Suspend, Wake-Up and Resume” for more details. Table 114. UDIEN Register The value read from these bits is always 0. Do not set these bits.
6 UPRSME
Set to enable the UPRSMI interrupt. Clear to disable the UPRSMI interrupt.
5 EORSME
Set to enable the EORSMI interrupt. Clear to disable the EORSMI interrupt.
4 WAKEUPE
Set to enable the WAKEUPI interrupt. Clear to disable the WAKEUPI interrupt.
3 EORSTE
Set to enable the EORSTI interrupt. This bit is set after a reset. Clear to disable the EORSTI interrupt.
2 SOFE
Set to enable the SOFI interrupt. Clear to disable the SOFI interrupt.
1 MSOFE
Set to enable the MSOFI interrupt. Clear to disable the MSOFI interrupt.
0 SUSPE
Set to enable the SUSPI interrupt. Clear to disable the SUSPI interrupt. Table 115. UDADDR Register
7 ADDEN
Set to activate the UADD (USB address). Cleared by hardware. Clearing by software has no effect. See Section “Address Setup” for more details. Set to configure the device address. Table 116. UDFNUMH Register The value read from these bits is always 0. Do not set these bits. updated if a corrupted SOF is received. Table 117. UDFNUML Register
118 AT85C51SND3Bx
Table 118. UDMFN Register The value read from these bits is always 0. Do not set these bits.
4 FNCERR
This bit and the SOFI interrupt are updated at the same time. The value read from these bits is always 0. Do not set these bits. Table 119. UENUM Register The value read from these bits is always 0. Do not set these bits. Set to select the number of the endpoint which shall be accessed by the CPU. See Section “Endpoint Selection” for more details. Table 120. UERST Register
The value read from these bits is always 0. Do not set these bits. Section “Endpoint Reset” for more information. Table 121. UECONX Register The value read from these bits is always 0. Do not set these bits.
5 STALLRQ
Set to request a STALL answer to the host for the next handshake. See Section “STALL Request” for more details.
4 STALLRQC
Set to disable the STALL handshake mechanism. See Section “STALL Request” for more details.
3 RSTDT
For OUT endpoint: the next received packet will have the data toggle 0. For IN endpoint: the next packet to be sent will have the data toggle 0. the bit is cleared. Clearing by software has no effect.
2 EPNUMS
Set to configure the EPNUM used by the DFC. Clear to select the EPNUM used by the CPU.
1 DFCRDY
Set to resume/enable the DFC interface. Clear to pause the DFC interface.
0 EPEN
120 AT85C51SND3Bx
Table 122. UECFG0X Register The value read from these bits is always 0. Do not set these bits.
3 ISOSW
Set to automatically switch banks on each SOF . Clear to disable the automatic bank switching on each SOF. See Section “Isochronous Mode” for more details.
2 AUTOSW
Set to automatically switch bank when it is ready. Clear to disable the automatic bank switching. Management” for more details.
1 NYETDIS
Set to automatically send a “ACK” handshake instead of “Not Yet” handshake. Thus, the host will not have to “ping” for the next packet.
0 EPDIR
Set to configure an IN direction for bulk, interrupt or isochronous endpoints. Table 123. UECFG1X Register The value read from these bits is always 0. Do not set these bits. 011b: 64 bytes111b: Reserved. Do not use this configuration.
1xb: Reserved. Do not use this configuration.
1 ALLOC
Set this bit to allocate the endpoint memory. Clear to free the endpoint memory. See Section “Endpoint Activation” for more details. The value read from these bits is always 0. Do not set these bits. Table 124. UESTA0X Register
7 CFGOK
max number of allowed bank. This bit is updated when the bit ALLOC is set. correct EPSIZE and EPBK values.
6 OVERFI
interrupt (EPINTx) is triggered (if enabled). See Section “Isochronous Mode” for more details. Shall be cleared by software. Setting by software has no effect.
5 UNDERFI
interrupt (EPINTx) is triggered (if enabled). See Section “Isochronous Mode” for more details. Shall be cleared by software. Setting by software has no effect.
4 ZLPSEEN
Set by hardware, as soon as a ZLP has been filtered during a transfer. Shall be cleared by the software. Setting by software has no effect. sent. This is not relative to the current bank.
122 AT85C51SND3Bx
Set by hardware to indicate the number of busy bank. Table 125. UESTA1X Register The value read from these bits is always 0. Do not set these bits.
2 CTRLDIR
Can not be set or cleared by software. Can not be set or cleared by software.
Table 126. UEINTX Register (bit addressable)
7 FIFOCON
same time than RXOUT or RXSTP . Set by hardware when the current bank is free, at the same time than TXIN.
6 NAKINI
request from the host. This triggers an USB interrupt if NAKINE is sent. Shall be cleared by software. Setting by software has no effect.
5 RWAL
The bit is never set if STALLRQ is set, or in case of error. Cleared by hardware otherwise. This bit shall not be used for the control endpoint.
4 NAKOUTI
Shall be cleared by software. Setting by software has no effect.
3 RXSTPI
packet. An interrupt (EPINTx) is triggered (if enabled). This bit is inactive (cleared) if the endpoint is an IN endpoint.
2 RXOUTI /
interrupt (EPINTx) is triggered (if enabled). Set this bit to kill the last written bank. Cleared by hardware when the bank is killed. Clearing by software has no effect. See Section “Abort” for more details on the Abort.
124 AT85C51SND3Bx
1 STALLI
error has been detected in a OUT isochronous endpoint. Shall be cleared by software. Setting by software has no effect.
0 TXINI
interrupt (EPINTx) is triggered (if enabled). This bit is inactive (cleared) if the endpoint is an OUT endpoint. Table 127. UEIENX Register
7 FLERRE
6 NAKINE
Set to enable an endpoint interrupt (EPINTx) when NAKINI is set. Clear to disable an endpoint interrupt (EPINTx) when NAKINI is set. The value read from these bits is always 0. Do not set these bits.
4 NAKOUTE
Set to enable an endpoint interrupt (EPINTx) when NAKOUTI is set. Clear to disable an endpoint interrupt (EPINTx) when NAKOUTI is set.
3 RXSTPE
Set to enable an endpoint interrupt (EPINTx) when RXSTPI is sent. Clear to disable an endpoint interrupt (EPINTx) when RXSTPI is sent.
2 RXOUTE
Set to enable an endpoint interrupt (EPINTx) when RXOUTI is sent. Clear to disable an endpoint interrupt (EPINTx) when RXOUTI is sent.
1 STALLE
Set to enable an endpoint interrupt (EPINTx) when STALLI is sent. Clear to disable an endpoint interrupt (EPINTx) when STALLI is sent.
0 TXINE
Set to enable an endpoint interrupt (EPINTx) when TXINI is sent. Clear to disable an endpoint interrupt (EPINTx) when TXINI is sent.
Table 128. UEDATX Register Table 129. UEBCHX Register The value read from these bits is always 0. Do not set these bits. Set by hardware. This field is the MSB of the byte count of the FIFO endpoint. The LSB part is provided by the UEBCLX register. Table 130. UEBCLX Register decremented after each byte read by the software.
126 AT85C51SND3Bx
Table 131. UEINT Register The value read from these bits is always 0. Do not set these bits. corresponding endpoint interrupt enable bit is set. Cleared by hardware when the interrupt source is served.
128 AT85C51SND3Bx
7632A–MP3–03/06 The Host controller enters in Suspend state when the USB bus is in Suspend state, i.e. when the Host controller doesn’t generate the Start of Frame. In this state, the USB con- sumption is minimum. The Host controller exits to the Suspend state when starting to generate the SOF over the USB line. Device Detection A Device is detected by the USB controller when the USB bus if different from D+ and D- low. In other words, when the USB Host Controller detects the Device pull-up on the D+ line. To enable this detection, the Host Controller has to provide the Vbus power supply to the Device. The Device Disconnection is detected by the USB Host controller when the USB Idle correspond to D+ and D- low on the USB line. Pipe Selection Prior to any operation performed by the CPU, the Pipe must first be selected. This is done by: Clearing PNUMS. Setting PNUM with the Pipe number which will be managed by the CPU. The CPU can then access to the various Pipe registers and data. In the same manner, if the Pipe must be accessed by the DFC, it must first be selected. This is done by: Setting PNUMS. Setting PNUM with the Pipe number which will be managed by the DFC. Setting DFCRDY when the data-flow is ready to take place. The DFC can then access to the banks (read / write). The controller internally keeps in memory the PNUM for the CPU and the PNUM for the DFC. In fact, there are 2 PNUM registers multiplexed by the PNUMS bit. Each of them can be read or written by the CPU. These two registers permits to easily switch from a Pipe under DFC data transfer to the default control Pipe when a SETUP has to be sent, without reprogramming the EPNUM register: –S e t P N U M S , –P N U M = P i p ex – Set DFCRDY when the DFC transfer is ready to take place, – SETUP required on Pipe – Clear DFCRDY to freeze the DFC transfer, – PNUMS cleared, –P N U M = P i p e0 – Manage Pipe 0 data – Set DFCRDY. This resumes the DFC transfer.
Figure 66. Pipe activation flow: for Interrupt pipe can be modified.
130 AT85C51SND3Bx
7632A–MP3–03/06 USB Reset The USB controller sends a USB Reset when the firmware set the RESET bit. The RSTI bit is set by hardware when the USB Reset has been sent. This triggers an interrupt if the RSTE has been set. When a USB Reset has been sent, all the Pipe configuration and the memory allocation are reset. The General Host interrupt enable register is left unchanged. If the bus was previously in suspend mode (SOFE = 0), the USB controller automatically switches to the resume mode (HWUPI is set) and the SOFE bit is set by hardware in order to generate SOF immediately after the USB Reset. Address Setup Once the Device has answer to the first Host requests with the default address (0), the Host assigns a new address to the device. The Host controller has to send a USB reset to the device and perform a SET ADDRESS control request, with the new address to be used by the Device. This control request ended, the firmware write the new address into the UHADDR register. All following requests, on every Pipes, will be performed using this new address. When the Host controller send a USB reset, the UHADDR register is reset by hardware and the following Host requests will be performed using the default address (0). Remote Wake-Up Detection The Host Controller enters in Suspend mode when clearing the SOFE bit. No more Start Of Frame is sent on the USB bus and the USB Device enters in Suspend mode 3ms later. The Device awakes the Host Controller by sending an Upstream Resume (Remote Wake-Up feature). The Host Controller detects a non-idle state on the USB bus and set the HWUPI bit. If the non-Idle correspond to an Upstream Resume (K state), the RXRSMI bit is set by hardware. The firmware has to generate a downstream resume within 1ms and for at least 20ms by setting the RESUME bit. Once the downstream Resume has been generated, the SOFE bit is automatically set by hardware in order to generate SOF immediately after the USB resume.USB Pipe Reset The firmware can reset a Pipe using the pipe reset register. The configuration of the pipe and the data toggle remains unchanged. Only the bank management and the sta- tus bits are reset to their initial values. To completely reset a Pipe, the firmware has to disable and then enable the pipe. Pipe Data Access In order to read or to write into the Pipe Fifo, the CPU selects the Pipe number with the UPNUM register and performs read or write action on the UPDATX register. Control Pipe Management A Control transaction is composed of 3 phases: S E T U P Data (IN or OUT) Status (OUT or IN) Host Ready Host Suspend SOFE=1 or HWUP=1 SOFE=0
7632A–MP3–03/06 The firmware has to change the Token for each phase. The initial data toggle is set for the corresponding token (ONLY for Control Pipe): SETUP: Data0 OUT: Data1 IN: Data1 (expected data toggle) OUT Pipe Management The Pipe must be configured and not frozen first. Note: if the firmware decides to switch to suspend mode (clear SOFE) even if a bank is ready to be sent, the USB controller will automatically exit from Suspend mode and the bank will be sent.
132 AT85C51SND3Bx
7632A–MP3–03/06 “Manual” Mode The TXOUT bit is set by hardware when the current bank becomes free. This triggers an interrupt if the TXOUTE bit is set. The FIFOCON bit is set at the same time. The CPU writes into the FIFO and clears the FIFOCON bit to allow the USB controller to send the data. If the OUT Pipe is composed of multiple banks, this also switches to the next data bank. The TXOUT and FIFOCON bits are automatically updated by hardware regarding the status of the next bank. OUT DATA (bank 0) ACK TXOUT FIFOCON HW Example with 1 OUT data bank write data from CPU BANK 0 Example with 2 OUT data banks SW SW SW SW OUT OUT DATA (bank 0) ACK TXOUT FIFOCON write data from CPU BANK 0 SW SW SW SW OUT DATA (bank 1) ACK write data from CPU BANK 0 write data from CPU BANK 1 SW HW write data from CPU BANK0 Example with 2 OUT data banks OUT DATA (bank 0) ACK TXOUT FIFOCON write data from CPU BANK 0 SW SW SW SWwrite data from CPU BANK 1 SW HW write data from CPU BANK0 OUT DATA (bank 1) ACK
7632A–MP3–03/06 “Autoswitch” Mode In this mode, the clear of the FIFOCON bit is performed automatically by hardware each time the Pipe bank is full. The firmware has to check if the next bank is empty or not before writing the next data. On TXOUT interrupt, the firmware fills a complete bank. A new interrupt will be generated each time the current bank becomes free. IN Pipe management The Pipe must be configured first. “Manual” Mode When the Host requires data from the device, the firmware has to determine first the IN mode to use using the INMODE bit: INMODE = 0. The INRQX register is taken in account. The Host controller will perform (INRQX+1) IN requests on the selected Pipe before freezing the Pipe. This mode avoids to have extra IN requests on a Pipe. INMODE = 1. The USB controller will perform infinite IN request until the firmware freezes the Pipe. The IN request generation will start when the firmware clear the PFREEZE bit. Each time the current bank is full, the RXIN and the FIFOCON bits are set. This triggers an interrupt if the RXINE bit is set. The firmware can acknowledge the USB interrupt by clearing the RXIN bit. The Firmware read the data and clear the FIFOCON bit in order to free the current bank. If the IN Pipe is composed of multiple banks, clearing the FIFO CON bit will switch to the next bank. The RXIN and FIFOCON bits are then updated by hardware in accordance with the status of the new bank. IN DATA (to bank 0) ACK RXIN FIFOCON HW IN DATA (to bank 0) ACK HW SW SW SW Example with 1 IN data bank read data from CPU BANK 0 IN DATA (to bank 0) ACK RXIN FIFOCON HW IN DATA (to bank 1) ACK SW SW Example with 2 IN data banks read data from CPU BANK 0 HW SW read data from CPU BANK 0 read data from CPU BANK 1
134 AT85C51SND3Bx
new interrupt will be generated each time the current bank contains data to read. The acknowledge of the RXIN interrupt is always performed by software. prevent the RXINI interrupt from being triggered. Figure 67. USB Host Controller Interrupt System
Figure 68. USB Host Controller Pipe Interrupt System
136 AT85C51SND3Bx
Table 132. UHCON Register The value read from these bits is always 0. Do not set these bits.
2 RESUME
Set this bit to generate a USB Resume on the USB bus.
1 RESET
Set this bit to generate a USB Reset on the USB bus. Refer to the USB reset section for more details.
0 SOFE
Set this bit to generate SOF on the USB bus. Table 133. UHINT Register The value read from this bit is always 0. Do not set this bit.
6 HWUP
Set by hardware when a non-idle state is detected on the USB bus.
5 HSOFI
USB interrupt when HSOFE is set.
4 RXRSMI
Shall be cleared by software. Setting by software has no effect.
3 RSMEDI
Set by hardware when a Downstream Resume has been sent to the Device. Shall be cleared by software. Setting by software has no effect.
2 RSTI
Set by hardware when a USB Reset has been sent to the Device. Shall be cleared by software. Setting by software has no effect.
1 DDISCI
Set by hardware when the device has been removed from the USB bus. Shall be cleared by software. Setting by software has no effect.
0 DCONNI
Set by hardware when a new device has been connected to the USB bus. Shall be cleared by software. Setting by software has no effect. Table 134. UHIEN Register The value read from this bit is always 0. Do not set this bit.
6 HWUPE
Set this bit to enable HWUP interrupt. Clear this bit to disable HWUP interrupt.
5 HSOFE
Set this bit to enable HSOF interrupt. Clear this bit to disable HSOF interrupt.
4 RXRSME
Set this bit to enable the RXRSMI interrupt. Clear this bit to disable the RXRSMI interrupt.
3 RSMEDE
Set this bit to enable the RSMEDI interrupt. Clear this bit to disable the RSMEDI interrupt.
2 RSTE
Set this bit to enable the RSTI interrupt. Clear this bit to disable the RSTI interrupt.
1 DDISCE
Set this bit to enable the DDISCI interrupt. Clear this bit to disable the DDISCI interrupt.
138 AT85C51SND3Bx
0 DCONNE
Set this bit to enable the DCONNI interrupt. Clear this bit to disable the DCONNI interrupt. Table 135. UHADDR Register The value read from this bit is always 0. Do not set this bit. These bits contains the address of the USB Device. Table 136. UHFNUMH Register The value read from these bits is always 0. Do not set these bits. The value contained in tis register is the current SOF number. This value can be modified by software.
Table 137. UHFNUML Register The value contained in tis register is the current SOF number. This value can be modified by software. Table 138. UHFLEN Register Table 139. UPNUM Register The value read from these bits is always 0. Do not set these bits. correspond then to this number. This number is used for the USB controller following the value of the PNUMD bit.
140 AT85C51SND3Bx
Table 140. UPRST Register The value read from this bit is always 0. Do not set this bit.
6 P6RST Pipe 6 Reset
Set this bit to 1 and reset this bit to 0 to reset the Pipe 6.
5 P5RST Pipe 5 Reset
Set this bit to 1 and reset this bit to 0 to reset the Pipe 5.
4 P4RST Pipe 4 Reset
Set this bit to 1 and reset this bit to 0 to reset the Pipe 4.
3 P3RST Pipe 3 Reset
Set this bit to 1 and reset this bit to 0 to reset the Pipe 3.
2 P2RST Pipe 2 Reset
Set this bit to 1 and reset this bit to 0 to reset the Pipe 2.
1 P1RST Pipe 1 Reset
Set this bit to 1 and reset this bit to 0 to reset the Pipe 1.
0 P0RST Pipe 0 Reset
Set this bit to 1 and reset this bit to 0 to reset the Pipe 0. Table 141. UPCONX Register The value read from this bit is always 0. Do not set this bit.
6 PFREEZE
Set this bit to Freeze the Pipe requests generation. Clear this bit to enable the Pipe request generation. This bit is set at 1 by hardware after a Pipe reset or a Pipe enable.
5 INMODE
stored in the UINRQX register.
4 AUTOSW
Set this bit to allow the auto switch bank mode for this Pipe. Clear this bit to otherwise. Set this bit to reset the Data Toggle to its initial value for the current Pipe. Cleared by hardware when proceed. Clearing by software has no effect.
2 PNUMS
Set to configure the PNUM used by the DFC. Clear to configure the PNUM used by the CPU. Set to resume/enable the DFC interface. Clear to pause the DFC interface.
0 PEN
Clear to disable and reset the Pipe. Table 142. UPCFG0X Register targeted by the Pipe. This value is from 0 and 15.
142 AT85C51SND3Bx
Table 143. UPCFG1X Register The value read from this bit is always 0. Do not set this bit. Select the number of bank to declare for the current Pipe. Set to configure the pipe memory with the characteristics. The value read from these bits is always 0. Do not set these bits. Table 144. UPCFG2X Register This value has no effect for a non-Interrupt Pipe.
Table 145. UPSTAX Register pipe have no effect on the configuration of the pipe. Shall be cleared by software. Setting by software has no effect. will be sent instead. An interrupt is triggered if the FLERRE bit is set. Shall be cleared by software. Setting by software has no effect. The value read from this bit is always 0. Do not set this bit. not relative to the current bank. Set by hardware to indicate the number of busy bank.
144 AT85C51SND3Bx
Table 146. UPINRQX Register Enter the number of IN transactions before the USB controller freezes the pipe. The USB controller will perform (INRQ+1) IN requests before to freeze the Pipe. Table 147. UPERRX Register The value read from these bits is always 0. Do not set these bits.
5 COUNTER1:
Pipe. When this value reaches 3, the Pipe is automatically frozen. Clear these bits by software.
4 CRC16
Set by hardware when a CRC16 error has been detected. Shall be cleared by software. Setting by software has no effect.
3 TIMEOUT
Set by hardware when a time-out error has been detected. Shall be cleared by software. Setting by software has no effect.
2 PID
Set by hardware when a PID error has been detected. Shall be cleared by software. Setting by software has no effect.
1 DATAPID
Set by hardware when a data PID error has been detected. Shall be cleared by software. Setting by software has no effect.
0 DATATGL
Set by hardware when a data toggle error has been detected. Shall be cleared by software. Setting by software has no effect.
Table 148. UPINTX Register
6 NAKEDI
Set by hardware when a NAK has been received on the current bank of the Pipe. This triggers an interrupt if the NAKEDE bit is set in the UPIENX register. Shall be clear to handshake the interrupt. Setting by software has no effect. Set by hardware when the firmware can write a new data into the Pipe FIFO. Cleared by hardware when the current Pipe FIFO is full. Set by hardware when the firmware can read a new data into the Pipe FIFO. Cleared by hardware when the current Pipe FIFO is empty.
4 PERRI
UPERRX register to determine the source of the error. Automatically cleared by hardware when the error source bit is cleared.
3 TXSTPI
triggers an interrupt if the TXSTPE bit is set in the UPIENX register. Shall be cleared to handshake the interrupt. Setting by software has no effect.
2 TXOUTI
triggers an interrupt if the TXOUTE bit is set in the UPIENX register. Shall be cleared to handshake the interrupt. Setting by software has no effect.
1 RXSTALLI /
RXSTALLE bit is set in the UPIENX register. Shall be cleared to handshake the interrupt. Setting by software has no effect. triggers an interrupt if the TXSTPE bit is set in the UPIENX register. Shall be cleared to handshake the interrupt. Setting by software has no effect.
146 AT85C51SND3Bx
0 RXINI
Pipe. This triggers an interrupt if the RXINE bit is set in the UPIENX register. Shall be cleared to handshake the interrupt. Setting by software has no effect. Table 149. UPIENX Register Set to enable the OVERFI and UNDERFI interrupts. Clear to disable the OVERFI and UNDERFI interrupts.
6 NAKEDE
Set to enable the NAKEDI interrupt. Clear to disable the NAKEDI interrupt. The value read from this bit is always 0. Do not set this bit.
4 PERRE
Set to enable the PERRI interrupt. Clear to disable the PERRI interrupt.
3 TXSTPE
Set to enable the TXSTPI interrupt. Clear to disable the TXSTPI interrupt.
2 TXOUTE
Set to enable the TXOUTI interrupt. Clear to disable the TXOUTI interrupt.
1 RXSTALLE
Set to enable the RXSTALLI interrupt. Clear to disable the RXSTALLI interrupt.
0 RXINE
Set to enable the RXINI interrupt. Clear to disable the RXINI interrupt. Table 150. UPDATX Register
Table 151. UPBCHX Register The value read from these bits is always 0. Do not set these bits. Set by hardware. This field is the MSB of the byte count of the FIFO endpoint. The LSB part is provided by the UPBCLX register. Table 152. UPBCLX Register after each byte read by the software.
148 AT85C51SND3Bx
Table 153. UPINT Register The value read from this bit is always 0. Do not set this bit. corresponding endpoint interrupt enable bit is set. Cleared by hardware when the interrupt source is served.
150 AT85C51SND3Bx
Figure 71. Audio Processor Block Diagram on 1 Kbyte of dual-port RAM. (see Figure 72b) buffers, each containing two data packets of 512 or 256 bytes size. Figure 72. Audio Buffer Configuration and ABWPR bits in APCON1. These bits are automatically reset by hardware. read from the buffer depending on the current operation. APINT is set every time a data packet (256 or 512 bytes) can be written to the buffer i.e. buffer empty or half full. APREQI is cleared when the buffer becomes full. packet (256 or 512 bytes) can be retrieved from the buffer i.e. buffer full or half full. APRDYI is cleared when the buffer becomes empty.
7632A–MP3–03/06 In order to avoid any spurious interrupts on the CPU side when a data transfer with the data flow controller is established, APREQE and APRDYE must be left cleared. Digital Audio Processor The digital audio processor is based on a proprietary digital signal processor. It provides capability to decode many digital audio formats like MP3, WMA, G726, RAW PCM… and to encode some digital audio formats like G726, RAW PCM… Processor Initialization Prior to enable the digital audio processor by setting the DAPEN bit in APCON1(1), the C51 must load the processor codec firmware which is the stream decoder or encoder. This can be achieved by setting APLOAD(2) bit in APCON1 and loading data using the C51 (through APDAT) or the DFC as detailed in the Section “Audio Buffer”. As soon as the codec firmware is fully loaded, the digital audio processor can be enabled with the effect to start the codec execution. Then the audio stream type that can be decoded or encoded depends on the codec firmware loaded. Note: 1. Clearing DAPEN bit resets the code writing pointer address to 0000h. 2. Toggling APLOAD bit leaves the code writing pointer address unchanged. Processor Interface The C51 interfacing the processor through 3 registers: APCON0 by using APCMD6:0 bits, APSTA and APINT by using APEVTI bit. APCMD field is used to send commands to the processor while APSTA and APEVTI are used by the processor to trigger an event or give a status to the C51. Command and status relies on the processor codec firmware and are beyond the scope of this document. Play Time In order to allow time stamping in case of synchronized lyrics (karaoke mode), a 24-bit time stamp is provided by APTIM2:0 registers with APTIM2 being the MSB and APTIM0 being the LSB. Time unit is millisecond. Getting the time value is done by reading first APTIM0, then APTIM1 and APTIM2. The counter value is latched during read sequence, avoiding bad reading if increment occurs. Initializing the time value is done by writing first APTIM0, then APTIM1 and APTIM2. The counter is updated after writing last time stamp byte APTIM2. Time value is automatically updated by the audio processor in case of fast for- ward/rewind operating mode. Time value is reset when operating mode switches from Stop to Play mode and frozen when in Pause mode. Audio Stream Interface Every codec firmwares (decoder or encoder) share a set of registers allowing to perform configuration and control and to get status from the decoding or encoding process. This set of registers is composed of ASCON, the audio stream control register and ASSTA0 ASSTA1 and ASSTA2, the audio stream status registers. The content of these registers depends on the codec firmware loaded and are beyond the scope of this document. Baseband Processor Several digital baseband treatments can be applied to the digital audio signal immedi- ately before internal or external D/A conversion: Digital volume control 3-bands equalizer Bass boost effect Virtual surround effect Mixing mode The baseband processor is enabled by setting BPEN bit in AUCON. When disabled (BPEN bit cleared) all of the above treatments are disabled.
152 AT85C51SND3Bx
Table 154. Digital Volume Control Gain the audio codec or the audio interface with data set to the corresponding 0 value. Table 154. Cut frequencies are defined in Table 155. Table 155. Equalizer Band Frequency a gain increase of +6 dB in the frequency range under 200 Hz. sists in applying a spatial effect to sound on both right and left channels. the 5-bit band level by reading EQLEV4:0 bits in APELEV.
the audio processor before feeding the internal or external audio DAC. setting ACLIPE bit in APIEN. The interrupt is requested each time one of the sources is asserted. Figure 73. Audio Processor Interrupt System
154 AT85C51SND3Bx
Figure 74. Audio Codec Block Diagram Audio input system features are detailed in the following sections. take care to discharge then charge the audio outputs. Table 156. Audio Codec Output Source Selection ACORG for the right channel and the AOLG4:0 bits in ACOLG for the left channel. Table 157 shows the gain value versus the programmed AORG or AOLG value.
0 Line Input (stereo)
1 Audio Processor (mono or stereo)(1)
Table 157. Audio Codec Output Gain Table 158. Audio Codec Output Drive Selection mono recording. It is enabled by setting the AIEN bit in ACCON. Audio input system features are detailed in the following sections. Table 159. When line inputs are selected as audio Table 159. Audio Codec Input Source Selection Table 160. Audio Codec Input Preamplifier Gain
0 Low/high voltage 50 KΩ drive
1 High voltage 32 Ω drive
0 Line Inputs
1 Microphone Input
156 AT85C51SND3Bx
ting or clearing AILPG bit in ACIPG according to Table 161. Table 161. Audio Codec Line Inputs Preamplifier Gain ACCON according to Table 162. Table 162. Audio Codec Microphone Bias Control Table 163. Audio Codec Microphone Bias Voltage Selection
0 Microphone bias output disabled
1 Microphone bias output enabled
Figure 75. Audio DAC Interface Block Diagram Table 164. Audio DAC Interface Over-sampling Ratio Figure 76. DSEL Output Polarity tion by filling the low significant bits with logic 0.
00 Reserved
158 AT85C51SND3Bx
Figure 77. Audio Output Format I2S Format with DSIZE = 0 and JUST4:0 = 00001. I2S Format with DSIZE = 1 and JUST4:0 = 00001. MSB/LSB Justified Format with DSIZE = 0 and JUST4:0 = 00000. 16-bit LSB Justified Format with DSIZE = 1 and JUST4:0 = 10000. 18-bit LSB Justified Format with DSIZE = 1 and JUST4:0 = 01110. Table 165. AUCON Register
7 BPEN
Set to enable the baseband processing. Clear to bypass the baseband processing and disable the baseband features.
6 VSURND
Set to enable the virtual surround effect. Clear to disable the virtual surround effect.
5 BBOOST
Set to enable the bass boost effect. Clear to disable the bass boost effect.
4 MIXEN
Set to enable mixing of ADC output with DAC output. Clear to disable mixing of ADC output with DAC output.
3 EQUDIS
Set to disable the 3-band equalizer. Clear to enable the 3-band equalizer.
The value read from these bits is always 0. Do not set these bits.
0 ACCKEN
Set to enable the Audio Controller Clock. Clear to disable the Audio Controller Clock. Table 166. APCON0 Register
0 APCMD6 APCMD5 APCMD4 APCMD3 APCMD2 APCMD1 APCMD0
The value read from this bit is always 0. Can not be set by software. Table 167. APCON1 Register The value read from these bits is always 0. Do not set these bits.
5 ABACC
Set to enable buffer access by C51 core. Clear to enable buffer access by DFC.
4 ABWPR
Set to reset the audio buffer write pointer. Cleared by hardware when write pointer is reset. Can not be cleared by software.
3 ABRPR
Set to reset the audio buffer read pointer. Cleared by hardware when read pointer is reset. Can not be cleared by software.
2 ABSPLIT
Set to configure the audio buffer as a double buffer. Clear to configure the audio buffer as a single buffer.
160 AT85C51SND3Bx
1 APLOAD
Set to enable audio processor codec code update. Clear to disable audio processor codec code update.
0 DAPEN
Set to enable the digital audio processor. Clear to disable the digital audio processor. Table 168. APSTA Register Table 169. APINT Register Set by hardware to trigger a general purpose interrupt. Cleared by hardware after writing APCON0.
3 APEVTI
Set by hardware to signal an event from the audio processor. Cleared by hardware after writing APCON0.
2 ACLIPI
Cleared by hardware after writing APCON0.
1 APRDYI
(512 or 256 bytes depending on buffer configuration). Cleared by hardware when audio buffer is empty.
0 APREQI
256 bytes depending on buffer configuration). Cleared by hardware when audio buffer is full.
Table 170. APIEN Register Set to enable the audio processor general purpose interrupt. Clear to disable the audio processor general purpose interrupt.
3 APEVTE
Set to enable the audio processor event interrupt. Clear to enable the audio processor event interrupt.
2 ACLIPE
Set to enable the audio clipping interrupt. Clear to disable the audio clipping interrupt.
1 APRDYE
Set to enable the audio packet ready interrupt. Clear to disable the audio packet ready interrupt.
0 APREQE
Set to enable the audio packet request interrupt. Clear to disable the audio packet request interrupt. Table 171. APTIM0 Register 7-0 APT7:0 Audio Processor Timer Least Significant Byte. Table 172. APTIM1 Register 7-0 APT15:8 Audio Processor Timer Intermediate Significant Byte.
162 AT85C51SND3Bx
Table 173. APTIM2 Register 7-0 APT23:16 Audio Processor Timer Most Significant Byte. Table 174. APRDVOL, APLDVOL, APBDVOL, APMDVOL, APTDVOL Registers The value read from these bits is always 0. Do not set these bits. Refer to Table 154 for information on gain control values. Table 175. APEBS Register The value read from these bits is always 0. Do not set these bits. 000b: lowest frequency band to 111b highest frequency band.
Table 176. APELEV Register The value read from these bits is always 0. Do not set these bits. 00000b: min. level to 11111b: max. level. Table 177. ACCON Register The value read from this bit is always 0. Do not set this bit.
5 AMBSEL
Set to select 1.5V bias output voltage in high or low voltage configuration. Clear to select 2V bias output voltage in high voltage configuration.
5 AMBEN
Set to enable the microphone bias output. Clear to disable the microphone bias output.
4 AISSEL
Set to select the microphone as input source. Clear to select the line inputs as input source.
3 AIEN
Set to enable the audio input system. Clear to disable the audio input system.
2 AODRV
Set to select the 32 Ω drive in high voltage configuration. Clear to select the 50 KΩ drive in high or low voltage configuration. The value read from this bit is always 0. Do not set this bit.
1 AOSSEL
Set to select the audio processor as output source. Clear to select the line inputs as output source. The value read from this bit is always 0. Do not set this bit.
164 AT85C51SND3Bx
0 AOEN
Set to enable the audio output system. Clear to disable the audio output system. The value read from this bit is always 0. Do not set this bit. Table 178. ACAUX Register (AT85C51SND3B2 and AT85C51SND3B3 only) The value read from these bits is always 0. Do not set these bits.
1 AODIS
Set to enable the audio output discharge mechanism. Clear to disable the audio output discharge mechanism.
0 AOPRE
Set to enable the audio output preload mechanism. Clear to disable the audio output preload mechanism. Table 179. ACORG Register (AT85C51SND3B2 and AT85C51SND3B3 only) The value read from these bits is always 0. Do not set these bits. Refer to Table 157 for gain value.
Table 180. ACOLG Register (AT85C51SND3B2 and AT85C51SND3B3 only) The value read from these bits is always 0. Do not set these bits. Refer to Table 157 for gain value. Table 181. ACIPG Register The value read from these bits is always 0. Do not set these bits.
3 AILPG
Refer to Table 161 for gain value. The value read from this bit is always 0. Do not set this bit. Refer to Table 160 for gain value. Table 182. ADICON0 Register The value read from these bits is always 0. Do not set these bits.
4 CSPOL
Set to output the left channel on high level of DSEL output (PCM mode). Clear to output the left channel on the low level of DSEL output (I2S mode).
3 DSIZE
Set to select 32-bit data output format. Clear to select 16-bit data output format.
166 AT85C51SND3Bx
Refer to Table 164 for bits description.
0 ADIEN
Set to enable the audio DAC interface. Clear to disable the audio DAC interface. Table 183. ADICON1 Register The value read from these bits is always 0. Do not set these bits. Refer to Section “Audio DAC Interface” for bits description. Table 184. ASCON Register Bits content depends on the audio codec firmware. Table 185. ASSTA0 Register Bits content depends on the audio codec firmware.
Table 186. ASSTA1 Register Bits content depends on the audio codec firmware. Table 187. ASSTA2 Register Bits content depends on the audio codec firmware.
168 AT85C51SND3Bx
These units are detailed in the following sections. Figure 78. NFC Controller Block Diagram
Figure 79. Nand Flash Connection controller receives its system clock and can then be configured. Table 188). The first byte written is byte 0. After writing a descriptor, a new one can be written to the NFC. Table 188. Configuration Descriptor Content
0 NFPGCFG NF Device Page Configuration Register
Refer to Table 189 for register content organization.
1 SMPGCFG SMC Device Page Configuration Register
Refer to Table 189 for register content organization.
2 SCFG1 Sub Configuration Register 1
Refer to Table 190 for register content organization.
3 SCFG2 Sub Configuration Register 2
Refer to Ta bl e 191 for register content organization.
4 FPBH NF Device First Protected Block Address Registers
5 FPBL
6 LPBH NF Device Last Protected Block Address Registers
7 LPBL
170 AT85C51SND3Bx
Table 189. NFPGCFG / SMPGCFG Registers Number of data bytes in a page (unit is 512 bytes). The value read from these bits is always 0. Do not set these bits. Table 190. SCFG1 Register The value read from this bit is always 0. Do not set this bit. Write the number of devices connected (SMC/XD included) minus 1. Refer to Table 198 for more details.
0 SMCEN
Clear to disable SMC support. Table 191. SCFG2 Register The value read from these bits is always 0. Do not set these bits.
typically to prepare a page for read or write. event will lead to an ILLEGAL interrupt. Table 192. Action Decoding device number is memorized until a new device selection action is performed. the configuration allowed, an illegal interrupt is triggered. is needed by the controller for the block protection management. The device number is selected by EXT . x CELOW 1 0 0 Selected NFCE signal assertion. x x 1 0 1 Data transfer stop. A9 A8 1 1 0 Column address extension. x x 1 1 1 Reserved for future use.
172 AT85C51SND3Bx
Table 193. Device Selection Allowed Configuration spare zone, its information will be checked. spare zone, its information will be set. selected by the last ‘device select’ action is asserted (NFCE [DEV]= L). the new one is asserted (NFCE [NEW_DEV]= L). The NFCE signal is automatically de-asserted at the completion of the commands. needs to have the absolute column address to stop automatically at the end of the page. default value. A read or a write in NFADC resets A9:8 to 00h. 01h selects the 2nd half zone, i.e. the 256-511 range in the data zone. 10h selects the spare zone, i.e. the 512-527 range in the data zone. the SMLCK bit is irrelevant. value. SMCTE shall be cleared.
7632A–MP3–03/06 Note that it is not possible to reset A9:8 after each command (write in NFCMD): the device status read command is used after opening a page (for read) to poll the busy status. Command Sending Writing a command in NFCMD generates the following cycles: Assembly code: mov direct, # A write in that register re-initializes the ECC engine and the ECC FIFO. A read in that register returns an unexpected value. Address Sending Writing an address in NFADC (column address) or NFADR (row address) generates the following cycles: Assembly code: mov direct, # The NFADC register is used to select the column address. The NFC uses that informa- tion to build an internal byte counter in the page, thus allowing it to stop at the end of the page. 512B NF memories (NDB= 1) have 1 column cycle. Other NF memories have 2 column cycles. The NFADR register is used to select the raw address, i.e. the page address. The NFC uses that information to verify if the block is protected or not. Both kind of information are reset after a read of a write of the NFCMD register. A read in NFADC or NFADR returns an unexpected value. NFCEx NFCLE NFALE NFWE NFRE NFD[7:0] Command NFCLK / 2 Address NFCEx NFCLE NFALE NFWE NFRE NFD[7:0] NFCLK / 2
174 AT85C51SND3Bx
NF cycle, depending if the software reads or writes in those registers. Note: The ECC is also computed when byte are read or written via NFDAT or NFDATF. signals will be asserted accordingly) to store the byte given by the CPU. long as the “read cycle” is not performed). pulse width can be programmed using TRS bit in NFCON according to Table 194. Table 194. Read Cycle Configuration NFRE asserted during 1.5 clock period and deasserted during 0.5 clock period. NFRE asserted during 1 clock period and deasserted during 1 clock period.
7632A–MP3–03/06 Assembly code: mov #, direct A read of NFDAT returns to the CPU the byte contained in that register, but does not launch an extra background “read cycle”. Assembly code: mov #, direct In all the previous examples, the NFCE line is asserted low and de-asserted at the end of the cycle. This allows minimizing the power consumption. Access Example Figure 80 shows a read access in a 512B page. Note that the NFCE must be held low during the access time for that kind of memory: Read data, TRS cleared CPU: 40 ns setup, timing [1.5; 0.5] [15;30] ns hold NFCEx NFCLE NFALE NFWE NFRE NFD[7:0] NFCLK / 2 Read data, TRS set CPU: 40 ns setup Timing [1; 1] [15;30] ns hold NFCEx NFCLE NFALE NFWE NFRE NFD[7:0]
176 AT85C51SND3Bx
Figure 80. Nand Flash Read Example “ ifc CPU” illustrates the commands given by the CPU to the NFC. “auto” illustrates the actions automatically launched by the NFC. “ready” is the flow control line between the DFC macro and the NFC interface. “BUSY D ” is the busy state of the device D. “P” is the Polling action. between the NF memories and on-chip memories (USB, SRAM, …). A ‘data zone’ is a data area composed of NDB contiguous bytes. The ‘spare zone’ is located after the ‘data zone’ until the end of the page. Spare Zone Content The “16-byte” spare zone contains information as specified in Table 195.
512 B 16 B
2048 B 64 B
Table 195. Spare Zone Content The bytes which are not managed by the NFC are written to FFh. Write Session The spare zone is processed after the ‘data zone’. the 2-bytes-descriptor stored in NFLOG (see Table 197, page 179 for more details). The ECC used can detects 2 wrong bits or more, and correct one bit. enable bit and the ECCRDYE bit which is the ECC ready interrupt enable bit. give detail on the management modes. Table 196. Spare Zone Management Modes 0-1 User Data Area. Shall be managed by software. 2 ECC Valid. Managed by NFC. 3 User Data Byte. Managed by NFC through NFUDAT register. 4 Data Status Flag. Shall be managed by software. 5 Block Status Flag. Shall be managed by software. 8-10 ECC Area-2. Managed by NFC. 13-15 ECC Area-1. Managed by NFC. The spare zone is not managed by the NFC. The spare zone is entirely managed by the NFC. bytes processed. The user must program/verify the spare zone.
178 AT85C51SND3Bx
7632A–MP3–03/06 Spare Zone Mode 1 The spare zone is not managed by the NFC. The data zone is contiguous. The user sends the commands to prepare the page for read or write. The data flow starts when the READ or WRITE bits are set by the user (write in NFACT). The NFC did not manage the spare zone, and did not stop when the ECC FIFO is full. Thus, NFC stops when it reaches the end of the data zone, or when it receives a STOP action. Spare Zone Mode 2 The spare zone is entirely managed by the NFC. The ECC is computed when the data flow starts. Each 256 bytes met, a 3-bytes ECC is built and stored in an ECC FIFO. When the ECC FIFO is full, the NFC stops the flow control to the DFC, and process the spare zone (ECC, logical value, parity... described later). If the data flow stops before the end of the data zone, the user has the responsibility to stop the NFC and to program the spare zone. The NFC will stop (idle mode) when it meet the end of the page. In this case, according to NECC, the controller will program/verify the appropriate spare zone(s). Let’s take an example with 2kB memories: if the flow starts from the beginning of the page, NECC is 4 and the 4 spare zones will be verified or checked if the flow starts at offset 512, NECC is 3 and the 3 last spare zones of the page be verified or checked. e t c . Note that; For WRITE session, the byte at offset 2 is written to 0 (ECC valid) when the spare zone is written. For READ session, the ECC is verified only if the ECC is valid (byte at offset 2 is 0). This mechanism ensures that the ECC is verified when it is valid. This mode is particularly well suited for 512B and 2kB memories. For other kind of mem- ories, mode 3 is preferable. Spare Zone Mode 3 The spare zone is not automatically managed by the NFC. The ECC is computed and stored in the ECC FIFO. When the ECC FIFO is full, the flow control is stopped and an interrupt is sent. The NFC returns to the idle state. For 512B memories, the ECCRDYI interrupt is always triggered after 512 data bytes seen. For 2kB memories and higher memories, the ECCRDYI interrupt is always triggered after 2048 data bytes seen. The ECC engine is reset after a write in the NFCMD register. NECC gives the number of ECC in the FIFO. Depending on the mapping of the page, the user have the possibility to: send the right events to program/verify the spare zone (reading the ECC FIFO). The READ or WRITE bits must be set (write in NFACT) to resume the data transfer, until the end of the page or an STOP action. The firmware shall also re-initialize the ECC FIFO by writing to NFECC. 0 1 0 Not Supported This configuration is reserved and must not be programmed. 1 0 X Not Supported This configuration is reserved and must not be programmed. SPZEN ECCEN ECCRDYE Description
transfer, and to write all the ECC bytes at the end of the page. Table 197. The first byte written is byte 0. The logical block Table 197. Logical Block Address descriptor Content Reset Value = 0000 0000b for each byte. must properly stop the page programming by copying old sectors to the new page. Moreover, the spare zone shall also be managed by the software. through NFDAT or NFDATF, spare zone included. A read of NFDAT or NFADC does not increment the NFBP counter. mode, and only when the NFC is not running. last ECC can be written/checked. 0 LBAH Logical Block Address (MSB). 1 LBAL Logical Block Address (LSB).
180 AT85C51SND3Bx
memories are protected at the same time, i.e. NF and SMC if a SMC is present. (PDEV). All this information is part of the Configuration Descriptor. rizes which device is locked or not. Table 198. Protected Device versus PDEV Value below LPB and any block address that is above FPB. If FPB is equal to LPB, all the flash is protected.This is the default behavior.
Figure 81. Nand Flash Write Protection Scheme bit in error within the byte (1 byte). Table 199. ECC Error Descriptor
0 Error Identification Byte
Refer to Table 200 for information on byte content.
1 First 256-byte group of the sector
2 Second 256-byte group of the sector
3 Bit offset in the byte
Refer to Table 200 for information on byte content. Table 200. ECC Error Identification Byte
182 AT85C51SND3Bx
pull-up, in order to provide static high level when card is not present in the socket. SMINS level is reported by SMCD bit(1) in NFSTA. to H (card insertion or removal) set SMCTI, the SM Card Toggle Interrupt flag in NFINT. Note: 1. SMCD bit is not relevant until SMC management is enabled. Figure 82. Card Detection Input Block Diagram The value read from these bits is always 0. Id of the error in the second “256-byte” group of the sector. 3: Not correctable error in the ECC. Anyway, the data is good. Id of the error in the first “256-byte” group of the sector. 3: Not correctable error in the ECC. Anyway, the data is good. Table 201. ECC ERror Identification Byte The value read from these bits is always 0.
184 AT85C51SND3Bx
Table 202. NFCFG Register Reading from this register resets the FIFO manager. Table 203. NFLOG Register Reading from this register resets the FIFO manager logical block address.
Table 204. NFCON Register The value read from these bits is always 0. Do not set these bits. Set to use timing [1; 1] for read cycle. Clear to use timing [1.5; 0.5] for read cycle. Set to unprotect the flash devices (NFWP signal de-asserted). Clear to protect the flash devices (NFWP signal asserted).
2 SPZEN
Clear to disable the spare zone management.
1 ECCEN
Set to enable the ECC calculation. Clear to disable the ECC calculation. Set to enable the NF controller. Clear to put the NFC is in the ‘suspend’ state. Table 205. NFERR Register Sequential reading returns the 4-byte ECC error descriptor (see Table 199). This register is updated following an ECC error (ECCERRI set). Table 206. NFADR Register
186 AT85C51SND3Bx
A read of that register returns an unexpected value. Table 207. NFADC Register Table 208. NFCMD Register Table 209. NFACT Register The value read from these bits is always 0. Do not set these bits. Refer to Table 192 for the bit description. Refer to Table 192 for the bit description.
Table 210. NFDAT Register Writing data sends a data to the currently selected NF. Reading data gets the data returned by the last read cycle. Table 211. NFDATF Register Writing data sends a data to the currently selected NF. cycle on the currently selected NF. Table 212. NFSTA Register
7 SMCD
Set by hardware when the SMINS input is High. Cleared by hardware when the SMINS input is Low.
6 SMLCK
Set by hardware when the SMC is write-protected. Cleared by hardware when the SMC is not write-protected. The value read from this bit is always 0. Do not set this bit.
4 NFEOP
Set by hardware when the controller stops at the end of the page. clear by hardware if the controller did not reach the end of the page. Set/clear by hardware. See Section “ECC Error Management” for more details.
188 AT85C51SND3Bx
0 NFRUN
Set by hardware to signal that it is currently running. Cleared by hardware to signal it is not running. Table 213. NFECC Register Sequential reading returns 2 ECC values of 3 bytes. Writing any data resets the ECC engine and the FIFO manager. Table 214. NFINT Register The value read from these bits is always 0. Do not set these bits.
4 SMCTI
Set by hardware every time SMCD bit in NFSTA is toggling. Shall be cleared by software.
3 ILGLI
Set by hardware when an illegal operation is performed. Shall be cleared by software.
2 ECCRDYI
Set by hardware when the ECCs (6 bytes) are ready for operation. This bit is set/clear even if the spare zone is automatically managed (ECCEN). Shall be cleared by software.
1 ECCERRI
Set by hardware when a bad ECC is seen. Shall be cleared by software.
0 STOPI
Shall be cleared by software.
Table 215. NFIEN Register The value read from these bits is always 0. Do not set these bits.
4 SMCTE
Set to enable the SMCTI interrupt. Clear to disable the SMCTI interrupt.
3 ILGLE
Set to enable the ILGLI interrupt. Clear to disable the ILGLI interrupt.
2 ECCRDYE
Set to enable the ECCRDYI interrupt. Clear to disable the ECCRDYI interrupt.
1 ECCERRE
Set to enable the ECCERRI interrupt. Clear to disable the ECCERRI interrupt.
0 STOPE
Set to enable the STOPI interrupt. Clear to disable the STOPI interruption. Table 216. NFUDAT Register User defined byte stored in byte position 3 of each spare zone.
190 AT85C51SND3Bx
Table 217. NFBPH Register Most significant byte of the Byte Position counter. Table 218. NFBPL Register Least significant byte of the Byte Position counter.
192 AT85C51SND3Bx
Figure 87. Command Line Controller Block Diagram Bytes) must be loaded in the command transmit FIFO using the MMCMD register. RXCEN bit in MMCON1 register to indicate whether a response is expected or not. RFMT bit in MMCON0 register to indicate the response size expected. for response that do not include CRC7. Figure 88 summarizes the command transmission flow. transmission also clears the TXCEN flag. register which resets the write pointer to the transmit FIFO.
Figure 88. Command Transmission Flow register which resets the read pointer to the receive FIFO. and clearing the CCR bit in MMCON2 register. This time-out may be disarmed when receiving the response.
194 AT85C51SND3Bx
the data transmitter channel and by the data receiver channel. (see Section “Data Flow Controller”, page 78) or by the C51 using MMDAT register. Figure 89. Data Line Controller Block Diagram Table 219. In case of 1-bit bus width Table 219. Data Bus Size be read or written depending on the receive or transmit mode. 2-3 Reserved for future use, do not program these values.
196 AT85C51SND3Bx
7632A–MP3–03/06 Data Transmission Transmission is enabled by setting DATEN bit in MMCON1 register. FIFO must be filled after this flag is set. If at least the FIFO is half full, data is transmitted immediately when the response to the write command has already been received, or is delayed after the reception of the response if its status is correct. In both cases transmission is delayed if a card sends a busy state on the data line until the end of this busy condition. According to the MMC specification, the data transfer from the host to the card may not start sooner than 2 MMC clock periods after the card response was received (formally N WR parameter). To address all card types, this delay can be programmed using DATD1:0 bits in MMCON2 register from 3 MMC clock periods when DATD1:0 bits are cleared to 9 MMC clock periods when DATD1:0 bits are set, by step of 2 MMC clock periods. End of Transmission In data stream mode, the end of a data frame transmission is signalled by the EOFI flag in MMINT register. This flag may generate an interrupt request as detailed in Section “Interrupt”. It is set, after reception of the End bit. This assumes that the STOP command has previously been sent to the card, which is the only way to stop stream transfer. In data single block mode, the end of a data frame transmission is signalled by the EOFI flag in MMINT register. This flag may generate an interrupt request as detailed in Section “Interrupt”. It is set after the end of busy signal on SDDAT0 line. After reception of the CRC status token, two other flags in MMSTA register: DATFS and CRC16S report a status on the frame sent. DATFS indicates if the CRC status token for- mat is correct or not, and CRC16S indicates if the card has found the CRC16 of the block correct or not. CRC16S must by reset by software by setting DCR bit in MMCON2 register. EOBI flag in MMINT register is also set at the same time as EOFI, and may generate an interrupt request as detailed in Section “Interrupt” In data multi block mode, the end of a data frame transmission is signalled by the EOFI flag in MMINT register. This flag may generate an interrupt request as detailed in Section “Interrupt”. It is set after the end of busy signal on SDDAT0 line.This assumes that the STOP command has previously been sent to the card, which is the only way to stop stream transfer. The end of a block transmission is signalled by the EOBI flag in MMINT register. This flag may generate an interrupt request as detailed in Section “Interrupt”. It is set after the end of busy signal on SDDAT0 line. After reception of the CRC status token of a block, two other flags in MMSTA register: DATFS and CRC16S report a status on the frame sent. DATFS indicates if the CRC sta tus token format is correct or not, and CRC16S indicates if the card has found the CRC16 of the block correct or not. CRC16S must by reset by software by setting DCR bit in MMCON2 register. Busy Status The card uses a busy token during a block write operation. This busy status is reported by the CBUSY flag in MMSTA register. The busy signal is set to 0 by the card after the CRC token. At the end of busy signal, the flag DATEN is cleared and EOFI flag is set. Note: some cards do not respect MMC specification, and the busy status is reported too late on the dat0 line, considering the Nst parameter. So CBUSY flag is not set. In this case, sta- tus of the card must be asked with a card command.
Figure 91. Data Stream Transmission Flows
198 AT85C51SND3Bx
Figure 92. Data Block Transmission Flows by clearing the DATDIR bit in MMCON1 register. interrupt modes, these flows assume that block length is greater than 16 Bytes. flags in MMSTA register: DATFS and CRC16S give a status on the frame received. CRC16S has no meaning and stays cleared. DATEN flag is cleared when EOFI is set.
may be reset by setting and clearing the DCR bit in MMCON2 register. end of frame (EOFI flag set) in case of block length less than 8 data (1, 2 or 4). frozen stopping card data transfer thanks to the controller automatic flow control. HFRI set), software is requested to flush this FIFO by reading 16 or 8data. to the controller automatic flow control. ware responsibility not to read from MMDAT register while a DFC transfer is enabled. Figure 93. Data Stream Reception Flows
200 AT85C51SND3Bx
Figure 94. Data Block Reception Flows pull-up, in order to provide static high level when card is not present in the socket. SDINS level is reported by CDET bit(1) in MMSTA. Note: 1. CDET bit is not relevant until MMC controller is enabled (MMCEN = 1). Figure 95. Card Detection Input Block Diagram order to provide static high level when card is not present in the socket. SDLCK level is reported by SDWP bit(1) in MMSTA register. present in the socket (CDET = 0).
202 AT85C51SND3Bx
Table 221. MMCON0 Register
6 DPTRR
Set to reset the read and write pointer of the data FIFO. Cleared by hardware after pointer reset is achieved.
5 CRPTR
Set to reset the read pointer of the receive command FIFO. Cleared by hardware after pointer reset is achieved.
4 CTPTR
Set to reset the write pointer of the transmit command FIFO. Cleared by hardware after pointer reset is achieved.
3 MBLOCK
Set to select multi-block data format. Clear to select single block data format.
2 DFMT
Set to select the block-oriented data format. Clear to select the stream data format.
1 RFMT
Set to select the 48-bit response format. Clear to select the 136-bit response format.
0 CRCDIS
Set to disable the CRC7 computation when receiving a response. Clear to enable the CRC7 computation when receiving a response. Table 222. MMCON1 Register Refer to Ta bl e 220 for bits description.
3 DATDIR
Set to select data transfer from host to card (write mode). Clear to select data transfer from card to host (read mode).
2 DATEN
status if any in transmission mode.
1 RXCEN
Set to enable the reception of a response following a command transmission. Cleared by hardware when response is received.
0 TXCEN
Set to enable transmission of the command FIFO to the card. Cleared by hardware when command is transmitted. Table 223. MMCON2 Register
7 FCK
Set to enable the MCLK clock out permanently. Clear to disable the MCLK clock and enable flow control.
6 DCR
Cleared by hardware after the data line controller reset is achieved.
5 CCR
Set to reset the command line controller in case of transfer abort. Cleared by hardware after the data line controller reset is achieved. Refer to Ta bl e 219 for bits description.
0 MMCEN
Set to enable the MMC clocks and activate the MMC controller. Clear to disable the MMC clocks and freeze the MMC controller. Table 224. MMBLP Register
204 AT85C51SND3Bx
Table 225. MMSTA Register
7 SDWP
Set by hardware when the SD card socket WP switch is opened. Cleared by hardware when the SD card socket WP switch is closed.
6 CDET
Set by hardware when the SD card socket presence switch is opened. Cleared by hardware when the SD card socket presence switch is closed.
5 CBUSY
Set by hardware when the card sends a busy state on the data line. Cleared by hardware when the card no more sends a busy state on the data line.
4 CRC16S
Set by hardware when the token response reports a bad CRC. Cleared by software by setting DCR bit in MMCON2. Set by hardware when the CRC16 received in the data block is not correct. Cleared by software by setting DCR bit in MMCON2.
3 DATFS
Set by hardware when the format of the token response is correct. Cleared by hardware when the format of the token response is not correct. Set by hardware when the format of the frame is correct. Cleared by hardware when the format of the frame is not correct.
2 CRC7S
Set by hardware when the CRC7 computed in the response is correct. Cleared by hardware when the CRC7 computed in the response is not correct. This bit is not relevant when CRCDIS is set.
1 WFRS
Cleared by hardware when FIFO is not ready.
0 HFRS
Cleared by hardware when FIFO is not ready.
Table 226. MMINT Register
7 CDETI
Set by hardware every time CDET bit in MMSTA is toggling.
6 EORI
Set by hardware at the end of response reception.
5 EOCI
Set by hardware at the end of command transmission.
4 EOFI
Set by hardware at the end of frame (stream, single block or multi block) transfer.
3 WFRI
2 HFRI
1 EOBI
Set by hardware at the end of block (single block or multi block) transfer. The value read from this bit is always 0. Do not set this bit. Table 227. MMMSK Register
7 CDETM
Set to prevent CDETI flag from generating an interrupt. Clear to allow CDETI flag to generate an interrupt.
206 AT85C51SND3Bx
6 EORM
Set to prevent EORI flag from generating an interrupt. Clear to allow EORI flag to generate an interrupt.
5 EOCM
Set to prevent EOCI flag from generating an interrupt. Clear to allow EOCI flag to generate an interrupt.
4 EOFM
Set to prevent EOFI flag from generating an interrupt. Clear to allow EOFI flag to generate an interrupt.
3 WFRM
Set to prevent WFRI flag from generating an interrupt. Clear to allow WFRI flag to generate an interrupt.
2 HFRM
Set to prevent HFRI flag from generating an interrupt. Clear to allow HFRI flag to generate an interrupt.
1 EOBM
Set to prevent EOBI flag from generating an interrupt. Clear to allow EOBI flag to generate an interrupt. The value read from this bit is always 0. Do not set this bit. Table 228. MMCMD Register Output (read) register of the response FIFO. Input (write) register of the command FIFO. Table 229. MMDAT Register Input (write) or output (read) register of the data FIFO.
208 AT85C51SND3Bx
detailed in following sections and differs depending on SA0 level. addressing truth table. Figure 100 and Figure 101 show the read and write host cycles. Table 230. PSI Addressing Truth Table Figure 100. Host Read Waveforms Figure 101. Host Write Waveforms ure 102 shows the write sampling delay waveform.
1 Read Host reads the PSISTH register to get PSI status from both hardware and
1 Write Host writes in the FIFO.
0 Read
Host reads data from the source peripheral through the FIFO. Host reads data from the FIFO.
0 Write
Host writes data to the destination peripheral through the FIFO. Host writes data in the FIFO.
210 AT85C51SND3Bx
Section “Data Flow Controller”, page 78). As soon as one of these two conditions is triggered, the PSRUN flag in PSISTA is set. CON while global PSI interrupt is enabled in IEN1 (see Figure 104). Notes: 1. Overrun and underrun conditions may appear in both transfer modes (CPU or DFC).
- In overrun condition, the data written by the host is discarded.
- In underrun condition, the data read by the host is the same as the previous one.
and PSRUN flags in PSISTA. These flags are detailed in the previous sections. interrupt enable bit is set (EPSI in IEN1 register). Figure 104. PSI Controller Interrupt System
Table 231. PSICON Register
7 PSEN
Set to enable the PSI controller. Clear to disable the PSI controller.
6 PSBSYE
Set to enable the busy interrupt. Clear to disable the busy interrupt.
5 PSRUNE
Set to enable the overrun interrupt. Clear to disable the overrun interrupt. The value read from these bits is always 0. Do not set these bits. Table 232. PSISTA Register
7 PSEMPTY
Set by hardware when the FIFO is empty. Cleared by hardware when at least one data byte is present in the FIFO.
6 PSBSY
Can be set or cleared by software.
5 PSRUN
Set by hardware when the host sends a data and the FIFO is full. Clear by software to acknowledge the overrun condition. Set by hardware when the host reads a data and the FIFO is empty. Clear by software to acknowledge the underrun condition.
4 PSRDY
Set by hardware when a data is ready to be sent to the host. Cleared by hardware at the end of a host read cycle.
212 AT85C51SND3Bx
The value read from these bits is always 0. Do not set these bits. Table 233. PSISTH Register
7 PSHBSY
Can not be written by software. Set by software to report status to the host. Table 234. PSIDAT Register Reading this register returns the data written by the host in the FIFO. Writing this register set data in the FIFO read later by the host.
214 AT85C51SND3Bx
Figure 106. SIO Block Diagram Character Format The character consists of five fields: start, data, parity, stop and guard fields. Figure 107. Character Format Example Start Field The start field is fixed and composed of 1 bit transmitted or received at low level. to Table 236. The least significant bit is always first transmitted. Table 236. Data Bit Number Selection bit and its mode is programmable by PMOD1:0 bits in SCON according to Table 237. Table 237. Parity Mode Selection gramming STOP bit in SCON according to Table 238.
2 Guard BitsStart
1 0 EVEN: High Level if the number of bits at high level in the data field is even. 1 1 ODD: Low Level if the number of bits at high level in the data field is odd.
Table 238. Stop Bit Number Selection nected host (overrun avoiding) and is emitted after the last stop bit of a character. Table 239. Guard Field Size Selection than 4 for proper majority vote in bit reception. of bit in a character (from 9 to 11). BR R compare to the theoretical baud rate BRT. ε being the error: ε= K ⋅ |1/BBT - 1/BRR |. sidering an oversampling factor of 12 (OVERSF3:0= 11). Figure 108. Baud Rate Formula 0 0 0 guard bit inserted (default).
216 AT85C51SND3Bx
Figure 109. Baud Rate Generator Block Diagram Table 240. Baud Rate Generator Value (12x oversampling)
218 AT85C51SND3Bx
error, the parity error, and the overrun error detailed in the following sections. Framing Error A framing error occurs when the stop field of a received character is not at high level. error condition is acknowledged by clearing the PEI flag. OEI flag in SINT. Overrun error condition is acknowledged by clearing the OEI flag. obvious to discard the whole data burst and to handle the errors by the protocol (retry…). data FIFO managed by the FIFO and flow controller. Figure 112. Transmitter Block Diagram transmission always stops at the end of the character under transmission if any. FEI, PEI, OEI and EOTI flags in SINT. These flags are detailed in the previous sections. enable bits respectively in SIEN. bal SIO interrupt enable bit is set (ES in IEN0 register).
Figure 113. SIO Controller Interrupt System Table 242. SCON Register
7 SIOEN
Set to enable the Serial Input/Output port. Clear to disable the Serial Input/Output port.
4 PBEN
Set to enable parity generation according to PMOD1:0 bits. Clear to disable parity generation.
3 STOP
Set to enable generation of 2 stop bits. Clear to enable generation of 1 stop bit.
2 DLEN
Set to enable generation of 7 data bits. Clear to enable generation of 8 data bits.
220 AT85C51SND3Bx
Table 243. SFCON Register Number of time a data bit is sampled for level determination. Oversampling factor = OVRSF3:0 + 1.
3 CTSEN
Set to enable transmission hardware flow control using CTS signal. Clear to disable transmission hardware flow control.
2 RTSEN
Set to enable reception hardware flow control using RTS signal. Clear to disable reception hardware flow control. Refer to Table 241 for information on threshold values. Table 244. SINT Register The value read from this bit is always 0. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit.
5 EOTI
Cleared by hardware when the Tx FIFO or Tx shift register are not empty.
4 OEI
Clear by software to acknowledge interrupt.
3 PEI
Set by hardware when a parity error occurs in a received character. Clear by software to acknowledge interrupt.
2 FEI
Set by hardware when a framing error occurs in a received character. Clear by software to acknowledge interrupt.
Table 245. SIEN Register The value read from these bits is always 0. Do not set these bits.
5 EOTIE
Set to enable end of transmission interrupt generation. Clear to disable end of transmission interrupt generation.
4 OEIE
Set to enable overrun error interrupt generation. Clear to disable overrun error interrupt generation.
3 PEIE
Set to enable parity error interrupt generation. Clear to disable parity error interrupt generation.
2 FEIE
Set to enable framing error interrupt generation. Clear to disable framing error interrupt generation.
1 TIE
Set to enable transmission interrupt generation. Clear to disable transmission interrupt generation.
0 RIE
Set to enable reception interrupt generation. Clear to disable reception interrupt generation.
222 AT85C51SND3Bx
Table 246. SBUF Register 7-0 SIOD7:0 8-Bit data Buffer. Table 247. SBRG0 Register 7-0 CDIV7:0 Baud Rate Generator 8-bit C divider. Table 248. SBRG1 Register 7-0 ADIV7:0 Baud Rate Generator 8-bit A divider. Table 249. SBRG2 Register 7-0 BDIV7:0 Baud Rate Generator 8-bit B divider.
224 AT85C51SND3Bx
Figure 115. Typical Slave SPI Bus Configuration register (see Table 252); and SPDAT, the SPI data register (see Table 253). meaning only reception flow or transmission flow can be handled by the DFC at a time. Figure 116 summarizes the different data flow configuration allowed. Figure 116. SPI Data Flow Configurations Master Mode The SPI operates in master mode when the MSTR bit in SPCON is set. system, the master SPI should be configured before the slave SPI device. (usually status) at its own rate.
226 AT85C51SND3Bx
pin and get it back to I/O functionality. This is achieved by setting SSDIS bit in SPCON. Figure 118. SPI Slave Mode Block Diagram Note: MSTR bit in SPCON is cleared to select slave mode. Table 250. These bit rates detailed in Section "Clock Controller", page 27. In slave mode, the maximum baud rate allowed on the SCK input is limited to FOSC ÷ 4. Table 250. Serial Bit Rates Notes: 1. These frequencies are achieved in X1 mode, FPER = FOSC ÷ 2.
- These frequencies are achieved in X2 mode, FPER = FOSC .
228 AT85C51SND3Bx
tems having only one master and only one slave driving the MISO data line. Figure 121. SS Timing Diagram ted/received immediately after the previous transmission has completed. useful in some applications. ready before the end of the current transmission. Figure 122. Queuing Transmission In Master Mode MODF signals a mode fault condition. OVR signals an overrun condition.
230 AT85C51SND3Bx
OverRun Condition This error means that the speed is not adapted for the running application. has not been read by the application yet. that it can still be read. Therefore, an overrun error always indicates the loss of data. the “transmit register empty” flags. rupt source for the C51 core. SPSCR and then reading from or writing to SPDAT. The SPTE flag is set when the transmit register is empty and ready to receive new data. When SPTE interrupt source is enabled, SPIF flag does not generate any interrupt. rupts are globally enabled by setting EA bit in IEN0 register. Figure 125. SPI Interrupt System Table 251. SPCON Register
7 SPR2 SPI Rate Bit 2
Refer to Ta bl e 250 for bit rate description.
6 SPEN
Set to enable the SPI interface. Clear to disable the SPI interface.
5 SSDIS
Clear to enable SS in both master and slave modes.
4 MSTR
Set to select the master mode. Clear to select the slave mode.
3 CPOL
Set to have the clock output set to high level in idle state. Clear to have the clock output set to low level in idle state.
2 CPHA
Set to have the data sampled when the clock returns to idle state (see CPOL). Clear to have the data sampled when the clock leaves the idle state (see CPOL). Refer to Ta bl e 250 for bit rate description. Table 252. SPSCR Register
7 SPIF
Set by hardware when an 8-bit shift is completed. The value read from this bit is indeterminate. Do not set this bit.
5 OVR
received data is not overwritten). Cleared by hardware when reading SPSCR.
4 MODF
Set by hardware to indicate that the SS pin is in inappropriate logic level.
- In slave mode: SPI interface ignores all transmitted data while SS remains high.
A new transmission is perform as soon as SS returns low.
3 SPTE
2 UARTM
Set to select UART mode: data is transmitted LSB first. Clear to select SPI mode: data is transmitted MSB first.
232 AT85C51SND3Bx
1 SPTEIE
Set to enable SPTE interrupt generation. Clear to disable SPTE interrupt generation.
0 MODFIE
Table 253. SPDAT Register 7-0 SPD7:0 Synchronous Serial Data.
either graphic or text LCD display. variant in the implementation. (see Table 258); and LCDDAT, the LCD data register (see Table 259). Figure 126. Display Interface Block Diagram all signals are set to high level. Table 254. Pin Configuration vs. LCD Controller Interface Type (6800/8080)
234 AT85C51SND3Bx
ized or normalized access type. Figure 127. 6800 Normalized Type Access Cycle Figure 128. 8080 Normalized Type Access Cycle Figure 129. 6800 Special Type Access Cycle Figure 130. 8080 Special Type Access Cycle lator clock period up to 16 oscillator clock period.
access width time. In such case, LCYCW bit in LCDCON1 must be set. Figure 131. Full Access Cycle Timing LCD controller to verify this one is ready to execute next instruction. LCD controller) during the status read cycle. busy bit(s) are asserted low, clear it otherwise. When LCDBUM is reset (i.e. all bits cleared), no busy check is performed. matic busy check process is enabled. configured according to the LCD controller. to the LCD controller according to the programmed configuration.
236 AT85C51SND3Bx
Table 255. LCDCON0 Register
7 BUINV
Set to check busy bits selected in LCDBUM as active low. Clear to check busy bits selected in LCDBUM as active high.
6 LCIFS
Set to select 6800 interface type. Clear to select 8080 interface type. Address Setup and hold length in clock periods (from 1 to 4 clock periods). Access width in clock periods (from 1 to 16 clock periods). In 8080 mode, corresponds to WR or RD low state. In 6800 mode, corresponds to E high state. Table 256. LCDCON1 Register (from 1 to 4 clock periods).
5 RSCMD
Set to output high level on LA0/LRS pin during busy check process. Clear to output low level on LA0/LRS pin during busy check process. This value depends on the LCD controller.
4 LCYCW
3 LCYCT
Set to select non normalized access cycles (6800 or 8080 interface). Clear to select normalized access cycles (6800 or 8080 interface).
2 LCEN
Set to enable the LCD Interface. Clear to disable the LCD Interface.
1 LCRD
Set to initiate a read data or status register from LCD controller. Cleared by hardware at the end of read.
0 LCRS
Set to output high level on LA0/LRS pin during next read or write access. Clear to output low level on LA0/LRS pin during next read or write access. This value depends on the LCD controller. Table 257. LCDSTA Register The value read from these bits is always 0. Do not set these bits.
0 LCBUSY
controller is busy if busy check process is enabled. Table 258. LCDBUM Register Clear all bits to disable the busy check process.
238 AT85C51SND3Bx
Table 259. LCDDAT Register Reading a data automatically initiates a new read cycle to the LCD controller.
240 AT85C51SND3Bx
Table 261. KBSTA Register Set to enable a high level detection on the respective KIN3:0 input. Clear to enable a low level detection on the respective KIN3:0 input. Set to prevent the respective KINF3:0 flag from generating a keyboard interrupt. Clear to allow the respective KINF3:0 flag to generate a keyboard interrupt.
7 KPDE
Set to enable exit of power down mode by the keyboard interrupt. Clear to disable exit of power down mode by the keyboard interrupt.
6 KDCPE
Set to connect DCPWR pin on KIN0 input. Clear to isolate DCPWR pin from KIN0 input.
5 KDCPL Keyboard DCPWR Pin Line
Set by hardware and represent the level on DCPWR input. The value read from this bit is always 0. Do not set this bit. Set by hardware when the respective KIN3:0 input detects a programmed level.
7632A–MP3–03/06
Electrical Characteristics
Digital Logic Table 257. Digital DC Characteristics IOVDD = 1.65 to 3.6 V; TA = -40 to +85°C Notes: 1. Typical values are obtained at TA= 25°C. They are not tested and there is no guaran- tee on these values. Operating Conditions *NOTICE: Stressing the device beyond the “Absolute Maxi- mum Ratings” may cause permanent damage. These are stress ratings only. Operation beyond the “operating conditions” is not recommended and extended exposure beyond the “Operating Conditions” may affect device reliability. Symbol Parameter Min Typ(1) Max Units Test Conditions VIL Input Low Voltage -0.5 0.25·IOVDD V VIH1 Input High Voltage (except X1)0.65·IOVDD IOVDD +0.5 V VIH2 Input High Voltage ( X1) 0.7·IOVDD IOVDD +0.5 V VOL Output Low Voltage 0.4 V IOL = 3 mA VOH1 Output High Voltage (P0, P1, P2, P3, P4, P5) IOVDD -0.7 V IOH = -30 µA VOH2 Output High Voltage (NFD7:0, NFALE, NFCLE, NFRE , NFWE , NFCE3:0 , LD7:0, SDCMD, SDLCK, SDDAT3:0, RXD, TXD, MISO, MOSI, RTS , LCS , LA0/LRS, LRD /LDE, LWR /LRW, SCS , SRD , SWR , SA0, OCLK, DCLK, DDAT, DSEL) IOVDD -0.7 V IOH = -3 mA IIL Logical 0 Input Current (P0, P1, P2, P3, P4, P5) -50 μA VIN= 0.4 V ILI Input Leakage Current (NFD7:0, NFALE, NFCLE, NFRE , NFWE , NFCE0 ) 10 μA 0 < VIN< VDD ITL Logical 1 to 0 Transition Current (P0, P1, P2, P3, P4 and P5) -650 μA VIN= 1.0 V VIN= 2.0 V R RST RST Pull-Up Resistor 10 16 21 kΩ C IO Pin Capacitance 10 pF TA= 25°C
7632A–MP3–03/06 Oscillator & Crystal Schematic Figure 134. Crystal Connection Note: For operation with most standard crystals, no external components are needed on X1 and X2. It may be necessary to add external capacitors on X1 and X2 to ground in spe- cial cases (max 10 pF). Parameters Table 258. Oscillator & Crystal Characteristics VDD = 1.65 to 3.6 V; TA = -40 to +85°C Notes: 1. Authorized crystal frequencies are 12, 16, 20 and 24 MHz 2. Authorised input frequencies are 12, 13, 16, 19.2, 19.5, 20, 24 and 26MHz DC to DC Convertor Schematic Figure 135. Battery DC-DC Connection Notes: 1. Mandatory connection if DC-DC is used. 2. Depending on power supply scheme, CDC1 may replace CLV capacitor (see Figure 136). APVSS Q Symbol Parameter Min Typ Max Unit C X1 Internal Capacitance (X1 - VSS) 10 pF C X2 Internal Capacitance (X2 - VSS) 10 pF C L Equivalent Load Capacitance (X1 - X2) 5 pF DL Drive Level 50 μW F Crystal Frequency(1) 12 24 MHz RS Crystal Series Resistance 40 Ω CS Crystal Shunt Capacitance 6 pF LVDD BVDD BVSS Battery LDC DCLI C DC1 (2) VSS RLVDD CVSS C DC2 (1)
Table 260. DC-DC Power Characteristics Note: Depending on power supply scheme, CLV may replace CDC1 capacitor (see Figure 135). Table 262. High Voltage Regulator Power Characteristics
Table 263. Low Voltage Regulator Power Characteristics
7632A–MP3–03/06 Parameters Table 265. Audio Codec Components Characteristics TA = -40 to +85°C Notes: 1. Value in low impedance mode (Headphone mode when AODRV = 1) 2. Value in high impedance mode (Line out mode when AODRV = 0) MMC Controller Schematic Figure 139. MMC Connection Parameters Table 266. MMC Components Characteristics TA = -40 to +85°C Symbol Parameter Min Typ Max Unit C OUT OUTR/OUTL DC-Decoupling Capacitor 100(1) 0.1(2) µF C INL LINR/LINL DC-Decoupling Capacitor 1 µF C INM MICIN DC-Decoupling Capacitor 1 µF C VCM AVCM Filter Capacitor 100 nF C AREF AREF Filter Capacitor 1 µF C MB MICBIAS Filter Capacitor 10 nF R CMD IOVDD SDDAT0 SDCMD R DAT Symbol Parameter Min Typ Max Unit R CMD MMC/SD Command Line Pull-Up Resistor 100 KΩ R DAT MMC/SD Data Line Pull-Up Resistor 10 KΩ
7632A–MP3–03/06 AC Characteristics NFC Interface Definition of Symbols Table 1. NFC Interface Timing Symbol Definitions Timings Table 267. NFC Interface AC timings VDD = 1.65 to 3.6 V; TA = -40 to +85°C, CL ≤ 40pF (4 NF) Note: 1. Refer to TRS bit in NFCON register. Signals Conditions D NFD7:0 In H High O NFD7:0 Out L Low R NFRE V Valid W NFWE X No Longer Valid E NFCEn Z Floating A NFALE C NFCLE Symbol Parameter Min Max Unit TELWH NFCEn Write Setup Time 3·TNFC -?? ns TWHEH NFCEn Write Hold Time 1·TNFC -?? ns TCHWH NFCLE Setup Time 3·TNFC -?? ns TWHCL NFCLE Hold Time 1·TNFC -?? ns TAHWH NFALE Setup Time 3·TNFC -?? ns TWHAL NFALE Hold Time 1·TNFC -?? ns TWLWH NFWE Pulse Width 2·TNFC -?? ns TOVWH Data Setup Time 2·TNFC -?? ns TWHOX Data Hold Time 1·TNFC -?? ns TELDV NFCEn Access Time ?? ns TRLRH NFRE Pulse Width 2·TNFC -?? 3·TNFC -?? ns(1) TRLDV NFRE Access Time ?? ns TRHDX Data Hold Time ?? ns TRHDZ Data Float after NFRE High ?? ns TEHDZ Data Float after NFCEn High ?? ns
Figure 140. NFC Command Latch Cycle Waveforms Figure 141. NFC Address Latch Cycle Waveforms Figure 142. NFC Read Cycle Waveforms
Figure 143. NFC Write Cycle Waveforms
7632A–MP3–03/06 Waveforms Figure 144. MMC Input-Output Waveforms LCD Interface To be defined Definition of Symbols Timings Waveforms SIO Interface To be defined Definition of Symbols Timings Waveforms SPI Interface Definition of Symbols Table 270. SPI Interface Timing Symbol Definitions Timings Test conditions: capacitive load on all pins= 50 pF. TIVCH MCLK MDAT Input TCHCH TCLCXTCHCX TCHCL TCLCH MCMD Input TCHIX TOVCH MDAT Output MCMD Output TCHOX Signals Conditions C Clock H High I Data In L Low O Data Out V Valid X No Longer Valid Z Floating
Table 271. SPI Interface Master AC Timing Note: 1. Value of this parameter depends on software.
Note: 1. Not Defined but generally the MSB of the character which has just been received. Figure 146. SPI Slave Waveforms (SSCPHA= 1) Note: 1. Not Defined but generally the LSB of the character which has just been received.
7632A–MP3–03/06 Audio DAC Interface Definition of symbols Table 272. Audio DAC Interface Timing Symbol Definitions Timings Table 273. Audio Interface AC timings VDD = 1.65 to 3.6 V; TA = -40 to +85°C, CL ≤ 30pF Note: 1. 32-bit format with Fs= 48 KHz. Waveforms Figure 149. Audio Interface Waveforms External Clock Interface Definition of symbols Table 274. External Clock Timing Symbol Definitions Signals Conditions C Clock H High O Data Out L Low S Data Select V Valid X No Longer Valid Symbol Parameter Min Max Unit TCHCH Clock Period 325.5(1) ns TCHCX Clock High Time 30 ns TCLCX Clock Low Time 30 ns TCLCH Clock Rise Time 10 ns TCHCL Clock Fall Time 10 ns TCLSV Clock Low to Select Valid 10 ns TCLOV Clock Low to Data Valid 10 ns D CLK TCHCH TCLCXTCHCX TCLCHTCHCL DSEL D DAT Right Left TCLSV TCLOV Signals Conditions C Clock H High L Low X No Longer Valid
7632A–MP3–03/06 Timings Table 275. External Clock AC Timings VDD = 1.65 to 3.6 V; TA = -40 to +85°C Waveforms Figure 150. External Clock Waveform Symbol Parameter Min Max Unit TCLCL Clock Period 38 ns TCHCX High Time 10 ns TCLCX Low Time 10 ns TCLCH Rise Time 3 ns TCHCL Fall Time 3 ns TCR Cyclic Ratio in X2 mode 40 60 % TCLCL VIH1 VIL TCHCXTCLCH TCHCL TCLCX
7632A–MP3–03/06
Ordering Information
Table 280. Ordering Information Notes: 1. Codec option, see Table 281 below.
- Contact sales office for availability.
Table 281. Part Number Codec Option Table 282. Part Number Information
254 AT85C51SND3Bx
7632A–MP3–03/06
Package Information
7632A–MP3–03/06 CTBGA 100
7632A–MP3–03/06 AT85C51SND3A Table of Contents
7632A–MP3–03/06 AT85C51SND3A
7632A–MP3–03/06 AT85C51SND3A
7632A–MP3–03/06 AT85C51SND3A
7632A–MP3–03/06 AT85C51SND3A
Printed on recycled paper. 7632A–MP3–03/06 © Atmel Corporation 2006. All rights reserved. Atmel® , logo and combinations thereof, are registered trademarks, and Everywhere You Are® are the trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others. Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL’S TERMS AND CONDI- TIONS OF SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTOR Y WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICU LAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR I NCIDEN- TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically providedot- herwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel’s products are not intended, authorized, or warranted for use as compo- nents in applications intended to support or sustain life. Atmel Corporation Atmel Operations
2325 Orchard Parkway
San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 487-2600 Regional Headquarters Europe Atmel Sarl Route des Arsenaux 41 Case Postale 80 CH-1705 Fribourg Switzerland Tel: (41) 26-426-5555 Fax: (41) 26-426-5500 Asia Room 1219 Chinachem Golden Plaza
77 Mody Road Tsimshatsui
Tel: (852) 2721-9778 Fax: (852) 2722-1369 Japan 9F, Tonetsu Shinkawa Bldg. 1-24-8 Shinkawa Chuo-ku, Tokyo 104-0033 Japan Tel: (81) 3-3523-3551 Fax: (81) 3-3523-7581 Memory San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 436-4314 Microcontrollers San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 436-4314 La Chantrerie BP 70602
44306 Nantes Cedex 3, France
13106 Rousset Cedex, France
1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906, USA Tel: 1(719) 576-3300 Fax: 1(719) 540-1759 Scottish Enterprise Technology Park Maxwell Building East Kilbride G75 0QR, Scotland Tel: (44) 1355-803-000 Fax: (44) 1355-242-743 RF/Automotive Theresienstrasse 2 Postfach 3535
74025 Heilbronn, Germany
1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906, USA Tel: 1(719) 576-3300 Fax: 1(719) 540-1759 Biometrics/Imaging/Hi-Rel MPU/ High Speed Converters/RF Datacom Avenue de Rochepleine BP 123
38521 Saint-Egreve Cedex, France
www.atmel.com/literature