User Tools

Site Tools


soc:2017:portrpi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
soc:2017:portrpi [2017/08/27 19:53]
nekorobov [The PCM driver]
soc:2017:portrpi [2017/08/28 14:45] (current)
lionelsambuc Presentation of the completion table
Line 15: Line 15:
 ===== Current Status ===== ===== Current Status =====
  
-|**Done**|**Item**|**Percentage Complete**|**Comments**| +^  ​Done  ^Item  ​^ ​ Completion ^Comments ​ ^ 
-| {*} |Remove the dirty hack from kernel|100%| Done | + {*}  |Remove the dirty hack from kernel ​  100% | Done  
-| {o} |Make kernel platform independent|70%| Add device-tree parsing | + {o}  |Make kernel platform independent ​  70% | Add device-tree parsing ​ 
-| {o} |Cleanup booting process|60%| ​ | + {o}  |Cleanup booting process ​  60% |  | 
-| {*} |Mailbox driver|100%| Done | + {*}  |Mailbox driver ​  100% | Done  
-| {*} |Resolve tty issues|100%| Done | + {*}  |Resolve tty issues ​  100%| Done  
-| {o} |SDCard driver|80%| Add general and logical system | + {o}  |SDCard driver ​  80% | Add general and logical system ​ 
-| {o} |SPI driver|60%| Debug + {* |SPI driver ​  100% | Done  ​
-| {*} |I2C driver|100%| Done | + {*}  |I2C driver ​  100% | Done  
-| {*} |PCM driver|99%| Done | + {*}  |PCM driver ​  99% | Done  
-| {*} |PWM mini jack driver|99%| Done |+ {*}  |PWM mini jack driver ​  99% | Done   ​|
  
 ===== Design ​ ===== ===== Design ​ =====
Line 54: Line 54:
 ====The I2C driver==== ====The I2C driver====
  
-The new I2C driver is similar with the previous drivers, because the MINIX has the I2C stack, which requires definition of specific functions. The RPI may be as slave or master, but the current version of I2C driver supports only the master mode. It supports the 7 and 10 bits address. Plan - how to add the new I2C driver was added to the README. It's very simple, because the I2C stack was created as portable driver.+The new I2C driver is similar with the previous drivers, because the MINIX has the I2C stack, which requires definition of specific functions. The RPI may be as slave or master, but the current version of I2C driver supports only the master mode. It supports the 7 and 10 bits address. Plan - how to add the new I2C driver was added to the README. It's very simple, because the I2C stack was created as portable driver.\\ 
 + 
 +The RPI bus can't generate repeated start bit. It's bit which hardware generate instead of stop bit after the write command transmission,​ this bit is followed by read transaction. It's a big missing of the Broadcom, cause we can't read from the device'​s register, because many devices, which uses I2C require repeated start bit. There are exist software methods how work around it, but it may be in race condition, thus these methods are unreliable.
 ====The PCM driver==== ====The PCM driver====
  
-The PCM driver is audio driver. The special device can be connected to RPI usage the I2S interface. The PCM driver uses the 5th DMA channel to send data to the I2S. It doesn'​t support recording audio and 24 and 32 bits audio. There are common pins for I2S interface and SPI1, thus you can't use I2S, if you'd like to use it at the same time with SPI1.\\+The PCM driver is audio driver. The special device can be connected to RPI by the I2S interface. The PCM driver uses the 5th DMA channel to send data to the I2S. It doesn'​t support recording audio and 24 and 32 bits audio. There are common pins for I2S interface and SPI1, thus you can't use I2S, if you'd like to use it at the same time with SPI1.\\
  
 This driver is finished up 99%, because I have no the I2S device to connect it, but there are right driver logic and correct output on pins (I checked it by oscilloscope). This driver is finished up 99%, because I have no the I2S device to connect it, but there are right driver logic and correct output on pins (I checked it by oscilloscope).
 ====The SPI driver==== ====The SPI driver====
  
-The MINIX hasn't had the SPI stack yet, so we decided to develop the SPI driver as the chardriver. Communications with it carried out by open/close, read/write for sending data and ioctls for the setting SPI mode and speed. The current SPI driver can work only as a master.+The MINIX hasn't had the SPI stack yet, so we decided to develop the SPI driver as the chardriver. ​Driver is designed in the poll mode. It is the bidirectional driver now, it means that we need only three wires to connect the RPI with device:\\ **SCLK->​SCL\\ SDA->​MOSI\\ CE{n}->​CS**\\ ​Communications with it carried out by open/close, read/write for sending data and ioctls for the setting SPI mode and speed. ​There are 4 modes of SPI, the difference between them is: pass data with the rising or down edge of sync signal, the sync signal starts with up or down level. Variation of this parameters determine modes.  ​The current SPI driver can work only as a master.\\ 
 +It has three GPIO out as I2C, so we have to use three devices: spi-1, spi-2 and spi-3.
  
-====The PWM analog ​audio driver====+====The PWM analogue ​audio driver====
  
-Since the Raspberry Pi is the System On Chip there are mini jack 3.5 mm. We can listen to audio directly through it. Note that it uses the Pulse Width Modulator it means that we can't use analog audio and the PWM at the same time. This driver uses DMA. can be mono, stereo and any length of frame.+Since the Raspberry Pi is the System On Chip there are mini jack 3.5 mm. We can listen to audio directly through it. Note that it uses the Pulse Width Modulator it means that we can't use analog audio and the PWM at the same time. The mini jack connected with GPIO 40&45 on the RPI2 and GPIO 40&41 on the RPI3. Thanks to thePWM interface there are to channels (AUD_PWM0 and AUD_PWM1) which is left and right audio channels. The mini jack on the RPI doesn'​t support headphones with 4 rings. (There are only out sound, but no input from mic). It must to be standard headphones, where the first ring is responsible for the left channel, the second for the right channel and the third for the GND. This driver uses DMA. Sound can be mono, stereo and any length of frame.\\ 
 +There are common pins for PWM interface and SPI2, thus you can't use analogue audio, if you'd like to use it at the same time with SPI2.
 ===== Schedule ===== ===== Schedule =====
 ==== May ==== ==== May ====
soc/2017/portrpi.1503856417.txt.gz · Last modified: 2017/08/27 19:53 by nekorobov