Jump to content

marcaz

Members
  • Content Count

    6
  • Joined

  • Last visited

About marcaz

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. marcaz

    Motorcycle dynamics monitor

    Thanks for ideas. Will check after work and give feedback
  2. Hi, Short intro: Base - STM32F746G-Discovery MEMS - BMP085 Baro sensor, BMA180 Accelerometer, ITG3205 Gyro Purpose is to monitor and display motorcycle lean angles and braking, accelaration. In future contact less IR temperature sensor (TMP007 propably) will be integrated to measure tire temperature. Here is short video and a problem I would like to discuss. Problem: during I2C read routine display is flickering and gets distorted. Seems like uGFX task does not get processing time. I2C reading is done every 10 miliseconds via interrupts. maybe some thoughts? Also giving access to this repo: https://marcaz@bitbucket.org/marcaz/motomoni_cm7.git p.s. seems like that make impact to that flockering while (HAL_I2C_GetState(i2c_handler) != HAL_I2C_STATE_READY) Read and write routines: HAL_StatusTypeDef I2Cx_ReadMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length) { uint32_t err_cnt = 0; uint32_t rd_cnt = 0; HAL_StatusTypeDef status = HAL_OK; uint32_t err; while( HAL_I2C_Mem_Read_IT(i2c_handler,(uint16_t)Addr, Reg, I2C_MEMADD_SIZE_8BIT,Buffer, Length)!= HAL_OK){ err_cnt++; // osDelay(10); } while (HAL_I2C_GetState(i2c_handler) != HAL_I2C_STATE_READY) { rd_cnt++; osDelay(1); } if( err_cnt > 2 || rd_cnt > 2){ db("[RD] er:%u, rd:%u\r\n",err_cnt,rd_cnt); } /* Return OK */ return HAL_OK; } HAL_StatusTypeDef I2Cx_WriteMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length) { uint32_t err_cnt = 0; uint32_t rd_cnt = 0; HAL_StatusTypeDef status = HAL_OK; uint32_t err; uint8_t d[2]; d[0] = Reg; d[1] = *Buffer; while (HAL_I2C_Mem_Write_IT(i2c_handler, Addr, Reg, Reg > 0xFF ? I2C_MEMADD_SIZE_16BIT : I2C_MEMADD_SIZE_8BIT, Buffer, Length) != HAL_OK) { /* Check error */ err = HAL_I2C_GetError(i2c_handler); if (err != HAL_I2C_ERROR_NONE) { db("erroras i2c a:%X\r\n",err); break; } err_cnt++; } while (HAL_I2C_GetState(i2c_handler) != HAL_I2C_STATE_READY) { rd_cnt++; osDelay(1); } if( err_cnt > 2 || rd_cnt > 2){ db("er:%u, rd:%u\r\n",err_cnt,rd_cnt); } return status; } VIDEO0075.mp4
  3. marcaz

    Studio and graphs

    Yea, I already saw this widget. But at this phase, main goal is to read all sensors, setup drivers and define architecture of monitoring. Second step is nicer graphics
  4. marcaz

    Studio and graphs

    Thanks for detailed info and congrats with New \x32\x30\x31\x37 :))) My Christmas were productive as well Developing motorcycle g-force and lean angles monitor
  5. marcaz

    Studio and graphs

    Hey, whats'up? What is planned release date?
×