Circuit Simulation

Under progress..............

In order to download the proteus components library for proteus simulation follow the link..

Follow the youtube link lectures regarding the proteus installation and tutorials.

To avoid crashing your software while running the simulation follow the link.


A website to get more info about the proteus simulation.

A blog link for proteus motor simulation

While doing the schematics, avoid using the net 


while simulating leds in proteus never forget to select the digital model instead of analog i.e. the default value, this can be done by clicking on the leds.


Project-1: LED blinking

  • Basic code generation using STM32CubeMX
  • For code editing, i am using here Keilv5
  • For simulating it on Proteus using STM32F103C6 processor from STMicroelectronics





in the main function's infinite while loop, put the below lines of code for LED blinking operation.

  • HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_0);
  • HAL_Delay(10);
  • HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_1);
  • HAL_Delay(10);
Project-2: UART



write the code
  • char buffer[]="testing\n\r";
and in the main's while loop:
  • HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_0);
  • HAL_Delay(10);
  • HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_1);
  • HAL_Delay(10);
  • //UART
  • HAL_UART_Transmit(&huart1,(uint8_t *)buffer,sizeof(buffer),1000);
  • HAL_Delay(10);
Project-3: ADC
ADC with DMA is not working on proteus, because proteus does not have model to support the DMA peripheral of micro-controller. Hence, here i will be using the ADC without using the DMA.





Global variables
  • /* USER CODE BEGIN PV */
  • char buffer[]="testing\n\r";
  • char trans_str[64] = {0,};
  • uint16_t adc[1] = {0};
  • /* USER CODE END PV */
Code before the infinite while loop in main()
  •  /* USER CODE BEGIN 2 */
  • HAL_ADC_Start(&hadc1);
  •   /* USER CODE END 2 */
Infinite while loop code
  • /* USER CODE END WHILE */
  • HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_0);
  • //HAL_Delay(5);
  • HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_1);
  • //HAL_Delay(5);
  • //UART
  • HAL_UART_Transmit(&huart1,(uint8_t *)buffer,sizeof(buffer),1000);
  • //HAL_Delay(5);
  • //Reading channel 3
  • HAL_ADC_PollForConversion(&hadc1,10);
  • adc[0] = HAL_ADC_GetValue(&hadc1);
  • snprintf(trans_str, 63, "throtle %d\n\r", (uint16_t)adc[0]);
  •     HAL_UART_Transmit(&huart1, (uint8_t*)trans_str, strlen(trans_str), 1000);
  • //HAL_Delay(5);
Project-4: EXTI
External pin interrupts are used to capture the output events






  • /* USER CODE BEGIN Includes */
  • #include "stdio.h"
  • #include "string.h"
  • /* USER CODE END Includes */


  • /* USER CODE BEGIN PV */
  • char buffer[]="testing\n\r";
  • char trans_str[64] = {0,};
  • uint16_t adc[1] = {0};
  • /* USER CODE END PV */

  • /* USER CODE BEGIN 0 */
  • void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin){
  • HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_1);
  • }
  • /* USER CODE END 0 */

  • /* USER CODE BEGIN 2 */
  • HAL_ADC_Start(&hadc1);
  •   /* USER CODE END 2 */


  • /* USER CODE BEGIN 3 */
  • HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_0);
  • //HAL_Delay(5);
  • //UART
  • HAL_UART_Transmit(&huart1,(uint8_t *)buffer,sizeof(buffer),1000);
  • //HAL_Delay(5);
  • //Reading channel 3
  • //HAL_ADC_PollForConversion(&hadc1,10);//will be used in real hardware
  • adc[0] = HAL_ADC_GetValue(&hadc1);
  • snprintf(trans_str, 63, "throtle %d\n\r", (uint16_t)adc[0]);
  •     HAL_UART_Transmit(&huart1, (uint8_t*)trans_str, strlen(trans_str), 1000);
  • //HAL_Delay(5);
Project-5: 3-PWM
Along with the three PWM signals, i have also implemented its control at PA6 pin. Using a button PA6 PWM generationg can be stopped/started. When the button is pressed: PWM will be ON else off.















  • /* USER CODE BEGIN Includes */
  • #include "stdio.h"
  • #include "string.h"
  • /* USER CODE END Includes */

  • /* USER CODE BEGIN PV */
  • char buffer[]="testing\n\r";
  • char trans_str[64] = {0,};
  • uint16_t adc[1] = {0};
  • /* USER CODE END PV */

  • /* USER CODE BEGIN 0 */
  • void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin){
  • HAL_GPIO_TogglePin(GPIOB,GPIO_PIN_1);
  • }
  • /* USER CODE END 0 */

  • /* USER CODE BEGIN 2 */
  • HAL_ADC_Start(&hadc1);
  • HAL_TIM_PWM_Start(&htim1,TIM_CHANNEL_1);
  • HAL_TIM_PWM_Start(&htim1,TIM_CHANNEL_2);
  • HAL_TIM_PWM_Start(&htim1,TIM_CHANNEL_3);
  •   /* USER CODE END 2 */

  • /* USER CODE BEGIN 3 */
  • TIM1->CCR1=100;
  • TIM1->CCR2=200;
  • TIM1->CCR3=300;
  • HAL_GPIO_TogglePin(GPIOB,GPIO_PIN_0);
  • //HAL_Delay(5);
  • //UART
  • HAL_UART_Transmit(&huart2,(uint8_t *)buffer,sizeof(buffer),1000);
  • //HAL_Delay(5);
  • //Reading channel 3
  • //HAL_ADC_PollForConversion(&hadc1,10);//will be used in real hardware
  • adc[0] = HAL_ADC_GetValue(&hadc1);
  • snprintf(trans_str, 63, "throtle %d\n\r", (uint16_t)adc[0]);
  •     HAL_UART_Transmit(&huart2, (uint8_t*)trans_str, strlen(trans_str), 1000);
  • //HAL_Delay(5);
Project-6:

Comments

  1. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
    Very interesting blog.
    kmplayer Crack
    abelssoft-converter4video Crack
    total-network-inventory Crack
    proteus-pro Crack

    ReplyDelete
  2. I guess I am the only one who came here to share my very own experience.Guess what!? I am using my laptop for almost thepast 3 years,
    but I had no idea of solving some basic issues.I do not know how to Download Cracked Pro Softwares
    But thankfully,I recently visited is a website named Serial Link
    Adobe Acrobat Pro DC Crack
    OpenCanvas Crack
    Anti-Porn Crack
    Adobe Photoshop CC Crack
    WinZip Pro Crack
    Kutools for Excel Crack

    ReplyDelete
  3. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost thepast 6 years, but I had no idea of solving some basic issues. I do not know how to Download Cracked Pro Softwares But thankfully, I recently visited is a website named startcrack.net/crack
    Gihosoft TubeGet Crack
    Total Network Inventory Crack
    Wondershare Streaming Audio Recorder Crack
    Wondershare PDFelement Pro Crack

    ReplyDelete
  4. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
    Very interesting blog.
    filecrk.com
    abelssoft-converter4video Crack

    ReplyDelete
  5. This site have particular software articles which emits an impression of being a significant and significant for you individual, able software installation.This Download Latest PC Cracked Softwares is the spot you can get helps for any software installation, usage and cracked.
    proteus-crack

    ReplyDelete
  6. This site have particular software articles which emits an impression of being a significant and significant for you individual, able software installation.This Download Latest PC Cracked Softwares is the spot you can get helps for any software installation, usage and cracked.
    proteus-crack

    ReplyDelete

Post a Comment