PlatformIO I2C Proof of Concept (POC) for VSDSquadron Mini

  • VSDSquadron Mini
  • I2C compatible devices or another VSDSquadron Mini set as the counterpart (Master/Slave)
  • USB to UART converter for programming and power
  • Jumper wires for connections
  • PC1 (SDA) to SDA
  • PC2 (SCL) to SCL
  • GND to Ground
  • 3.3V to 3.3V
  1. Install PlatformIO Core : Begin by installing PlatformIO Core on your system according to the official PlatformIO documentation.
  2. Project Commands :
    • Build the project: $ pio run
    • Upload the firmware: $ pio run –target upload
    • Clean build files: $ pio run –target clean
  • USART_Printf_Init() : Initializes the USART peripheral for debugging.
  • Delay_Ms() : Creates a delay for a specified number of milliseconds.
  • USART_SendData() : Sends data through the USART peripheral.
  • USART_ReceiveData() : Retrieves the most recent data received by the USART peripheral.
  • USART_GetFlagStatus() : Checks the status of specified USART flags.
#include "debug.h"

/* I2C Mode Definition */

#define HOST_MODE 0

#define SLAVE_MODE 1

/* I2C Communication Mode Selection */

#define I2C_MODE HOST_MODE

/* Global define */

#define Size 6

#define RXAdderss 0x02

#define TxAdderss 0x02

/* Global Variable */

u8 TxData[Size] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06};

u8 RxData[5][Size];

void IIC_Init(u32 bound, u16 address) {

GPIO_InitTypeDef GPIO_InitStructure;

I2C_InitTypeDef I2C_InitTSturcture;

RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO, ENABLE);

RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C1, ENABLE);

// SCL Pin Configuration

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_Init(GPIOC, &GPIO_InitStructure);

// SDA Pin Configuration

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;

GPIO_Init(GPIOC, &GPIO_InitStructure);

// I2C Peripheral Configuration

I2C_InitTSturcture.I2C_ClockSpeed = bound;

I2C_InitTSturcture.I2C_Mode = I2C_Mode_I2C;

I2C_InitTSturcture.I2C_DutyCycle = I2C_DutyCycle_2;

I2C_InitTSturcture.I2C_OwnAddress1 = address;

I2C_InitTSturcture.I2C_Ack = I2C_Ack_Enable;

I2C_InitTSturcture.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;

I2C_Init(I2C1, &I2C_InitTSturcture);

I2C_Cmd(I2C1, ENABLE);

}

int main(void) {

SystemCoreClockUpdate();

Delay_Init();

USART_Printf_Init(460800);

printf("SystemClk:%d\r\n", SystemCoreClock);

printf("IIC Host mode\r\n");

IIC_Init(80000, TxAdderss);

#if (I2C_MODE == HOST_MODE)

// Host Mode Operations: Master sends data to Slave

for (int j = 0; j < 5; j++) {

// I2C Master Transmit Sequence

}

#elif (I2C_MODE == SLAVE_MODE)

// Slave Mode Operations: Slave receives data from Master

for (int p = 0; p < 5; p++) {

// I2C Slave Receive Sequence

}

#endif

while (1);

}
  • IIC_Init Function : Initializes the I2C peripheral, including setting up the GPIO pins for I2C functions (SCL and SDA) and configuring I2C parameters such as clock speed, addressing mode, and duty cycle.
  • Main Function :
    • System Initialization: Updates the system core clock and initializes delay functions and USART for debugging.
    • I2C Mode Selection: The code can operate in either HOST_MODE or SLAVE_MODE, determined by the I2C_MODE macro. This allows for flexible testing of both master and slave operations.
    • Host Mode Operations: If in HOST_MODE, the device is configured as an I2C master, initiating communication with a slave device to transmit a series of data packets.
    • Slave Mode Operations: If in SLAVE_MODE, the device acts as an I2C slave, ready to receive data packets from an I2C master.

https://github.com/davidbroughsmyth/vsdsquadron-mini-research/tree/main/I2C_poc

VSDSquadron (Educational Board)

VSDSquadron, a cutting-edge development board based on the RISC-V architecture that is fully open-source. This board presents an exceptional opportunity for individuals to learn about RISC-V and VLSI chip design utilizing only open-source tools, starting from the RTL and extending all the way to the GDSII. The possibilities for learning and advancement with this technology are limitless.

Furthermore, the RISC-V chips on these boards should be open for VLSI chip design learning, allowing you to explore PNR, standard cells, and layout design. And guess what? vsdsquadron is the perfect solution for all your needs! With its comprehensive documentation and scalable labs, thousands of students can learn and grow together.

VSD HDP (Hardware Design Program) Duration-10 Week

With VSD Hardware Design Program (VSD-HDP),  you have the opportunity to push the boundaries of what exist in open source and establish the new benchmark for tomorrow.

It will leverage your degree in Electrical or Computer Engineering to work with

  • Programmable logic
  • Analog/ digital IP
  • RISC-V
  • Architecture & microprocessors
  • ASICs and SoCs on high-density digital or RF circuit cards
  • Gain hands-on knowledge during design validation and system integration.

Sounds exciting to just get started with expert mentors, doesn’t it? But we are looking for the next generation of learners, inventors, rebels, risk takers, and pioneers.

“Spend your summer working in the future !!”

Outcomes of VSD Online Research IP Design Internship Program

  1. Job opportunities in Semiconductor Industry
  2. Research work can be submitted to VLSI International journals
  3. Participate in Semiconductor International Conference with Internship Research Work
  4. Paper Publications in IEEE Conference and SIG groups
  5. Tape out opportunity and IP Royalty
  6. Interact with world class Semiconductor designer and researchers
  7. Academic professions where more research projects are encouraged.
  8. All the above research and publication work will help colleges and institutes to improve accreditation levels.

Know More Information

VSD – Intelligent Assessment Technology (VSD-IAT)

VSD – Intelligent Assessment Technology (VSD-IAT) is expertly built training platform and is suited for designer requirements. Semiconductor companies understand the value of training automation and Engineer performance enhancement, and do not need to be convinced of the impact of a virtual platform for learning. VSD trainings are quick, relevant, and easy to access from any device at any time zone.

VSD Intern Webinars

VSD Interns made it happen !!

VSD is working towards creating innovative talent pool who are ready to develop design and products for the new tech world. VSD believes in “Learning by doing principle” , and always prepare the student to apply the knowledge learned in the workshops, webinars and courses. We always push our students to work on new designs, test it and work continuously till it becomes the best performing design. Any student who enrolls to VSD community starts working with small design and grows with us and develops a tapeout level design with complete honesty and dedication towards the Work !!

Check out VSD Interns Achievement!

VSDOpen Online Conference

Welcome to the World’s only online conference in Semiconductor Industry VSDOpen Conference. With enormous support and global presence of audience from different segments of industrial lobby and academia made a highly successful event. Evolution is change in the genetic makeup of a population over time, online conference is one kind evaluation everyone adapt soon. 

  • VSDOpen 2022 is an online conference to share open-source research with the community and promote  hardware design mostly done by the student community.
  • VSDOpen 2022 is based on the theme “How to lower the cost to learn, build, and tapeout chips ?”  , which will provide a platform to community to build stronger designs and strengthen the future of Chip design.
  • VSDOpen is envisioned to create a community based revolution in semiconductor hardware technology.
  • The open source attitude is required to bring out the talent and innovation from the community who are in remote part of world and have least access to the technologies.  And now Google support will help to bring the vision to execution by VSD team

VSD Online Course by Kunal Ghosh

VSD offers online course in complete spectrum of vlsi backend flow from RTL design, synthesis and Verification, SoC planning and design, Sign-off analysis, IP Design, CAD/EDA automation and basic UNIX/IT, Introduction to latest technology – RISC-V, Machine intelligence in EDA/CAD, VLSI Interview FAQ’s.

Current Reach – As of 2021, VSD and its partners have released 41 online VLSI courses and was successfully able to teach  ~35900 Unique students around 151 countries in 47 different languages, through its unique info-graphical and technology mediated learning methods.

Enquiry Form