Another PiGRRL "0.2" Another PiGRRL"0.2" was designed based on Pocket PiGRRL(and PiGRRL2 also). Pocket PiGRRL http://www.thingiverse.com/thing:807591 PIGRRL 2 http://www.thingiverse.com/thing:1277483 Requirements are almost the same as PiGRRL. The cost should be reduced by adoption of Raspberry Pi Zero and 2.2"LCD. On the other hand, the complicatedness of soldering and assembling will wipe out the advantage of the cost. Since new genuine "PiGRRL 0" has announced, if smaller and smart piGRRL is desired, I will recommend "PiGRRL 0", not this "0.2". https://learn.adafruit.com/pigrrl-zero/overview -Requirement. Raspberry Pi Zero micro SD card (for RetroPie). adafruit 2.2inch LCD (or compatible device) https://www.adafruit.com/product/1480 adafruit PowerBoost 1000C https://www.adafruit.com/product/2465 LiPo battery 2000mAh https://www.adafruit.com/products/2011 Slide Switch https://www.adafruit.com/product/805 Tactile Button switch (6mm) x 10pcs https://www.adafruit.com/products/367 Tactile Button switch (6mm slim) x 4pcs https://www.adafruit.com/products/1489 socket header ( needed only 10pin ) http://akizukidenshi.com/catalog/g/gC-05779/ Resistor 270 ohm x 2pcs 150 ohm x 2pcs Capacitor 33nF x 2pcs 10uF x 2pcs Diode (BAV99 compatible or similar) 4pcs Some wires & soldering tools M2.6x8mm BOLT x 9pcs 8mm bolt is too long for some part. In that case, printout spacers by 3D printer and equip with bolt. Universal board for Raspberry Pi http://www.aitendo.com/product/12108 2x20pin Female header http://akizukidenshi.com/catalog/g/gC-00085/ Regarding: aitendo Universal board for Raspberry Pi This is a prototype board for Raspberry pi. Unlike the other, GPIO signals can be found not only on the side of the board, but also on the center of the board. If purchasing of this board is not easy, please get the usual universal board. And cut it to 85x56 mm. It will be a substitute if IDC-BreakoutHelper-2x20_40pin is combined. https://www.adafruit.com/products/2270 The following items are required if you try to sound a speaker. Audio amp.board, PAM8302 https://www.adafruit.com/products/2130 Mini metal speaker https://www.adafruit.com/product/1890 The square fragment(21x24mm) of Breadboard PCB Breadboard PCB https://www.adafruit.com/products/1609 The following items are required if you try to hear sound with earphone. 3.5mm mini stereo earphone jack http://akizukidenshi.com/catalog/g/gC-02460/ The square fragment(36x24mm) of Breadboard PCB Breadboard PCB https://www.adafruit.com/products/1609 -About the arrangement of connectors and a switches on the board. Please arrange switches and connectors like the following photo. -About "Audio circuit" for Raspberry pi zero Since there is no analog audio output on Raspberry Pi Zero, it must be made. The Audio circuit used in this example were made with reference to the adafruit's documentation. https://learn.adafruit.com/introducing-the-raspberry-pi-zero/audio-outputs When you select a high- precision resistor and capacitor for audio, it might be better. Probably, the diode should choose equivalent or similar of BAV99. http://www.nxp.com/documents/data_sheet/BAV99_SER.pdf I chose 1N4148 which appeared from my parts box. http://www.diodes.com/_files/datasheets/ds12019.pdf There may be a more suitable choice. And, for audio output, I chose GPIO 12&13. Of course, +3.3V and GND also need to be wired. 1). for earphones The circuit board for earphones is shown in the following photographs. Wiring will become easy if parts are arranged on the Breadboard PCB. 2). for AMP. & SPK. It is almost same as above, "for earphones". A difference is whether an earphone jack is on a board, or there is nothing. -about 2.2"LCD (adafruit pid:1480) and wiring 2.2"LCD uses the following GPIO signals. https://www.adafruit.com/product/1480 1.BL(LED)-->gpio18, pin#12 2.SCK-->gpio11, pin#23 3. NC 4.MOSI-->gpio10, pin#19 5.CS-->gpio8, GPIO_pin#24 6. NC 7.RST-->gpio25, pin#22 8.D/C-->gpio24 ,pin#18 9.VCC--> +5V, pin#02 10.GND--> GND, pin#06 The actual example of wiring is shown in the following photo. -about Tactile switches and wiring 10 tactile switches and 2 slim tactile switches use following GPIO signals. A--> gpio23, pin#16 B--> gpio26, pin#37 X--> gpio16, pin#36 Y--> gpio20, pin#38 UP--> gpio5, pin#29 DOWN--> gpio6, pin#31 LEFT--> gpio22, pin#15 RIGH --> gpio19, pin#35 R--> gpio21, pin#40 L--> gpio27, pin#13 ESC--> gpio4, pin#07 SELECT--> gpio17, pin#11 START--> gpio15, pin#10 //RESERVE...gpio14, pin#08 It is dependent on the setup of software which signal of GPIO will be used. Of course, usage of the above GPIO signals can be changed or omitted. However, you should not use the GPIO signals which LCD and an AUDIO circuit use. The actual example of wiring is shown in the following photo. It is better to remove the battery, in order to prevent the trouble under assembly. However, it will become difficult to connect a battery, if an assembly progresses. Be careful of it. -About wiring of PowerBoost 1000c, slide switch, PAM8302 and a speaker, it is the same as Pocket PiGRRL/PiGRRL 2. Please refer to documentations of PiGRRL/PiGRRL 2 Pocket PiGRRL www.thingiverse.com/thing:807591 PIGRRL 2 www.thingiverse.com/thing:1277483 - How to assemble 1). 3D printing Please print cases, spacers, and buttons out by 3D printer. PLA or ABS is recommended for case and spacers. NinjaFlex-SemiFlex is recommended for buttons. 2). L/R buttons(buttons only, not tactile buttons) Please stuff L/R buttons after removing the support material which should be removed. Please check whether switch is inserted and button can be pushed. 3). Tapping for M2.6 bolts If tapping just a little bit, a bolt will be screwed smoothly. 4). Installation of devices Installation will be difficult if support material has not removed perfectly. First, install PowerBoost 1000c. Next, install a slide switch and Raspberry Pi ZERO. Please install carefully not to damage PowerBoost, leaning PiZero into the place. 5).fix PowerBoost 1000c and Raspberry Pi ZERO. If 8mm bolt is too long , please attach a spacer(s). In order to avoid interference with LED and electronic parts, please use a distorted-shap ed spacer for PowerBoost 1000c. 6). install tactile buttons with wire for L/R buttons. 7). Let a Universal board and Raspberry Pi ZERO unite. Be careful for a connector not to shift from the GPIO pin of Pi ZERO. If it fits in the correct position , it will be shown in the photo. And please stick tape on the place where LCD will be placed like a photo for electric insulation. 8). an audio circuit board, amplifier board, and a speaker install an audio circuit, amplifier, and a speaker like a photo. Please also arrange the circuit for earphones like a photo and wire. 9). 2.2”LCD In order to install LCD on a nUniversal board, please bend pins like a photo and solder them. And, install LCD on universal board after sticking insulating tape on the back of LCD. Finally, please install A/B/X/Y, up/down/left/right and select/start button. And softly tighten 4 bolts. -Software settings The setup of this thing requires some knowledge about RetroPie, FBTFT, FBCP, and Adafruit -RetroGame. RetroPie https://retropie.org.uk/ The latest version of RetroPie is 3.7 when this document is written. FBTFT https://github.com/notro/fbtft/wiki FBCP https://github.com/tasanakorn/rpi-fbcp Adafruit-RetroGame https://learn.adafruit.com/retro-gaming-with-raspberry-pi https://learn.adafruit.com/retro-gaming-with-raspberry-pi/buttons 1). checking FBTFT; does it work with 2.2”LCD? If install the retropie 3.7, the checking operations of LCD will also be possible. Connect to Network, Power On, after a few minutes...(Starting RetroPie 3.7 and reboot)... login via network by PC and terminal software...and... Please set up by raspi-config. > sudo raspi-config Required setup is the following things. internationalisation options --> set up your locale/timezone/keyboard/WiFiCountry. Advanced Options -- enable SPI and kernel loaded by default Advanced Options -- enable device Tree and reboot... login via network again. and... > sudo modprobe fbtft_device name=adafruit22a rotate=90 > con2fbmap 1 1 Then, a console screen will be made to appear on 2.2" LCD. 2). install FBCP If 2.2”LCD work well, Please install FBCP. https://github.com/tasanakorn/rpi-fbcp If FBCP is installed... > fbcp & Then, RetroPie screen will be made to appear on 2.2" LCD. 3). Audio Sound does not come out only by adding an audio circuit. It needs to be add some lines in /boot/config.txt #-----audio setting for Pi0 ; use gpio 12&13 for audio(PWM) # Enable audio (loads snd_bcm2835) dtparam=audio=on #-stereo dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4 #-mono #dtoverlay=pwm,pin=13,func=4 4). screen size It will be better to rewrite FRAMEBUFFER width and height settings in /boot/config.txt #--- LCD; 320x240 framebuffer_width=320 framebuffer_height=240 hdmi_cvt=320 240 60 1 0 0 0 hdmi_group=2 hdmi_mode=87 #----5). GamePad In order to use the tactile switches connected with gpio as gamepad, you have to set up with reference to Adafruit-RetroGame. https://learn.adafruit.com/retro-gaming-with-raspberry-pi/buttons You have to make a configuration file, after downloading, editing and compiling retrogame. The key assigning for retrogame.c // 2.2"TFT + GPIO_GAMEPAD // --> Joystick (A,B,X,Y,up,down,left,right,L,R,select,start) { 21, KEY_A }, // R --> gpio21, pin#40 { 4, KEY_ESC }, // Exit ROM --> gpio4, pin#07 { { { { { { 17, KEY_SPACE }, // SELECT/PAUSE --> gpio17, pin#11 22, KEY_LEFT }, // 'LEFT' --> gpio22, pin#15 5, KEY_UP }, // 'UP' --> gpio5, pin#29 6, KEY_DOWN }, // 'DOWN' --> gpio6, pin#31 19, KEY_RIGHT }, // 'RIGHT' --> gpio19, pin#35 26, KEY_LEFTALT }, // B/Bomb/secondary --> gpio26, pin#37 { 27, KEY_S }, // L --> gpio27, pin#13 // RESERVE... gpio14, pin#08 { { { { 15, 23, 16, 20, // KEY_ENTER }, // START --> gpio15, pin#10 KEY_LEFTCTRL }, // A/Fire/jump/primary --> gpio23, pin#16 KEY_X }, // X --> gpio16, pin#36 KEY_Z }, // Y --> gpio20, pin#38 6). start-up setting It is necessary to make FBTFT, FBCP, and retrogame work certainly at the start up. For example, make the following batch file and add to end (Just before "exit 0") of /etc/rc.local (This is a method that does not require the any update or upgrade.) # batch file "test01.sh" !/bin/bash echo "FBTFT" sudo modprobe fbtft_device name=adafruit22a rotate=90 speed=64000000 fps=30 sleep 1s echo "FBCP" sudo fbcp & echo "GPIO-GAMEPAD" sudo /home/pi/Adafruit-Retrogame/retrogame & And, /etc/rc.local will be as follows. #!/bin/sh -e # rc.local #This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # In order to enable or disable this script just change the execution # bits. # By default this script does nothing. # FBTFT,FBCP and GAMEPAD sudo bash /home/pi/test01.sh exit 0 Now, if do reboot, reflection screen of Retropie is to LCD, tactile switches will be the Game Pad. -afterword I was going to just replace the RPi A+ in the pocket PiGRRL to Pi0. However, there were some problems to be solved. I made some prototypes, and somehow this was finished. Perhaps, I might have written some misunderstanding/mistakes in this document. If you find something, please advice. Thank you for reading my strange English sentences. Thanks to Google translation. by n602 5/2-9 / 2016 -history of prototypes 12/06/2015...Raspberry pi0+PiTFT2.2 with PWM audio(gpio12&13) 12/12/2015...Raspberry pi0+1.8”LCD with analog AUDIO board(gpio12&13) 3/28/2016...Raspberry pi0+adafruit 2.2”LCD with adafruit GAMEPAD PCB 4/16/2016...Raspberry pi2B+Game_Shield(1.8”LCD&Tactile switches on the universal board) 4/19/2016...Another PiGRRL “0.1”, Raspberry pi0+Game_Shield(2.2”LCD&Tactile switches on the universal board) + Audio board(gpio12&13)