RU2360282C2 - Programmable serial bus controller - Google Patents
Programmable serial bus controller Download PDFInfo
- Publication number
- RU2360282C2 RU2360282C2 RU2007132778/09A RU2007132778A RU2360282C2 RU 2360282 C2 RU2360282 C2 RU 2360282C2 RU 2007132778/09 A RU2007132778/09 A RU 2007132778/09A RU 2007132778 A RU2007132778 A RU 2007132778A RU 2360282 C2 RU2360282 C2 RU 2360282C2
- Authority
- RU
- Russia
- Prior art keywords
- output
- transmitter
- receiver
- input
- unit
- Prior art date
Links
Landscapes
- Programmable Controllers (AREA)
- Information Transfer Systems (AREA)
Abstract
Description
Настоящее изобретение относится к области устройств ввода-вывода для процессоров и микроконтроллеров и более точно касается контроллеров последовательных интерфейсов SPI, Microwire, I2S, SPORT.The present invention relates to the field of input-output devices for processors and microcontrollers and more particularly relates to controllers for serial interfaces SPI, Microwire, I2S, SPORT.
На современном этапе развития цифровой вычислительной техники остро стоит проблема нехватки внешних выводов микросхемы, а также проблема организации обмена данными процессора с периферийными устройствами без отвлечения вычислительной мощности процессора. Вторую задачу решают перекладыванием задачи управления передачей и обработки данных на контроллер периферийного интерфейса, а также введением каналов DMA (прямого доступа к памяти) для данного контроллера. Первая задача решается путем функционального объединения интерфейсов. Однако в большинстве случаев используется способ, при котором контроллеры различных интерфейсов аппаратно разделены и объединяются путем мультиплицирования сигналов на выходах, что приводит к необоснованному увеличению аппаратных затрат. Кроме того, не решена задача полного объединения функций контроллеров интерфейсов SPI, I2S и SPORT в одном контроллере. Усугубляет ситуацию и то, что нет полной совместимости стандартов SPI (Motorola) [1] и Microwire (National Semiconductor) [2], т.к. выводы последовательных данных MOSI/MISO для SPI могут иметь направление входа или выхода в зависимости от того, является устройство ведущим или ведомым, а направление выводов SDO, SDI у Microwire строго фиксировано.At the present stage of development of digital computer technology, the acute problem is the lack of external outputs of the microcircuit, as well as the problem of organizing the exchange of processor data with peripheral devices without distracting the processing power of the processor. The second problem is solved by shifting the task of controlling transmission and data processing to the peripheral interface controller, as well as by introducing DMA (direct memory access) channels for this controller. The first task is solved by functional integration of interfaces. However, in most cases, a method is used in which the controllers of various interfaces are hardware-separated and combined by multiplying the signals at the outputs, which leads to an unreasonable increase in hardware costs. In addition, the problem of completely combining the functions of the controllers of the SPI, I2S, and SPORT interfaces in one controller has not been solved. The situation is aggravated by the fact that there is no full compatibility of the SPI (Motorola) [1] and Microwire (National Semiconductor) [2] standards, because MOSI / MISO serial data outputs for SPI can have an input or output direction, depending on whether the device is a master or a slave, and the direction of Microwire's SDO, SDI outputs is strictly fixed.
Классическая реализация интерфейса SPI выполнена в микроконтроллере М68НС11 фирмы Motorolla. Явный недостаток контроллера - отсутствие буферизации по направлению передачи, не позволяющее вести непрерывную передачу, в силу того, что запись новых данных в процессе передачи приводит к потере данных, был исправлен в стандарте QSPI. Стандарт QSPI предполагает наличие буферизации как в направлении передачи, так и в направлении приема, что позволяет записывать и считывать данные непосредственно во время передачи.The classic implementation of the SPI interface is made in the Motorolla microcontroller M68HC11. An obvious drawback of the controller - the lack of buffering in the direction of transmission, which does not allow continuous transmission, due to the fact that the recording of new data during the transfer leads to data loss, was corrected in the QSPI standard. The QSPI standard assumes buffering both in the transmission direction and in the receiving direction, which allows writing and reading data directly during transmission.
Однако совмещение SPI с другими интерфейсами выполняется либо путем мультиплицирования выводов от аппаратно-разделенных контроллеров, либо же схема реализуется с использованием логики захвата внешних сигналов на системный тактовый сигнал, что заметно снижает максимальную частоту передачи по данному интерфейсу.However, combining SPI with other interfaces is either done by multiplying the outputs from the hardware-separated controllers, or the circuit is implemented using the logic of capturing external signals to the system clock signal, which significantly reduces the maximum transmission frequency on this interface.
Наиболее близким техническим решением к заявляемому изобретению (ближайший аналог) является контроллер последовательных шин, входящий в состав микросхемы ADSP-BF537 [3], фирмы Analog Devices, включающий в себя функционал контроллеров SPORT и I2S.The closest technical solution to the claimed invention (the closest analogue) is a serial bus controller, which is part of the ADSP-BF537 microcircuit [3], manufactured by Analog Devices, which includes the functionality of the SPORT and I2S controllers.
Однако в микросхемах выпускаемых Analog Devices контроллер SPI по-прежнему делается отдельно от совмещенного контроллера SPORT-I2S. Объясняется это тем, что контроллер SPORT-I2S обладает рядом недостатков, затрудняющих его совмещение с SPI. Одним из них является тот факт, что после приема последнего бита порту нужен еще один фронт тактового сигнала для записи данных в буфер, а при передаче по шине SPI с приходом последнего бита формирование тактового сигнала может прекратиться. Использовать же управляющий сигнал SS для управления записью в буфер не представляется возможным, когда речь идет о контроллере, совмещающем несколько интерфейсов.However, in chips manufactured by Analog Devices, the SPI controller is still made separately from the combined SPORT-I2S controller. This is explained by the fact that the SPORT-I2S controller has several disadvantages that make it difficult to combine with SPI. One of them is the fact that after receiving the last bit, the port needs another edge of the clock signal to write data to the buffer, and when transmitting via the SPI bus with the arrival of the last bit, the formation of the clock signal may stop. It is not possible to use the control signal SS to control the writing to the buffer when it comes to a controller that combines several interfaces.
Кроме того, контроллер SPORT-I2S выполнен в виде независимых приемника и передатчика, а стандартный обмен по шине SPI предполагает управление приемом и передачей одним ведущим устройством, которое для выбора ведомого использует набор управляющих сигналов SS (выбор ведомого), поведение которых принципиально отличается от управляющих сигналов TWS (выбор канала передачи), RWS (выбор канала приема) в стандарте I2S [4], что также исключает возможность полного функционального совмещения контроллера SPORT-I2S с контроллером SPI.In addition, the SPORT-I2S controller is designed as an independent transmitter and receiver, and the standard SPI bus exchange involves controlling the reception and transmission of one master device, which uses a set of control signals SS (slave selection) to select the slave, the behavior of which is fundamentally different from the control signals TWS (selection of the transmission channel), RWS (selection of the reception channel) in the I2S standard [4], which also excludes the possibility of full functional combination of the SPORT-I2S controller with the SPI controller.
Стремясь сделать процессор более универсальным, на интегральной схеме реализуют несколько контроллеров SPI и несколько контроллеров SPORT-I2S. Это приводит к увеличению количества необходимых выводов микросхемы, а так же к увеличению ее площади. В реальных задачах задействована только определенная часть этих контроллеров, поэтому такие аппаратные затраты являются нерациональными. Логичным шагом является реализация на схеме группы контроллеров, каждый их которых может работать с широким набором интерфейсов, что приводит к более гибкому и рациональному использованию схемы.In an effort to make the processor more versatile, several SPI controllers and several SPORT-I2S controllers are implemented on the integrated circuit. This leads to an increase in the number of necessary conclusions of the microcircuit, as well as to an increase in its area. In real tasks, only a certain part of these controllers is involved, so such hardware costs are irrational. A logical step is to implement a group of controllers on the circuit, each of which can work with a wide range of interfaces, which leads to a more flexible and efficient use of the circuit.
Объектом изобретения по настоящей заявке является структурная схема программируемого контроллера последовательных шин, функционально совмещающего в себе возможность работы по интерфейсам SPI, Microwire, I2S и SPORT.The object of the invention according to the present application is a block diagram of a programmable controller for serial buses, functionally combining the ability to work on interfaces SPI, Microwire, I2S and SPORT.
Блок-схема программируемого контроллера последовательных шин согласно настоящему изобретению показана на чертеже, гдеA block diagram of a programmable serial bus controller according to the present invention is shown in the drawing, where
1 - регистр управления передатчиком1 - transmitter control register
2 - регистр состояния передатчика2 - transmitter status register
3 - регистр управления приемником3 - receiver control register
4 - регистр состояния приемника4 - receiver status register
5 - регистр управления выводами5 - pin control register
6 - блок передатчика6 - transmitter unit
7 - буфер записи7 - write buffer
8 - счетчик бит передатчика8 - transmitter bit counter
9 - выходной мультиплексор9 - output multiplexer
10 - блок приемника10 - receiver unit
11 - буфер чтения11 - read buffer
12 - приемный регистр12 - reception register
13 - блок логики обмена13 - block logic exchange
14 - счетчик бит приемника14 - receiver bit counter
15 - дешифратор15 - decoder
16 - делитель частоты передатчика16 - transmitter frequency divider
17 - делитель частоты приемника17 - receiver frequency divider
18 - блок генерации синхроимпульсов передатчика18 - transmitter clock generation unit
19 - мультиплексор тактового сигнала передатчика19 - transmitter clock multiplexer
20 - преобразователь тактового сигнала передатчика20 - transmitter clock signal converter
21 - блок генерации синхроимпульсов приемника21 - receiver clock generation unit
22 - мультиплексор тактового сигнала приемника22 - receiver clock multiplexer
23 - преобразователь тактового сигнала приемника23 - receiver clock
24 - блок генерации управляющих сигналов передатчика24 - transmitter control signal generation unit
25 - формирователь управляющего сигнала передатчика25 - transmitter control signal shaper
26 - преобразователь управляющего сигнала передатчика26 - transmitter control signal converter
27 - блок генерации управляющих сигналов приемника27 - receiver control signal generation unit
28 - формирователь управляющего сигнала приемника28 - receiver control signal shaper
29 - преобразователь управляющего сигнала приемника29 - receiver control signal converter
30 - блок управления выводами30 - terminal control unit
Схема контроллера функционально разделена на две части - приемник и передатчик. При этом приемник и передатчик могут работать как независимо (работая по разным интерфейсам и на разных частотах), так и в зависимом состоянии (при этом управляющие и тактовые сигналы передатчика дублируются для приемника), что позволяет приемнику и передатчику использовать один управляющий и один тактовый сигнал при работе порта по одному интерфейсу.The controller circuit is functionally divided into two parts - a receiver and a transmitter. At the same time, the receiver and transmitter can work both independently (operating on different interfaces and at different frequencies), and in a dependent state (in this case, the control and clock signals of the transmitter are duplicated for the receiver), which allows the receiver and transmitter to use one control and one clock signal when the port works on one interface.
Внешние выводы TCLK, TCS, TD являются соответственно выводами тактового, управляющего сигналов и последовательных данных передатчика, а внешние выводы RCLK, RCS, RD соответственно выводами тактового, управляющего сигналов и последовательных данных приемника. В такой же конфигурации они могут быть использованы и в режиме SPI, однако существует возможность гибкой настройки выводов, позволяющей использовать передатчику оба вывода TCS и RCS в качестве двухразрядной шины выбора ведомого SS [1:0]. Также есть возможность изменять направления выводов TD и RD.The external terminals TCLK, TCS, TD are respectively the conclusions of the clock, control signals and serial data of the transmitter, and the external terminals RCLK, RCS, RD are respectively the conclusions of the clock, control signals and serial data of the receiver. In the same configuration, they can be used in SPI mode, however, there is the possibility of flexible pin configuration, which allows the transmitter to use both TCS and RCS pins as a two-bit bus for selecting the slave SS [1: 0]. It is also possible to change the direction of the terminals TD and RD.
Непосредственно блок передатчика 6 состоит из буфера записи 7, выполненного в виде FIFO, и управляемого счетчиком бит 8 мультиплексора 9, через который выполняется выборка передаваемого бита.Directly, the transmitter unit 6 consists of a write buffer 7 made in the form of a FIFO and a counter 8-controlled bit 8 of the multiplexer 9, through which the transmitted bit is sampled.
Особенностью блока передатчика является то, что данные для передачи выбираются непосредственно из буфера записи 7. Такая организация позволяет получать на выходе передатчика последовательные данные сразу после записи передаваемого слова в буфер записи. Выборка бита для передачи по последовательному интерфейсу осуществляется из буфера записи через мультиплексор 9, управляемый счетчиком бит 8. Работа счетчика разрешается сигналом TEN (разрешение передачи), чтение из буфера записи осуществляется по фронту тактового сигнала tclk при разрешающем сигнале ReadWB (разрешение чтения из буфера), сброс счетчика осуществляется сигналом trst (сброс счетчика передатчика).A feature of the transmitter unit is that the data for transmission is selected directly from the write buffer 7. Such an organization allows receiving serial data at the output of the transmitter immediately after writing the transmitted word to the write buffer. The selection of bits for transmission over the serial interface is carried out from the write buffer through a multiplexer 9, controlled by the counter of bit 8. The counter is enabled by the TEN signal (transmission permission), reading from the write buffer is performed on the edge of the tclk clock signal with the enable signal ReadWB (read permission from the buffer) , counter reset is carried out by trst signal (transmitter counter reset).
Блок приемника 10 состоит из буфера чтения 11, выполненного в виде FIFO, регистра приема 12, логики обмена 13, встроенной между регистром приема и буфером чтения 11, а также счетчика бит 14 и дешифратора 15. Для определения разряда регистра, в который будут записаны принимаемые данные, используются дешифратор 15, управляемый счетчиком бит 14. Работа счетчика разрешается сигналом REN (разрешение приема), запись в буфер чтения осуществляется по фронту тактового сигнала rclk, при разрешающем сигнале WriteRB (разрешение записи в буфер чтения), сброс счетчика осуществляется сигналом rrst (сброс счетчика приемника).The receiver unit 10 consists of a read buffer 11 made in the form of a FIFO, a receive register 12, an exchange logic 13 embedded between the receive register and a read buffer 11, as well as a bit counter 14 and a decoder 15. To determine the bit of the register into which the received data, a decoder 15 is used, controlled by the counter of bit 14. The counter is enabled by the REN signal (receive permission), the write to the read buffer is performed on the edge of the rclk clock signal, with the enable signal WriteRB (write permission to the read buffer), the counter is reset is triggered by the rrst signal (receiver counter reset).
Логика обмена 13, входящая в состав приемника, выполняет обнуление или дополнение значением старшего разряда избыточных бит. Это позволяет избежать дополнительной программной обработки и возможных ошибок при приеме слов длиной меньше, чем разрядность регистра приема.The exchange logic 13, which is part of the receiver, performs zeroing or addition of the value of the senior bit of the excess bits. This avoids additional software processing and possible errors when receiving words less than the length of the reception register.
Также логика обмена выполняет функцию объединения данных из регистра приема и последнего принимаемого бита, значение которого берется непосредственно с внешнего вывода. Это позволяет записывать принятые данные в FIFO по фронту считывания для последнего бита одновременно с записью последнего бита в приемный регистр, не дожидаясь следующего фронта тактового сигнала.Also, the exchange logic performs the function of combining data from the receive register and the last received bit, the value of which is taken directly from the external output. This allows you to write the received data to the FIFO along the read edge for the last bit simultaneously with writing the last bit to the receive register, without waiting for the next edge of the clock signal.
Тот факт, что данные для передачи готовы сразу после записи передаваемого слова в буфер записи, а принятые данные записываются в буфер чтения одновременно с записью последнего бита в приемный регистр, позволяет без модификаций использовать вышеописанные блоки приема и передачи для работы в любых режимах SPI, SPORT и I2S.The fact that the data for transmission is ready immediately after writing the transmitted word to the write buffer, and the received data is written to the read buffer at the same time as the last bit is written to the receive register, allows you to use the above-described transmit and receive blocks for working in any SPI, SPORT modes without modifications and I2S.
Выборка данных через мультиплексор и запись с использованием дешифратора позволяют с минимальными аппаратными затратами реализовать передачу слов произвольной длины как старшим, так и младшим битом вперед.Sampling data through a multiplexer and recording using a decoder allows you to transfer words of arbitrary length with both the most significant and the least significant bit forward with minimal hardware costs.
Тот факт, что приемник и передатчик управляются шестью универсальными сигналами, не зависящими от выбранного протокола передачи, и срабатывают по фиксированному фронту тактового сигнала, позволяет значительно упростить логику приемника и передатчика и использовать одни и те же блоки для передачи данных по разным интерфейсам. Также это позволяет использовать тактовые и управляющие сигналы, не производя их захват на системный тактовый сигнал, что в результате дает возможность вести передачу с частотой внешнего тактового сигнала, равной FCLK/2, где FCLK - частота системного тактового сигнала.The fact that the receiver and transmitter are controlled by six universal signals that are independent of the selected transmission protocol and are triggered by a fixed edge of the clock signal allows us to significantly simplify the logic of the receiver and transmitter and use the same blocks for transmitting data on different interfaces. It also allows you to use the clock and control signals without capturing them to the system clock, which as a result makes it possible to transmit with an external clock frequency equal to FCLK / 2, where FCLK is the frequency of the system clock.
Контрольные регистры 1, 3 позволяют производить независимую программную настройку передатчика и приемника.The control registers 1, 3 allow independent programming of the transmitter and receiver.
Регистры состояния передатчика и приемника 2, 4 содержат информацию о состоянии буфера чтения и буфера записи, а также флаги прерывания.The state registers of the transmitter and receiver 2, 4 contain information about the status of the read buffer and the write buffer, as well as interrupt flags.
Регистр управления выводами 5 содержит биты, позволяющие задавать направление каждого вывода.Pin Management Register 5 contains bits that let you specify the direction of each pin.
Делители частоты 16, 17 позволяют формировать тактовые сигналы для приемника и передатчика путем деления частоты системного тактового сигнала.Frequency dividers 16, 17 allow you to generate clock signals for the receiver and transmitter by dividing the frequency of the system clock.
Блок генерации синхроимпульсов передатчика 18 состоит из мультиплексора тактового сигнала передатчика 19 и преобразователя тактового сигнала передатчика 20.The clock generation unit of the transmitter 18 consists of a clock multiplexer of the transmitter 19 and a clock converter of the transmitter 20.
Мультиплексор тактового сигнала передатчика позволяет использовать для управления блоком передатчика как внешний тактовый сигнал, так и тактовый сигнал, принимаемый от делителя частоты передатчика.The transmitter clock multiplexer allows you to use both an external clock signal and a clock signal received from the transmitter frequency divider to control the transmitter unit.
Преобразователь тактового сигнала передатчика инвертирует тактовый сигнал при необходимости работы передатчика по отрицательному фронту.The transmitter clock signal inverts the clock signal when the transmitter needs to operate on a negative edge.
Блок генерации синхроимпульсов приемника 21 состоит из мультиплексора тактового сигнала приемника 22 и преобразователя тактового сигнала приемника 23.The clock generating unit of the receiver 21 consists of a clock multiplexer of the receiver 22 and a clock converter of the receiver 23.
Мультиплексор тактового сигнала приемника позволяет использовать для управления блоком приемника как тактовый сигнал, принимаемый от блока управления выводами (который в свою очередь может либо приниматься с внешнего вывода либо дублировать тактовый сигнал передатчика), так и тактовый сигнал, принимаемый от делителя частоты приемника.The receiver clock multiplexer allows you to use both the clock signal received from the terminal control unit (which, in turn, can either be received from the external output or duplicate the transmitter clock signal) or the clock signal received from the receiver frequency divider to control the receiver unit.
Преобразователь тактового сигнала приемника инвертирует тактовый сигнал при необходимости работы приемника по отрицательному фронту.The receiver clock signal inverts the clock signal when the receiver needs to work on a negative edge.
Использование преобразователей тактового сигнала позволяет использовать в схеме блоки приемника и передатчика, срабатывающие по фиксированному фронту тактового сигнала.The use of clock converters allows the use of receiver and transmitter blocks in the circuit, which operate on a fixed clock edge.
Блок генерации управляющих сигналов передатчика 24 состоит из блоков формирователя управляющего сигнала передатчика 25 и преобразователя управляющего сигнала передатчика 26.The control signal generation unit of the transmitter 24 consists of blocks of a control signal generator of the transmitter 25 and a control signal converter of the transmitter 26.
Формирователь управляющего сигнала передатчика в соответствии с настройками выводов выполняет либо формирование управляющего сигнала для выбранного интерфейса (при этом используется тактовый сигнал, принимаемый от логики генерации синхроимпульсов), либо его прием с внешних выводов схемы.The transmitter control signal generator, in accordance with the output settings, either generates a control signal for the selected interface (in this case, the clock signal received from the clock generation logic is used) or it is received from the external terminals of the circuit.
Преобразователь управляющего сигнала передатчика выполняет преобразование интерфейсного управляющего сигнала, принимаемого от формирователя управляющего сигнала передатчика к трем универсальным контрольным сигналам: TEN (разрешение передачи), ReadWB (разрешение чтения из буфера записи) и trst (сброс счетчика передатчика).The transmitter control signal converter converts the interface control signal received from the transmitter control signal generator to three universal control signals: TEN (transmit permission), ReadWB (read permission from the write buffer) and trst (transmitter counter reset).
Блок генерации управляющих сигналов передатчика содержит логику формирования двухразрядной шины выбора ведомого устройства. При этом младший разряд шины направляется на вывод контрольного сигнала передатчика, а старший разряд на вывод контрольного сигнала приемника, позволяя таким образом в режиме полнодуплексного SPI работать с двумя параллельно подключенными ведомыми устройствами.The transmitter control signal generation unit contains the logic for generating a two-bit slave select bus. In this case, the lowest bit of the bus is sent to the output of the control signal of the transmitter, and the senior bit to the output of the control signal of the receiver, thus allowing in full duplex SPI mode to work with two parallel connected slave devices.
Блок генерации управляющих сигналов приемника 27 состоит из блоков формирователя управляющего сигнала приемника 28 и преобразователя управляющего сигнала приемника 29.The control signal generation unit of the receiver 27 consists of blocks of the control signal generator of the receiver 28 and the control signal converter of the receiver 29.
Формирователь управляющего сигнала приемника в соответствии с настройками выводов выполняет либо формирование управляющего сигнала для выбранного интерфейса (при этом используется тактовый сигнал, принимаемый от логики генерации синхроимпульсов), либо его прием с внешних выводов схемы.The driver control signal generator, in accordance with the output settings, either generates a control signal for the selected interface (in this case, the clock signal received from the clock generation logic is used) or it is received from the external terminals of the circuit.
Преобразователь управляющего сигнала приемника выполняет преобразование интерфейсного управляющего сигнала, принимаемого от формирователя управляющего сигнала приемника к трем универсальным контрольным сигналам: REN (разрешение приема), WriteRB (разрешение записи в буфер чтения) и rrst (сброс счетчика приемника).The receiver control signal converter converts the interface control signal received from the receiver control signal generator to three universal control signals: REN (receive permission), WriteRB (write write buffer enable) and rrst (receiver counter reset).
Контрольные сигналы, формируемые блоками генерации управляющих сигналов для приемника и передатчика, универсальны и не зависят от выбранного протокола передачи. Это позволяет использовать в схеме универсальные блоки приемника и передатчика, что заметно упрощает логику схемы. Кроме того, управляющие сигналы формируются в автоматическом режиме, что дает возможность контроллеру вести передачу данных без участия процессора.The control signals generated by the control signal generation blocks for the receiver and transmitter are universal and do not depend on the selected transmission protocol. This allows the use of universal receiver and transmitter units in the circuit, which significantly simplifies the logic of the circuit. In addition, control signals are generated automatically, which allows the controller to transmit data without the participation of the processor.
Блоки генерации управляющих сигналов приемника и передатчика также содержат логику автоматического определения канала для работы в режиме I2S, а блок генерации управляющих сигналов передатчика - логику формирования двухразрядного сигнала выбора ведомого для полнодуплексного режима SPI.The blocks for generating the control signals of the receiver and transmitter also contain the logic for automatically detecting the channel for operation in I2S mode, and the block for generating the control signals of the transmitter contains the logic for generating a two-bit signal for selecting the slave for full duplex SPI mode.
В состав контроллера входят два буфера типа FIFO - буфер записи 7 и буфер чтения 11. Оба буфера представляют собой двухпортовую память. При этом один порт управляется запросами системной шины, а другой - запросами, формируемыми контроллером в процессе передачи. Блоки FIFO также играют роль единственного связующего звена между двумя клоковыми доменами: приемника/передатчика и системной шины. Это позволяет избежать проблем с синхронизацией при работе устройства в режиме ведомого. Кроме того, оба буфера позволяют производить запись и чтение как слов, так и полуслов, что дает возможность порту работать в режиме паковки/распаковки.The controller includes two FIFO type buffers - a write buffer 7 and a read buffer 11. Both buffers are dual-port memory. In this case, one port is controlled by system bus requests, and the other by requests generated by the controller during the transfer. FIFO blocks also play the role of the only link between the two block domains: the receiver / transmitter and the system bus. This avoids synchronization problems when the device is in slave mode. In addition, both buffers allow you to write and read both words and half-words, which allows the port to work in the packing / unpacking mode.
Наличие буферов чтения и записи позволяет непосредственно во время передачи считывать уже принятые данные либо записывать данные для новой передачи.The presence of read and write buffers allows to read already received data directly or to write data for a new transfer directly during transmission.
Блок управления выводами 30 позволяет выполнять гибкую настройку выводов, устанавливая направление для каждого вывода, и дублировать управляющие и тактовые сигналы передатчика для приемника. Кроме того, возможно перенаправление данных с выхода передатчика на вывод приемника и с вывода передатчика на вход приемника, что позволяет организовывать передачу в режиме SPI как по стандарту Microwire (SDO, SDI), так и по стандарту Mototrola (MOSI, MISO). Также данный блок содержит логику, позволяющую всему контроллеру работать в режиме полнодуплексного SPI, используя выводы TCS и RCS для выбора двух ведомых устройств, либо в режиме независимых SPI-приемника и SPI-передатчика. В последнем случае приемник и передатчик могут отдельно работать как в режиме ведомого, так и в режиме ведущего, используя каждый свой собственный сигнал выбора ведомого (вывод TCS для передатчика и RCS для приемника).The terminal control unit 30 allows for flexible configuration of the terminals, setting the direction for each terminal, and duplicating the control and clock signals of the transmitter for the receiver. In addition, it is possible to redirect data from the output of the transmitter to the output of the receiver and from the output of the transmitter to the input of the receiver, which makes it possible to organize transmission in SPI mode both according to the Microwire standard (SDO, SDI) and Mototrola standard (MOSI, MISO). This block also contains logic that allows the entire controller to work in full duplex SPI mode, using the TCS and RCS pins to select two slaves, or in the independent SPI receiver and SPI transmitter mode. In the latter case, the receiver and transmitter can separately work both in the slave mode and in the master mode, using each of its own slave selection signal (TCS pin for the transmitter and RCS for the receiver).
В общем случае приемник и передатчик могут работать независимо. Однако возможна работа приемника в зависимом от передатчика режиме.In general, the receiver and transmitter can operate independently. However, it is possible for the receiver to operate in a transmitter-dependent mode.
Если передатчик включен и была произведена запись в буфер записи, то в силу того, что данные для передачи выбираются непосредственно из буфера записи, на выходе последовательных данных передатчика сразу появляется первый бит (или последний в зависимости от выбранного порядка передачи бит) передаваемого слова и передатчик готов к передаче данных с приходом первого фронта тактового сигнала. Номер передаваемого бита определяется состоянием счетчика бит передатчика. Счетчик инкрементируется по фронту тактового сигнала при установленном сигнале "разрешение передачи". В случае если значение счетчика бит передатчика стало равным длине передаваемого слова, тогда счетчик сбрасывается и блоком генерации управляющих сигналов передатчика формируется сигнал "Разрешение чтения из буфера записи", после чего на выходе буфера записи появляется следующее передаваемое слово. Счетчик бит передатчика также может быть сброшен сигналом "сброса счетчика передатчика", который формируется либо при программном отключении передатчика, либо при определенном сочетании внешних сигналов (например, переход в высокий уровень шины SS в режиме SPI).If the transmitter is turned on and writing to the recording buffer has been made, then since the data for transmission is selected directly from the recording buffer, the first bit (or the last one, depending on the selected bit transmission order) of the transmitted word and the transmitter immediately appears on the output of the serial data of the transmitter ready for data transfer with the arrival of the first edge of the clock signal. The number of the transmitted bit is determined by the status of the transmitter bit counter. The counter is incremented along the edge of the clock signal when the "transmit enable" signal is set. If the value of the transmitter bit counter has become equal to the length of the transmitted word, then the counter is reset and the "Reading permission from the write buffer" signal is generated by the transmitter control signal generation unit, after which the next transmitted word appears at the output of the write buffer. The transmitter bit counter can also be reset by the “transmitter counter reset” signal, which is generated either when the transmitter is switched off programmatically or when a certain combination of external signals is detected (for example, switching to a high SS bus level in SPI mode).
Если приемник включен, то с приходом отрицательного фронта тактового сигнала осуществляется запись принятого бита в регистр приема. Номер бита регистра приема, в который будет произведена запись, определяется состоянием счетчика бит приемника. Счетчик инкрементируется по фронту тактового сигнала при установленном сигнале "разрешение приема". В случае, если значение счетчика бит приемника на единицу меньше длины передаваемого слова, то блоком генерации управляющих сигналов приемника формируется сигнал "Разрешение записи в буфер чтения" и с приходом следующего отрицательного фронта тактового сигнала осуществляется одновременная запись последнего бита в приемный регистр и запись всего принятого слова в буфер чтения. В следующем такте счетчик сбрасывается. Счетчик бит приемника также может быть сброшен сигналом "сброса счетчика приемника", который формируется либо при программном отключении приемника, либо при определенном сочетании внешних сигналов (например, переход в высокий уровень шины SS в режиме SPI).If the receiver is turned on, then with the arrival of a negative edge of the clock signal, the received bit is written to the reception register. The bit number of the reception register to which recording will be made is determined by the status of the receiver bit counter. The counter is incremented along the edge of the clock signal when the "receive permission" signal is set. If the value of the receiver bit counter is one less than the length of the transmitted word, then the “Write Write Buffer Enable” signal is generated by the receiver control signal generation unit and with the arrival of the next negative edge of the clock signal, the last bit is simultaneously recorded in the reception register and all received words to the reading buffer. In the next measure, the counter is reset. The receiver bit counter can also be reset by the “receiver counter reset” signal, which is generated either when the receiver is switched off programmatically or with a certain combination of external signals (for example, switching to a high SS bus level in SPI mode).
Блоки генерации синхроимпульсов и генерации управляющих сигналов приемника используются для управления приемником. Блоки генерации синхроимпульсов и генерации управляющих сигналов передатчика используются для управления передатчиком. Приемник и передатчик настраиваются независимо.The blocks for the generation of clock pulses and the generation of control signals of the receiver are used to control the receiver. The blocks for generating clock pulses and generating control signals of the transmitter are used to control the transmitter. The receiver and transmitter are independently configured.
На выходе делителя частоты передатчика формируется тактовый сигнал с частотой, равной частоте системного тактового сигнала, поделенной на значение делителя частоты передатчика. Далее, если направление вывода тактового сигнала задано как выход, то на преобразователь тактового сигнала подается сигнал с выхода делителя, этот же сигнал подается на вывод тактового сигнала TCLK, если же направление вывода тактового сигнала задано как вход, то на вход преобразователя тактового сигнала подается тактовый сигнал непосредственно с вывода TCLK. В случае, если порт программно настроен на работу по отрицательному фронту либо выбран режим SPI, предполагающий работу по отрицательному фронту, то на выходе преобразователя тактового сигнала передатчика формируется инвертированный тактовый сигнал, в противном случае тактовый сигнал передается на выход без изменений.At the output of the transmitter frequency divider, a clock signal is generated with a frequency equal to the frequency of the system clock signal divided by the value of the transmitter frequency divider. Further, if the direction of output of the clock signal is set as the output, then the signal from the output of the divider is supplied to the clock converter, the same signal is fed to the output of the clock signal TCLK, if the direction of the output of the clock signal is set as input, the clock is supplied to the input of the clock converter signal directly from the TCLK pin. If the port is programmatically configured to work on a negative edge or the SPI mode is selected, which assumes working on a negative edge, an inverted clock signal is generated at the output of the transmitter clock signal converter, otherwise the clock signal is transmitted to the output without changes.
Сформированный таким образом тактовый сигнал передается блоку передатчика и блоку генерации управляющих сигналов передатчика.The clock signal thus generated is transmitted to the transmitter unit and the transmitter control signal generation unit.
На выходе делителя частоты приемника формируется тактовый сигнал с частотой, равной частоте системного тактового сигнала, поделенной на значение делителя частоты приемника. Если в регистре управления приемником установлен бит дублирования тактового сигнала, то на преобразователь тактового сигнала приемника подается сигнал с вывода тактового сигнала передатчика, в противном случае, если направление вывода тактового сигнала задано как выход, то на преобразователь тактового сигнала подается сигнал с выхода делителя, этот же сигнал подается на вывод тактового сигнала RCLK, если же направление вывода тактового сигнала задано как вход, то на вход преобразователя тактового сигнала подается тактовый сигнал непосредственно с вывода RCLK. В случае, если порт программно настроен на работу по отрицательному фронту либо выбран режим SPI, предполагающий работу по отрицательному фронту, то на выходе преобразователя тактового сигнала приемника формируется инвертированный тактовый сигнал, в противном случае тактовый сигнал передается на выход без изменений.At the output of the receiver frequency divider, a clock signal is generated with a frequency equal to the frequency of the system clock signal divided by the value of the receiver frequency divider. If the clock duplication bit is set in the receiver control register, then the signal from the transmitter clock output is supplied to the receiver clock converter, otherwise, if the clock output direction is set as output, the divider output signal is sent to the clock converter, this the signal is fed to the RCLK clock signal output, if the direction of the clock signal output is specified as the input, then the clock signal Directly from RCLK output. If the port is programmatically configured to work on a negative edge or the SPI mode is selected, which assumes operation on a negative edge, an inverted clock signal is generated at the output of the receiver clock signal converter, otherwise the clock signal is transmitted to the output without changes.
Сформированный таким образом тактовый сигнал передается блоку приемника и блоку генерации управляющих сигналов приемника.The clock signal thus generated is transmitted to the receiver unit and the receiver control signal generation unit.
В случае, если направление вывода управляющего сигнала передатчика TCS задано как выход, то управляющие сигналы генерируются формирователем управляющего сигнала передатчика и передаются на вход преобразователя управляющего сигнала передатчика и непосредственно на вывод управляющего сигнала TCS. В противном случае на вход преобразователя управляющего сигнала передатчика подается сигнал, взятый непосредственно с вывода TCS. Преобразователь управляющего сигнала содержит логику, преобразующую интерфейсные управляющие сигналы, поступающие на его вход, к трем универсальным контрольным сигналам, использующимся для управления блоком передатчика. В случае работы в режиме SPI блок генерации управляющих сигналов путем умножения контрольного сигнала, получаемого на выходе формирователя управляющего сигнала передатчика на биты контрольного регистра, отвечающие за выбор ведомого, формирует двухразрядную шину выбора ведомого устройства. При этом младший разряд шины направляется на вывод контрольного сигнала передатчика, а старший разряд на вывод контрольного сигнала приемника, позволяя таким образом в режиме полнодуплексного SPI работать с двумя параллельно подключенными ведомыми.If the direction of the output of the control signal of the transmitter TCS is specified as the output, then the control signals are generated by the transmitter of the control signal of the transmitter and transmitted to the input of the Converter control signal of the transmitter and directly to the output of the control signal TCS. Otherwise, a signal taken directly from the TCS pin is fed to the input of the transmitter control signal converter. The control signal converter contains logic transforming the interface control signals supplied to its input to three universal control signals used to control the transmitter unit. In the case of operation in SPI mode, the control signal generation unit by multiplying the control signal received at the output of the transmitter control signal generator by the control register bits responsible for selecting the slave generates a two-bit slave selection bus. In this case, the lowest bit of the bus is sent to the output of the control signal of the transmitter, and the senior bit to the output of the control signal of the receiver, thus allowing in the full-duplex SPI mode to work with two parallel connected slaves.
В случае, если в регистре управления приемником установлен бит дублирования управляющего сигнала, то на вход преобразователя управляющего сигнала приемника подается сигнал с вывода контрольного сигнала передатчика TCS, в противном случае, если направление вывода управляющего сигнала приемника RCS задано как выход, то управляющие сигналы генерируются формирователем управляющего сигнала приемника и передаются на вход преобразователя управляющего сигнала приемника и непосредственно на вывод управляющего сигнала RCS, если же направление вывода управляющего сигнала приемника RCS задано как вход, то на вход преобразователя управляющего сигнала приемника подается сигнал, взятый непосредственно с вывода RCS. Преобразователь управляющего сигнала содержит логику, преобразующую интерфейсные управляющие сигналы, поступающие на его вход, к трем универсальным контрольным сигналам, использующимся для управления блоком передатчика.If the control signal duplication bit is set in the receiver control register, then the signal from the control signal of the TCS transmitter is supplied to the input of the control signal converter of the receiver, otherwise, if the direction of the output of the control signal of the RCS receiver is specified as the output, then the control signals are generated by the driver control signal of the receiver and transmitted to the input of the Converter control signal of the receiver and directly to the output of the control signal RCS, if the direction in Water control signal RCS receiver is set as an input, the input control signal receiver transducer signal is taken directly from the output RCS. The control signal converter contains logic transforming the interface control signals supplied to its input to three universal control signals used to control the transmitter unit.
В режиме SPI устройство может использоваться как полнодуплексный SPI-контроллер, при этом управляющие сигналы формируются блоком генерации управляющих сигналов передатчика и дублируются для приемника. При этом блок генерации формирует управляющий сигнал "выбора ведомого", который преобразуется в двухразрядную шину "выбора ведомого", причем младший разряд шины идет на вывод TCS передатчика, а второй - на вывод RCS-приемника (направление обоих выводов задано как выход). Для формирования двухразрядной шины "выбора ведомого" используются два разряда контрольного регистра передатчика, в которых содержится информация о том, какое ведомое устройство выбрано.In SPI mode, the device can be used as a full-duplex SPI controller, while control signals are generated by the transmitter control signal generation unit and are duplicated for the receiver. In this case, the generation unit generates a “slave select” control signal, which is converted into a two-bit “slave select” bus, the lowest bit of the bus goes to the output of the TCS transmitter, and the second to the output of the RCS receiver (the direction of both outputs is specified as the output). To form a two-bit bus "slave selection", two bits of the transmitter control register are used, which contain information about which slave device is selected.
Заявляемое изобретение согласно данному примеру может быть реализовано как в ПЛИС, например, фирм Xilinx и Altera, так и в составе СБИС микроконтроллеров и микропроцессоров.The invention according to this example can be implemented both in FPGAs, for example, firms Xilinx and Altera, and as part of VLSI microcontrollers and microprocessors.
Источники информацииInformation sources
1http://www.freescale.com/files/microcontrollers/doc/ref_ manual/M68HC11RM.pdf 1 http://www.freescale.com/files/microcontrollers/doc/ref_ manual / M68HC11RM.pdf
2http://www.national.com 2 http://www.national.com
3http://www.analog.com/en/prod/0,2877,ADSP-BF537,00.html 3 http://www.analog.com/en/prod/0,2877,ADSP-BF537,00.html
4http://www.nxp.com/acrobat_ download/various/I2SBUS.pdf 4 http://www.nxp.com/acrobat_ download / various / I2SBUS.pdf
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
RU2007132778/09A RU2360282C2 (en) | 2007-08-31 | 2007-08-31 | Programmable serial bus controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
RU2007132778/09A RU2360282C2 (en) | 2007-08-31 | 2007-08-31 | Programmable serial bus controller |
Publications (2)
Publication Number | Publication Date |
---|---|
RU2007132778A RU2007132778A (en) | 2009-03-10 |
RU2360282C2 true RU2360282C2 (en) | 2009-06-27 |
Family
ID=40528168
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
RU2007132778/09A RU2360282C2 (en) | 2007-08-31 | 2007-08-31 | Programmable serial bus controller |
Country Status (1)
Country | Link |
---|---|
RU (1) | RU2360282C2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2446559C1 (en) * | 2011-03-30 | 2012-03-27 | Открытое акционерное общество "Концерн "Созвездие" | Data transfer controller with pseudorandom operating frequency tuning |
CN108197051A (en) * | 2018-01-03 | 2018-06-22 | 深圳市玄羽科技有限公司 | Intelligence manufacture equipment and the data conversion system and method for external audio collecting device |
-
2007
- 2007-08-31 RU RU2007132778/09A patent/RU2360282C2/en not_active IP Right Cessation
Non-Patent Citations (1)
Title |
---|
ADSP-BF537:BLACKFIN PROCESSOR WITH EMBEDDED NETWORK CONNECTIVITY. ANALOG DEVICES, INC. 2005. * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2446559C1 (en) * | 2011-03-30 | 2012-03-27 | Открытое акционерное общество "Концерн "Созвездие" | Data transfer controller with pseudorandom operating frequency tuning |
CN108197051A (en) * | 2018-01-03 | 2018-06-22 | 深圳市玄羽科技有限公司 | Intelligence manufacture equipment and the data conversion system and method for external audio collecting device |
Also Published As
Publication number | Publication date |
---|---|
RU2007132778A (en) | 2009-03-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6353867B1 (en) | Virtual component on-chip interface | |
US7275119B2 (en) | Early detection and grant, an arbitration scheme for single transfers on AMBA advanced high-performance bus | |
US20020194418A1 (en) | System for multisized bus coupling in a packet-switched computer system | |
US20020008540A1 (en) | Multi-master multi-slave system bus in a field programmable gate array (FPGA) | |
US20020184453A1 (en) | Data bus system including posted reads and writes | |
US7779194B2 (en) | Data modification module | |
WO2001024023A1 (en) | Improved synchronous operation of an advanced peripheral bus with backward compatibility | |
US7769933B2 (en) | Serialization of data for communication with master in multi-chip bus implementation | |
CN111290986B (en) | Bus interconnection system based on neural network | |
JPH0981508A (en) | Method and apparatus for communication | |
KR100403404B1 (en) | Bidirectional parallel signal interface | |
US20070156937A1 (en) | Data transfer in multiprocessor system | |
US5673397A (en) | FIFO queue having replaceable entries | |
JPH04350754A (en) | Workstation including interface for data channel or similar data processing system | |
JP2007048280A (en) | Integrated circuit device and method for monitoring bus | |
US7133958B1 (en) | Multiple personality I/O bus | |
RU2360282C2 (en) | Programmable serial bus controller | |
KR100476895B1 (en) | Interface device having variable data transfer mode and operating method thereof | |
CN111506461B (en) | Back pressure module based on bus and used for testing and implementation method thereof | |
US6665807B1 (en) | Information processing apparatus | |
US6477177B1 (en) | Multiple device access to serial data stream | |
EP1266294B1 (en) | A communication interface system, method and apparatus | |
CN204515761U (en) | SOC (system on a chip) | |
US6874043B2 (en) | Data buffer | |
US10489319B2 (en) | Automatic transmission of dummy bits in bus master |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | The patent is invalid due to non-payment of fees |
Effective date: 20150901 |