Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Translation_Bot
Community Manager
Community Manager
Community Manager
100 likes received

你好!

我有以下程式碼不起作用。 第一次呼叫readRegister 回應為 0後,第二次呼叫 readRegister 後,我收到了預期值。
你能幫忙嗎? 我必須提到,我的應用程式是基於 Infineon SPI_CPU_TC334 訓練,我也嘗試更改spiMasterChannelConfig.channelBasedCs但我仍然沒有收到預期的行為。

我還附上了 QSPI 的原始碼。
謝謝你!

 

/**********************************************************************************************************************
 * \file Cpu0_Main.c
 * \copyright Copyright (C) Infineon Technologies AG 2019
 * 
 * Use of this file is subject to the terms of use agreed between (i) you or the company in which ordinary course of 
 * business you are acting and (ii) Infineon Technologies AG or its licensees. If and as long as no such terms of use
 * are agreed, use of this file is subject to following:
 * 
 * Boost Software License - Version 1.0 - August 17th, 2003
 * 
 * Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and 
 * accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute,
 * and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the
 * Software is furnished to do so, all subject to the following:
 * 
 * The copyright notices in the Software and this entire statement, including the above license grant, this restriction
 * and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all 
 * derivative works of the Software, unless such copies or derivative works are solely in the form of 
 * machine-executable object code generated by a source language processor.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 
 * COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN 
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
 * IN THE SOFTWARE.
 *********************************************************************************************************************/
#include "Ifx_Types.h"
#include "IfxCpu.h"
#include "IfxScuWdt.h"
#include "QSPI_Config.h"
#include "Timers.h"

#define LED &MODULE_P00,5

IFX_ALIGN(4) IfxCpu_syncEvent g_cpuSyncEvent = 0;

volatile uint8 delay;
static unsigned char response = 0;

void core0_main(void)
{
    IfxCpu_enableInterrupts();
    
    /* !!WATCHDOG0 AND SAFETY WATCHDOG ARE DISABLED HERE!!
     * Enable the watchdogs and service them periodically if it is required
     */
    IfxScuWdt_disableCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword());
    IfxScuWdt_disableSafetyWatchdog(IfxScuWdt_getSafetyWatchdogPassword());
    
    /* Wait for CPU sync event */
    IfxCpu_emitEvent(&g_cpuSyncEvent);
    IfxCpu_waitEvent(&g_cpuSyncEvent, 1);
    
    //init1msTimer();
    initQSPI2Master();
    initQSPI2MasterChannel();

    resetIMMU();
    selfTestIMMU();

    /*uint8 xGyro, yGyro, zGyro;*/
    while(1)
    {
        response = readRegister(WHO_AM_I, 0x00);
       // response = readRegister(WHO_AM_I, 0x00);
        //readIMMUAxis(&xGyro, &yGyro, &zGyro);
    }
}

 

1 解決方案
Translation_Bot
Community Manager
Community Manager
Community Manager
100 likes received

@Alex_07

您正在與陀螺儀感測器通訊嗎?
我建議您查看感測器文檔,有時需要等待指示已準備好進行通信的信號。

此致,
尤利塞斯

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/QSPI-response-not-working-properly/m-p/745555

在原始文章中檢視解決方案

0
3 回應
Translation_Bot
Community Manager
Community Manager
Community Manager
100 likes received

@Alex_07

您正在與陀螺儀感測器通訊嗎?
我建議您查看感測器文檔,有時需要等待指示已準備好進行通信的信號。

此致,
尤利塞斯

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/QSPI-response-not-working-properly/m-p/745555

0
Translation_Bot
Community Manager
Community Manager
Community Manager
100 likes received

你好@Ulises_L

是的,我正在嘗試連接 MPU9250。 讀取/寫入操作至少需要 16 個時鐘才能執行操作。 我已經在示波器上檢查過這一點,並且存在這個最小值。

此致,
亞歷克斯

0
Translation_Bot
Community Manager
Community Manager
Community Manager
100 likes received

你好@Alex_07

我指的是一個有時顯示為「暫存器讀取/寫入啟動時間」的參數,即在開發感測器暫存器讀取/寫入之前需要等待的一段時間,通常以毫秒為單位。

BR,
尤利塞斯

0