Chiptorials - CLB Synthesizer Quick Start Guide – Driving a 7-segment Display | Videos
Chiptorials - CLB Synthesizer Quick Start Guide – Driving a 7-segment Display
Microchip’s new configurable logic block (CLB) peripheral comes with a graphical tool to configure it. This video walks you through the process of using the new tool to set up the CLB to drive a seven-segment display.
Resources used:
MPLAB X IDE: https://www.microchip.com/en-us/tools-resources/develop/mplab-x-ide?utm_source=Youtube&utm_medium=VideoDescription&utm_campaign=MCU8_MMTCha_PIC16F13145&utm_content=clb_tool_walkthrough&utm_bu=MCU08
XC8 Compiler: https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers?utm_source=Youtube&utm_medium=VideoDescription&utm_campaign=MCU8_MMTCha_PIC16F13145&utm_content=clb_tool_walkthrough&utm_bu=MCU08
Learn more about the CLB tool: https://www.microchip.com/en-us/products/microcontrollers-and-microprocessors/8-bit-mcus/core-independent-and-analog-peripherals/system-flexibility/configurable-logic-block?utm_source=Youtube&utm_medium=VideoDescription&utm_campaign=MCU8_MMTCha_PIC16F13145&utm_content=clb_tool_walkthrough&utm_bu=MCU08
Try the PIC16F13145: https://microchip.com/pic16f13145?utm_source=Youtube&utm_medium=VideoDescription&utm_campaign=MCU8_MMTCha_PIC16F13145&utm_content=clb_tool_walkthrough&utm_bu=MCU08
Buy a PICkit5: https://www.microchip.com/en-us/development-tool/pg164150?utm_source=Youtube&utm_medium=VideoDescription&utm_campaign=MCU8_MMTCha_PIC16F13145&utm_content=clb_tool_walkthrough&utm_bu=MCU08
Check out a similar example: https://github.com/microchip-pic-avr-examples/pic16f13145-7-segment-decoder-mplab-mcc
Verilog snippet:
module bcd7seg(bcd0,bcd1,bcd2,bcd3, seg0,seg1,seg2,seg3,seg4,seg5,seg6);
input bcd0, bcd1, bcd2,bcd3; //initializing bcd as an 4 bit input signal
output seg0,seg1,seg2,seg3,seg4,seg5,seg6; //initializing seg as an 8 bit output signal
assign seg0= ~(((~bcd3)&(~bcd2)&(~bcd1)&bcd0) | ((~bcd3)&bcd2&(~bcd1)&(~bcd0))); //Logical expression for segment0 (Segment A)
assign seg1= ~(((~bcd3)&bcd2&(~bcd1)&bcd0) | ((~bcd3)&bcd2&bcd1&(~bcd0))); //Logical expression for segment1 (Segment B)
assign seg2= ~(((~bcd3)&(~bcd2)&bcd1&(~bcd0))); //Logical expression for segment2 (Segment C)
assign seg3 = ~(((~bcd3)&(~bcd2)&(~bcd1)&bcd0) | ((~bcd3)&bcd2&(~bcd1)&(~bcd0)) | ((~bcd3)&bcd2&bcd1&bcd0)); //Logical expression for segment3 (Segment D)
assign seg4 = ~(((~bcd3)&bcd0) | ((~bcd3)&bcd2&(~bcd1)) | (~(bcd2)&(~bcd1)&bcd0)); //Logical expression for segment4 (Segment E)
assign seg5 = ~(((~bcd3)&(~bcd2)&bcd0) | ((~bcd3)&(~bcd2)&bcd1) | ((~bcd3)&bcd1&bcd0)); //Logical expression for segment5 (Segment F)
assign seg6 = ~(((~bcd3)&(~bcd2)&(~bcd1))|((~bcd3)&bcd2&bcd1&bcd0)); //Logical expression for segment6 (Segment G)
endmodule
Chapters:
0:00 About the CLB
0:37 Creating a project
1:17 Configuring the CLB
3:13 MCC Melody Settings
3:57 Writing application code
4:55 Programming the hardware
5:32 Outro