PixelCodeBook PIXEL328 - V1.0 User Manual PixelCodeBook https://pixelcodebook.my.canva.site/ pixelcode2024@gmail.com 1. Introduction ................................ ................................ ................................ ................................ .......... 2 2. Recommended connection for Atmega328P ................................ ................................ ....................... 2 3. Matching Pixel328 - V1.0 with Atmega328P pinout ................................ ................................ ............. 4 4. Pixel328 - V1.0 Software ................................ ................................ ................................ ........................ 6 4.1 Main Window ................................ ................................ ................................ ............................... 6 4.2 Digital_I/O_Config Window ................................ ................................ ................................ ......... 8 4.2.1 Digital_I/O Window ................................ ................................ ................................ .................. 10 4.2.2 PWM Window ................................ ................................ ................................ ........................... 12 4.3 Analog_Pins_Config Window ................................ ................................ ................................ ..... 14 4.3.1 AN_Digital_I/O Window ................................ ................................ ................................ ........... 15 4.3.2 Analog_Read Window ................................ ................................ ................................ ............... 17 4.4 AREF_Config ................................ ................................ ................................ ................................ 18 4.5 PixelCodeBook_Commands: ................................ ................................ ................................ ...... 20 4.5.1 PixelCodeBook_Commands Explain: ................................ ................................ ................. 22 4.5.2 Comments in PixelCodeBook_Commands: ................................ ................................ ....... 49 4.6 Timing ................................ ................................ ................................ ................................ ............... 50 4.7 Product Activation: ................................ ................................ ................................ .............................. 52 1 | P a g e Figure 1 (Recommended connection for Atmega328P - DIP28) ................................ ................................ ... 2 Figure 2 (Recommended connection for Atmega328P - TQF32/MLF32) ................................ ..................... 3 Figure 3 (Pixel328 - V1.0 Main Window) ................................ ................................ ................................ ....... 6 Figure 4 (Digital_I/O_Config Window) ................................ ................................ ................................ ........ 8 Figure 5 (Digital_I/O Window) ................................ ................................ ................................ ................... 10 Figure 6 (PWM Window) ................................ ................................ ................................ ............................ 12 Figure 7 (Analog_Pins_Config Window) ................................ ................................ ................................ .... 14 Figure 8 (AN_Digital_I/O Window) ................................ ................................ ................................ ............ 15 Figure 9 (Analog_Read Window) ................................ ................................ ................................ ............... 17 Figure 10 (AREF_Config Window) ................................ ................................ ................................ .............. 18 Figure 11 (PixelCodeBook_Commands window) ................................ ................................ ...................... 20 Figure 12 (if condition example for Digital Pins) ................................ ................................ ....................... 27 Figure 13 (if condition example for Analog Pins) ................................ ................................ ...................... 29 Figure 14 (if condition example for PWM) ................................ ................................ ................................ 31 Figure 15 (if condition example for var) ................................ ................................ ................................ .... 33 Figure 16 (if condition example for var with var) ................................ ................................ ..................... 35 Figure 17 (if condition example for an alog) ................................ ................................ .............................. 37 Figure 18 ................................ ................................ ................................ ................................ ..................... 39 Figure 19 ................................ ................................ ................................ ................................ ..................... 41 Figure 20 ................................ ................................ ................................ ................................ ..................... 42 Figure 21 ................................ ................................ ................................ ................................ ..................... 52 2 | P a g e 1. Introduction Pixel328 - V1.0 software is compatible with Pixel328 - Hex - V1.0 file. Pixel328 - V1.0 software provides us with the ability to control Atmega328P Microcontroller with prebuild Graphical User Interface (GUI). 2. Recommended connection for Atmega328P Figure 1 shows the recommended connection to use Atmega328P - DIP28 MCU with Pixel328 - V1.0. Be careful crystal must be 16MHz. You can add switch to reset circuit just as you build reset circuit for Atmega328P MCU. Figure 1 (Recommended connection for Atmega328P - DIP28) Figure 2 shows the recommended connection to use Atmega328P - TQF32/MLF32 MCU with Pixel328 - V1.0. 3 | P a g e Figure 2 (Recommended connection for Atmega328P - TQF32/MLF32) 4 | P a g e 3. Matching Pixel328 - V1.0 with Atmega328P pinout Table 1 Pixel328 - V1.0 Function PWM Frequency [Hz] Atmega328 P Pinout Digital_I/O_0 - Digital Output - Digital Input - PD 2 Digital_I/O_1 - Digital Output - Digital Input - PWM [1] 490 PD 3 Digital_I/O_2 - Digital Output - Digital Input - PD4 Digital_I/O_3 - Digital Output - Digital Input - PWM [2] 980 PD5 Digital_I/O_4 - Digital Output - Digital Input - PWM [3] 980 PD6 Digital_I/O_5 - Digital Output - Digital Input - PD7 Digital_I/O_6 - Digital Output - Digital Input - PB0 Digital_I/O_7 - Digital Output - Digital Input - PWM [4] 490 PB 1 Digital_I/O_8 - Digital Output - Digital Input - PWM [ 5 ] 490 P B2 Digital_I/O_9 - Digital Output - Digital Input - PWM [6] 490 P B3 5 | P a g e Digital_I/O_10 - Digital Output - Digital Input - P B4 Digital_I/O_11 - Digital Output - Digital Input - PB 5 Analog_0 - Analog Input - Digital Output - Digital Input - PC0 Analog_1 - Analog Input - Digital Output - Digital Input - PC1 Analog_2 - Analog Input - Digital Output - Digital Input - PC2 Analog_3 - Analog Input - Digital Output - Digital Input - PC3 Analog_4 - Analog Input - Digital Output - Digital Input - PC4 Analog_5 - Analog Input - Digital Output - Digital Input - PC5 6 | P a g e 4. Pixel328 - V1.0 Software 4.1 Main Window Figure 3 shows the main window of Pixel328 - V1.0 Software. Figure 3 (Pixel328 - V1.0 Main Window) 7 | P a g e Table 2 shows the function of every widget in Main Window. Table 2 Widget Function Refresh [Button] R ead COMs which is connected to your computer and to be enable to choose the Baud Rate Port [Choose Button] C hoose the COM which is connected to your MCU Baud Rate [Choose Button] C hoose the baud rate for serial connection. It is very important to observe that there is only 1 option [115200]. Connect [Button] C onnect to your MCU Disconnect [Button] Disconnect your MCU Start [Button] Start serial threading with MCU. Start reading and writing to MCU. (Start or resume your system) Stop [Button] Start serial threading with MCU. Start reading and writing to MCU. (Pause your system) Digital_I/O_Config Open Digital Input/Output Configuration window. Analog_Pins_Config Open Analog Pins Configuration window. AREF_Config Open Analog Reference Voltage Configuration window. PixelCodeBook_Commands Open PixelCodeBook Commands writing window. 8 | P a g e 4.2 Digital_I/O_Config Window Figure 4 shows the Digital_I/O_Config window Figure 4 (Digital_I/O_Config Window) Open ing the Digital_I/O_Config window will read the last configuration from MCU (OUTPUT or INPUT or PWM) for each pin that matches with (Digital_I/O_0 Digital_I/O_11). Table 1. You can configure any of Digital_I/O by choose buttons in column2. If Digital_I/O is configured as INPUT so you can configure it as high impedance (High - Z) input or pulled up input (PULL - UP) by choose buttons in column3. Write configuration after finish it by File Write. You can read the configuration from MCU by File Read. 9 | P a g e Digtial_I/O will open Digital_I/O window. PWM will open PWM window. During configuration you will observe that the arrow on the right side of choose button s in column 2 and column 3 will be red or gray and that because of: It will be gray if the configuration that you see is the same as last configuration you write to MCU. It will be red if the configuration that you see is different from last configuration you write to MCU. 10 | P a g e 4.2.1 Digital_I/O Window Figure 5 shows Digital_I/O window. You can observe that if the pin is configured as OUTPUT , it will have a button and if pin is configured as INPUT it will have a label to read digital input (High or Low), green color for high and orange color for low. If the pin is configured as PWM it will have nothing. Tools Turn OFF all Outputs: it will turn off all pins which are configured as OUTPUT. Tools Turn ON all Outputs: it will turn off all pins which are configured as OUTPUT. Figure 5 (Digital_I/O Window) 11 | P a g e When you click on “Start” button: If the pin has been configured as “OUTPUT” and set to “ON” , its voltage will be set to value: 5V (High). If the pin has been configured as “OUTPUT” and set to “O FF ” , its voltage will be set to value: 0 V (Low). When you click on “S top ” button: If the pin has been configured as “OUTPUT” and set to “ON” , its voltage will be set to value: 0 V (Low). If the pin has been configured as “OUTPUT” and set to “O FF ” , its voltage will be set to value: 0 V (Low). 12 | P a g e 4. 2.2 PWM Window Figure 6 shows PWM window. You can observe that if the pin is configured as PWM , the cell which is re lated to it will be active, otherwise it will be disabled. Figure 6 ( PWM Window) You can adjust PWM value by slider or by entry text widget on the right side of cell the n press Enter (Button or Keyboard). You can use mouse wheel to change the slider. You can disable mouse wheel by Mouse_Wheel_E/D disable or enable it for each cell. 13 | P a g e When you click on “Start” button: If the pin has been configured as “ PWM ” and set to any value , its voltage will be set to this value When you click on “S top ” button: If the pin has been configured as “ PWM ” and set to any value, its voltage will be set to value: 0 V (Low). 14 | P a g e 4.3 Analog_Pins_Config Window Figure 7 shows the Analog_Pins_Config window Figure 7 ( Analog_Pins _Config Window) Opening the Analog_Pins_Config window will read the last configuration from MCU (Digital_Output or Digital_Input or Analog_Input) for each pin tha t matches with ( Analog _0 Analog_5 ). Table 1. You can configure any of Digital_I/O by choose buttons in column2. If Analog_Pin is configured as Digital_Input so you can configure it as high impedance (High - Z) input or pulled up input (PULL - UP) by choose buttons in column3. Write configuration after finish it by File Write. You can read the configuration from MCU by File Read. AN_ Digtial_I/O will open Digit al_I/O window. Analog_Read will open Analog_Read window. During configuration you will observe that the arrow on the right side of choose buttons in column 2 and column 3 will be red or gray and that because of: It will be gray if the configuration that you see is the same as last configuration you write to MCU. It will be red if the configuration that you see is different from last configuration you write to MCU. 15 | P a g e 4.3.1 AN_ Digital_I/O Window Figure 8 shows Digital_I/O window for analog pins. You can obser ve if the pin is configured as Digital_Output it will have a button and if pin is configured as Digital_Input it will have a label to read digital input (High or Low), green color for high and orange color for low. If the pin is configured as Analog_Input it will have nothing. Tools Turn OFF all Outputs: it will turn off all pins which are configured as OUTPUT. Tools Turn ON all Outputs: it will turn off all pins which are configured as OUTPUT. Figure 8 ( AN_Digital_I/O Window ) 16 | P a g e When you click on “Start” button: If the pin has been configured as “ Digital_Output ” and set to “ON” , its voltage will be set to value: 5V (High). If the pin has been configured as “ Digital_Output ” and set to “O FF ” , its voltage will be set to value : 0 V (Low). When you click on “S top ” button: If the pin has been configured as “ Digital_Output ” and set to “ON” , its voltage will be set to value: 0 V (Low). If the pin has been configured as “ Digital_Output ” and set to “O FF ” , its voltage will be set to value: 0 V (Low). 17 | P a g e 4.3.2 Analog_Read Window F igure 9 shows Analog_Read window . You can observe if the pin is configured as Analog_Input the cell which is related to it will be active, otherwise it will be disabled. Figure 9 ( Analog_Read Window ) 18 | P a g e 4.4 AREF_Config Figure 10 shows the AREF_Config window Figure 10 ( AREF_Config Window ) Opening the AREF_Config window will read the last configuration from MCU (Default or External or Internal). Analog Reference Voltage source will be Default (Supply Voltage) if it is the first time using Atmega328P from PixelCodeBook. You can configure AREF by choose button. Write configuration after finish it by File Write. You can read the configuration from MCU by File Read.