Author: LinglingG_46 Version: **
问题: 如何通过UART和Log数据监测CapSense 传感器数据?
答案:
附加的项目使用CY8CKIT-145工具包实现CapSense按键。
当I2C端口已用于其他目的或CapSense参数(如原始计数)和差异计数必须无限期记录时,以下监视CapSense数据的方法很有用。
PSoC 4®设备编程
1. 按照这个步骤 Start à Cypress à PSoC Programmer
2. 单击File Load图标并加载附件工程文件夹“CapSense_UART_sensor_monitor”的文件CapSense_UART_sensor_monitor.hex。选择PSoC Programmer 设置如图1。
图1. PSoC Programmer 设置
3. 连接CY8CKIT-145 到USB口。
4. 单击program图标。如果编程完成,将显示“Programming Succeeded”消息,如图 2所示。
图 2. Programming PSoC 4
查看CapSense传感器数据和记录桥控制面板(BCP)
1. 按照下面步骤Start à Cypress à Bridge Control Panel。
2. 在Bridge Control Panel 对话框中,转到图 3所示的chart->Variable Settings。
图 3. 访问 Variable Settings
3. 在Variable Setting对话框中,输入变量名和数据类型,如图 4所示。单击“OK”返回BCP对话框。
图 4. 输入变量名字和数据类型
注意:您也可以从variable_settings.ini文件导入这些变量。单击“Load…”并选择variable_settings.ini。
4. 在BCP对话框中,从连接的I2C/SPI/RX8端口列表中选择PSoC 4设备的COM端口。在本例中,COM端口是COM30。这个端口可能会有所不同。如果连接成功,“Connected”将显示为绿色,如图 5所示。
图 5. Selecting COM Port
5. 在编辑选项卡中,输入从PSoC4接收传感器数据的命令,如图 6所示。
注意:您可以导入此知识库文档自带的文件UART_command.iic,而不是手动输入命令。此文件包含接收传感器数据的命令。单击File->Open File(Ctrl+O)去导入文件。
6. 要执行一次命令,请单击“Send”按钮。要以迭代方式执行命令,请单击中以蓝色突出显示的Repeat 如图 5。
BCP开始从PSoC 4接收数据流。BCP命令@1rawcount0捕获高字节,而@0rawcount0捕获RawCount的低字节。类似地,其他变量从psoc4设备的数据流中分离出来。
图 6. Reading Data from PSoC 4 Device
注意:符号“+”将较长的命令分成多行。
图 7显示了从psoc4设备发送CapSense传感器数据所需的代码。
图 7. PSoC 4函数发送CapSense数据
7. 要可视化从PSoC 4设备接收到的数据,请转到图表选项卡并选择右上角列出的绘图rawcount0。您还可以选择其他变量,比如diffcount0,如图8和图10所示。
图8. Raw Count Plot on BCP
图9. Difference Count Plot on BCP
9. 要记录CapSense传感器数据,请单击“Repeat”以运行BCP。在预期的持续时间后,单击“停止”停止数据监视。
图10 开始和停止数据监测
10. 单击 Chart->Export Collected Data
图11. 导出收集的数据
11. 从Export Collected Data对话框,你可以把数据保存为图片,文本,XML,HTML 或者Excel格式。
图12.保存导出数据
Community Translated by NoTa_4591161 Version: **
Translation - English: PSoC 4 Opamp Input Voltage Noise Density Graph – KBA231398
デバイスの動作電圧とセンサー電圧は、時間の経過とともに低下しています。 これにより、オペアンプを使用する際の重要な要素であるノイズが発生します。 周波数によるオペアンプのノイズ密度の変化を知ることは、PSoC®のオペアンプベースの設計で作業するときに役立ちます。 グラフィカルな表現は、設計プロセスにとってより直感的でユーザーフレンドリーです。 これを支援するために、デバイスのデータシートのポイントデータと1 / sqrt(f)ノイズ特性から推定された曲線を使用して、図1のグラフが生成されます。
図1. PSoC4オペアンプのノイズ
Community Translated by NoTa_4591161 Version: **
Translation - English: Log Data in Bridge Control Panel (BCP) using MiniProg3 (UART) for PSoC 3/4/5LP Devices - KBA231530
以下の手順に従って、PSoC 3/4/5LPデバイス用のMiniProg3を使用して、RX8プロトコル(UART)を使用してブリッジコントロールパネル(BCP)にデータを記録します。
1. PSoC Creatorを使用して、必要なピンを使用してUARTインターフェースをセットアップします。UART TXデータの送信中に、ヘッダーバイトとフッターバイトを追加して、BCPがデータを正しく同期できるようにします。
たとえば、PSoC4デバイスの場合:
header[2] = {0x0D, 0x0A};
footer[3] = {0x00, 0xFF, 0xFF};
buffer[BUFFER_SIZE] = {0x1, 0x2, 0x3};
UART_SpiUartPutArray(header, 2);
UART_SpiUartPutArray(buffer, BUFFER_SIZE);
UART_SpiUartPutArray(footer, 3);
2. MiniProg3をPCに接続します。PSoCボードとMiniProg3の5ピンコネクタの間に次のピンを接続します。
a.MiniProg3の5ピンコネクタのXRESピンをPSoCのUARTTXピンに接続します。
b.MiniProg3の5ピンコネクタのGNDをPSoCボードのGNDに接続します。MiniProg3のVTARGピンを使用してPSoCに電力を供給するか、PSoCに外部電源がある場合は接続しないでおくことができます。
3. スタートメニューからブリッジコントロールパネルを起動します。MiniProg3がGUIで接続されていない場合は、[Connect]ボタンを押します。次に、GUIまたはTools > Protocol ConfigurationでRX8プロトコルを選択して、[Protocol Configuration]ウィンドウを開きます。RX8タブを選択します。
4. PSoCとBCPのボーレート設定が同じであることを確認します。BCPでボーレートを設定するには、[F7]を押すか、Tools > Protocol Configuration を選択します。RX8(UART)タブに移動し、ビットレートを設定します。
5.変数設定を開き(Chart > Variable Settings)、データを受信する変数を設定します。
6.次のBCPスクリプトを使用して、データを受信します。
RX8 [h=0D 0A] @var1 @var2 @var3 [t=00 ff ff]
注:BCPがR8プロトコルを使用してPSoCにデータを送り返すことはできません。PSoCからのみUARTデータを受信できます。
Show LessCommunity Translated by NoTa_4591161 Version: **
Translation - English: ModusToolbox Warning: Uncommitted/Untracked Files Detected - KBA231252
質問:
ModusToolboxアプリケーションがコミットされていない/追跡されていないファイルに関する警告を報告するのはなぜですか?
回答:
ModusToolboxアプリケーションにコンパイルされた一部のファームウェアは、コンフィギュレータによって生成されます。ModusToolboxビルドプロセスは、次のような理由でソースコードが古くなった場合、ビルドプロセス中にソースコードを再生成します。
ModusToolboxはgitを使用してファームウェアを配布および更新します。上記の変更により、これらのリポジトリを更新しようとすると、gitから警告がトリガーされる場合があります(たとえば、Library Managerを使用するか、コマンドラインでgitを使用して直接)。警告は次のようになります。
WARNING: Uncommitted/Untracked files detected in "<path to repository>".
Save your work in source control before updating this library.
Skipping current reference...
これは、処理されていない変更されたファイルがあり、それについて何かをする必要があることを通知するgitシステムの方法です。システムは、変更が誤って失われないように注意しています。
1. デバイスサポートライブラリは、ターゲットデバイスによって異なります。より一般的なオプションは次のとおりです。
PSoC 6: psoc6pdl or mtb-pdl
PSoC 4: mtb-psoc4-pdl
Bluetooth: 20706A2, 20719B2, 20721B2, 20735B1, 20819A1, 20820A1, 20835B1, 43012C0
警告を解決:
この警告を解決するには、ニーズと、デフォルトのビルドサポートパッケージ(BSP)を使用しているかカスタムBSPを使用しているかに応じて、いくつかの方法があります。
デフォルトのBSP
サイプレスが提供するデフォルトのBSPの1つを(上記のように)変更した場合は、カスタムBSPを作成してから、デフォルトのBSPの変更を元に戻す必要があります。
1. ModusToolboxユーザーガイドのBSPの章の指示に従って、現在の(変更された)BSPに基づいてカスタムBSPを作成します。
2.デフォルトのBSPに戻すには、gitを実行するように構成された適切なシェルを使用して次のコマンドを実行します。
# 注:これにより、存在してはならないファイルがすべて削除されます。
git -C <警告からリポジトリへのパス> clean -dfx
# 注:これにより、ファイルが元の状態に戻ります。
git -C <警告からリポジトリへのパス> restore。
3.すべてがクリーンされ、準備ができていることを確認します。
git -C <警告からリポジトリへのパス> status
4.出力に次のテキストが含まれていることを確認します。
"nothing to commit, working tree clean"
カスタムBSP
カスタムBSPのいずれかに変更を加えた場合は、その変更を元に戻すか([デフォルトBSP]の手順に従ってください)、変更をコミットすることができます。
変更を受け入れるには、ソースコード管理システムに変更をコミットまたはチェックインします。たとえば、gitを使用する場合:
# 注:変更を確認し、それらが正しいことを確認してください。
git -C <警告からリポジトリへのパス>ステータス
# 注:変更が受け入れ可能であることを確認した後、それらをコミットします。
git -C <警告からリポジトリへのパス> add。
git -C <警告からリポジトリへのパス> commit
Show LessVersion: **
Translation - Japanese: PSoC 3/4/5LPデバイス用のMiniProg3(UART)を使用してブリッジコントロールパネル(BCP)にデータを記録する - KBA231530 - Community Translated (JA)
Follow these steps to log data in the Bridge Control Panel (BCP) with the help of the RX8 protocol (UART), using MiniProg3 for PSoC 3/4/5LP devices:
1. Set up a UART interface with the required pins using PSoC Creator. While sending the UART TX data, add the header and footer bytes to enable the BCP to synchronize data correctly.
For example in PSoC 4 devices:
header[2] = {0x0D, 0x0A};
footer[3] = {0x00, 0xFF, 0xFF};
buffer[BUFFER_SIZE] = {0x1, 0x2, 0x3};
UART_SpiUartPutArray(header, 2);
UART_SpiUartPutArray(buffer, BUFFER_SIZE);
UART_SpiUartPutArray(footer, 3);
2. Connect MiniProg3 to the PC. Connect the following pins between the PSoC board and the MiniProg3 5-pin connector:
a. XRES pin of the MiniProg3 5-pin connector to the UART TX pin of PSoC.
b. GND of the MiniProg3 5-pin connector to the GND on the PSoC board. You can either supply power to the PSoC using the VTARG pin of MiniProg3 or leave it unconnected if PSoC has an external power source.
3. Launch Bridge Control Panel from the Start menu. If MiniProg3 is not connected in the GUI, press the Connect button. Then choose RX8 protocol in the GUI or Tools > Protocol Configuration to open the Protocol Configuration window. Select the RX8 tab.
4. Ensure that the baud rate setting in the PSoC and BCP are the same. To set the baud rate in BCP, press [F7] or choose Tools > ProtocolConfiguration. Navigate to the RX8 (UART) tab and set the bit rate.
5. Open Variable Settings (Chart > Variable Settings) to set up the variables to receive data.
6. Use the following BCP script to receive data.
RX8 [h=0D 0A] @var1 @var2 @var3 [t=00 ff ff]
Note: It is not possible for BCP to send data back to PSoC using the R8 protocol. It can only receive UART data from PSoC.
Show LessVersion: **
Translation - Japanese: PSoC 4オペアンプの入力電圧ノイズ密度グラフ – KBA231398 - Community Translated (JA)
Device operating voltages and sensor voltages have been reducing over time. This makes noise, an important factor when you work with Opamp. Knowing the changes in Opamp noise density with frequency comes in handy while working with PSoC® Opamp-based designs. A graphical representation is more intuitive and user-friendly for the design process. To help with that - using the point data from the device datasheet and the curve estimated from 1/sqrt(f) noise characteristic, the graph in Figure 1 is generated.
Figure 1. PSoC 4 Opamp Noise
Version: **
Translation - Japanese: ModusToolbox警告:コミットされていない/追跡されていないファイルが検出されました - KBA231252 - Community Translated (JA)
Question:
Why does my ModusToolbox application report a warning about uncommitted/untracked files?
Answer:
Some firmware compiled into a ModusToolbox application is generated by configurators. The ModusToolbox build process re-generates source code during its build process if it's out of date for any reason, such as:
ModusToolbox uses git to distribute and update firmware, and the above changes may trigger a warning from git when trying to update those repositories (for example, with Library Manager or directly on the command-line with git). The warning looks like this:
WARNING: Uncommitted/Untracked files detected in "<path to repository>".
Save your work in source control before updating this library.
Skipping current reference...
This is the git system's way of telling you that there are modified files that haven't been dealt with, and you need to do something about it. The system is being careful to make sure changes are not accidentally lost.
1 The device support library depends on your target device. Here are the more common options:
PSoC 6: psoc6pdl or mtb-pdl
PSoC 4: mtb-psoc4-pdl
Bluetooth: 20706A2, 20719B2, 20721B2, 20735B1, 20819A1, 20820A1, 20835B1, 43012C0
Resolve the Warning:
There are several ways you can resolve this warning, depending on your needs and whether you are using a default Build Support Package (BSP) or a custom BSP.
Default BSP
If you changed one of the default BSPs provided by Cypress (as described above), you should create a custom BSP and then revert the changes in the default BSP.
1. To create a custom BSP based on the current (modified) BSP, following the instructions in the BSP chapter of the ModusToolbox User Guide.
2. To revert the default BSP, run the following commands using the appropriate shell configured to run git.
# NOTE: This will delete any files that should not be present.
git -C <path to repository from warning> clean -dfx
# NOTE: This reverts files back to their original state.
git -C <path to repository from warning> restore .
3. Make sure everything is clean and ready:
git -C <path to repository from warning> status
4. Make sure the output includes the following text:
"nothing to commit, working tree clean"
Custom BSP
If you made a change in one of your custom BSPs, you may either revert that change (follow instructions under Default BSP), or commit the change.
To accept the changes, commit or check them in to your source code control system. For example, if you use git:
# NOTE: make sure you look at the changes and are sure they are correct.
git -C <path to repository from warning> status
# NOTE: after you are sure the changes are acceptable, and commit them.
git -C <path to repository from warning> add .
git -C <path to repository from warning> commit
Show LessCommunity Translated by NoTa_4591161 Version: *A
Translation - English: Flash Memory Write Defect in PSoC® Creator™ cy_boot [v4.0 and v4.10] for the PSoC 4 Device - KBA94530
質問:
サイプレスは、PSoC®4000、PSoC 4100、およびPSoC 4200デバイスのフラッシュ書き込み機能に欠陥があることを確認しました。PSoC Creator™ cy_boot [v4.0およびv4.10]コンポーネントのCySysFlashWriteRow()関数は、書き込まれる行データがゼロ以外で、チェックサムの下位32ビット(計算されたフラッシュ行書き込み前)はすべてゼロです。これについて私は何をする必要がありますか?
回答:
この問題は、PSoC Creator 3.0 Service Pack 2のcy_bootバージョン4.11(2014年11月)で修正されています。この問題を解決するには、コンポーネントアップデートツールを使用して、既存のすべてのデザインで使用されているcy_bootコンポーネントのバージョンを4.11にアップデートします。コンポーネントの更新の詳細については、PSoC Creatorヘルプを参照してください。
Show LessCommunity Translated by NoTa_4591161 Version: **
Translation - English: PSoC 4 I2C Master Always Reports BUS_BUSY - KBA231435
I2Cマスター構成のSCBブロックは、I2C開始条件でビジーフラグを設定し、I2C停止条件でそれをクリアします。
SDAラインを論理LOW(0.1VDD)にする可能性のあるI2Cバスのノイズは、誤ったスタート条件でトリガーしてしまいます。次に、ハードウェアはバスが永久にビジーであり、この状態から回復しないと想定します。このエラーは、マスターから完全なバイトが受信される前に、アクティブな転送中にスレーブがSCLラインをLOWにプルした場合にも発生する可能性があります。
この無期限のSCB_I2C_MSTR_BUS_BUSYステータスから回復するには、ステータスがいくつかのサイクルの間継続的にビジーであるときに、SCB_STOP()およびSCB_Start()関数を呼び出してI2Cブロックをリセットする必要があります。
次のコードスニペットは、マスターがスレーブに書き込みを試み、通常はI2CM_I2C_MSTR_NO_ERRORを返すこの機能を示しています。ただし、NO_OF_ATTEMPTS 回連続してエラーが発生すると、I2Cブロックがリセットされます。
/* I2C書き込みを開始し、ステータスをチェックします */
if (I2CM_I2C_MSTR_NO_ERROR == I2CM_I2CMasterWriteBuf(I2C_SLAVE_ADDR,
buffer, PACKET_SIZE ,
I2CM_I2C_MODE_COMPLETE_XFER ))
{
busy_cnt = 0;
/* I2C書き込み成功 */
}
/* I2Cデータの送信中にエラーが発生しました*/
else
{
/* ビジーカウンターフラグを更新します */
busy_cnt ++;
/* I2C書き込みで継続的なエラーが発生したかどうかを確認します*/
if (busy_cnt> NO_OF_ATTEMPTS )
{
busy_cnt = 0;
/* SCBブロックをリセットします */
I2CM_Stop();
I2CM_Start();
}
}
関連ドキュメント:
SCBコンポーネントデータシート:https : //www.cypress.com/documentation/component-datasheets/psoc-4-serial-communication-block-scb
I2Cバス仕様:https : //www.nxp.com/docs/en/user-guide/UM10204.pdf
Show LessAuthor: AH_96 Version: **
Translation - Japanese: PSoC 4 I2Cマスターは常にBUS_BUSYを報告します - KBA231435 - Community Translated (JA)
The SCB block in the I2C master configuration sets the busy flag on an I2C start condition and clears it on an I2C stop condition.
Any noise in the I2C bus, which could pull the SDA line to logic LOW (0.1VDD), triggers an erroneous Start condition. The hardware then assumes that the bus is busy forever and will not recover from this state. This error could also happen if a slave pulls the SCL line LOW during an active transfer before the complete byte is received from the master.
To recover from this indefinite SCB_I2C_MSTR_BUS_BUSY status, the I2C block must be reset by calling the SCB_STOP() and SCB_Start() functions when the status is continuously busy for some cycles.
The following code snippet shows this functionality where the master tries to write to the slave and normally returns I2CM_I2C_MSTR_NO_ERROR. However, when the error occurs continuously for NO_OF_ATTEMPTS times, the I2C block is reset:
/* Start I2C write and check status*/
if(I2CM_I2C_MSTR_NO_ERROR == I2CM_I2CMasterWriteBuf(I2C_SLAVE_ADDR,
buffer, PACKET_SIZE,
I2CM_I2C_MODE_COMPLETE_XFER))
{
busy_cnt = 0;
/* I2C write successful */
}
/* Error while sending I2C data */
else
{
/* Update the busy counter flag */
busy_cnt++;
/* Check if there were continuous errors in I2C writes */
if(busy_cnt > NO_OF_ATTEMPTS)
{
busy_cnt = 0;
/* Reset the SCB block */
I2CM_Stop();
I2CM_Start();
}
}
Related Documents:
SCB component datasheet: https://www.cypress.com/documentation/component-datasheets/psoc-4-serial-communication-block-scb
I2C Bus specification: https://www.nxp.com/docs/en/user-guide/UM10204.pdf
Show Less