Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMA423 step acquisition?

    New Poster

    BMA423 step acquisition?

    BMA423 step acquisition?

    I followed the operation, but I can't get the reason for the interrupt from the interrupt, because it returns 0 every time, the direct reading step is also 0, other functions, such as writing the configuration file, getting the acceleration The values are all normal. Is it only normal to get the number of steps? Did I miss something?

    static void Step_Interrupt(void)
    {
        motion_sensor_command_t command = PROCESS_STEP_INTERRUPT;
        xQueueSendFromISR(motionCommandQ, &command, &xHigherPriorityTaskWoken);
    }
    
    
    //The return value is normal, ignore the return value check here
    rslt |= bma423_init(&bmd4_dev);
    rslt |= bma423_write_config_file(&bmd4_dev);
    rslt |= bma423_step_counter_set_watermark(1, &bmd4_dev);
    rslt |= bma423_reset_step_counter(&bmd4_dev);
    rslt |= bma423_feature_enable(BMA423_STEP_CNTR, BMA4_ENABLE, &bmd4_dev);
    rslt |= bma423_step_detector_enable(BMA4_ENABLE, &bmd4_dev);
    rslt |= bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_STEP_CNTR_INT, BMA4_ENABLE, &bmd4_dev);
    attachInterrupt(BMA423_INT1_PIN, Step_Interrupt, RISING);
    while(1){
    
        rtosApiResult = xQueueReceive(motionCommandQ, &motionCommand, portMAX_DELAY);
        if (rtosApiResult == pdTRUE) {
            switch (motionCommand) {
                case PROCESS_STEP_INTERRUPT:
                bma423_read_int_status(&int_status, &bmd4_dev);
                if (int_status & BMA423_STEP_CNTR_INT) {
                    bma423_step_counter_output(&stepCount, &bmd4_dev);
                    printf("stepCount:%u\n",stepCount);
                }
        }
    }



     

    Tags (2)
    3 REPLIES 3
    Community Moderator

    Re: BMA423 step acquisition?

    In order to see interrupt signal from INT1 pin or INT2 pin, you need to configure register 0x53 or 0x54 to set the pin to be "Output enable" and "active high". In addition the step counter will show up when you do more than 7 steps. If you do 5 steps and stop for example, then the step counter will be 0. If you do 7 steps or more everytime, then the step couinter will show the correct value. This is the internal step counter buffer to avoid accident steps.

    New Poster

    Re: BMA423 step acquisition?

    Sorry, late reply. Interrupt me is not configured, but it works the same. Normally, when it is picked up, it will be interrupted. I can't get the number of steps according to the above code. Every time it returns, it is 0, but it is strange when there is The number of steps is displayed when I run it. I am very curious.
    New Poster

    Re: BMA423 step acquisition?

    is this issue still there?  Your description seems confusing, that you can get the step counter number during running, while you can only get 0 when you read the step counter number registers. please elaborate more here.

    To understand clearly the sensor status and run further analysis, please read out the entire sensor register map when the issue happens:

    0x00~0x25, 0x27~0x5D, 0x5F~0x7E

    and read ~100bytes from 0x5E by a burst read.

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist