MVMC-lab
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # M4開發版開發筆記 ###### tags: `M4` `MVMC-lab` `開發板` ## 相關資料 [實驗室開發版系列](/oAKbYvdIQ96HpeqE47vmUQ) ## 硬體功能方塊 ![](https://i.imgur.com/eLnjq6T.png) 開發板由兩顆微處理器集合而成:分為主控(Major)與副控(Minor) - 主控微控器提供的服務有:**ASA BUS通訊**、**RTC模組**、**Flash disc管理**、**40 PIN I/O**,又**40 PIN I/O**主要提供的服務包含 Timer、PWM、AD/DAC、UART、SPI、I2C等。 - 副控微控器提供的服務有:轉換主控微控器的UART封包至USB封包、掌控開發板的ASAID、 ## ASA系列開發版`標`配 ### ASA BUS > 筆記撰寫時間2022/4月,ASABUS仍處於欲盡不盡狀態。 > 筆者在繪製此開發版期間(2021/7月),大學長要求要繼續使用此設計。 [ASABUS介紹](https://hackmd.io/j_8tzdbbRZWUBZcjpTfwzQ) M4開發版上,使用的晶片工作電壓為3.3V,為了避免高電壓進入,在ASABUS上補上level shifter進行電位轉換。 原本使用TXB0108晶片,但在其他專案使用此晶片的**翔竣**學長遇到這顆晶片的問題並整理了文件: :::info **TXB0108問題** 此IC特性為執行任意電壓到任意電壓的雙向電位轉換,並自動檢測方向。 - 不適用在漏極開路(OD, open drain)的電路,例如I2C - 較適合用在UART中 - 唯一無法與該芯片配合使用的是i2c(因為它使用了強上拉電路,這會混淆自動方向傳感器)。如果需要使用上拉電阻,至少需要50K歐姆以上。 - I / O線上的上拉或下拉電阻TXB0108設計用於驅動高達70 pF的電容性負載。TXB0108的輸出驅動器具有較低的直流驅動強度。如果上拉或下拉電阻從外部連接到數據I / O,則其值必須保持高於50k ohm,以確保它們不與TXB0108的輸出驅動器競爭。 因此改用TXS0108,但須注意的可能問題有: - 該設備已經具有內部10kohm電阻,因此外部上拉電阻很多餘,並導致多餘的電流流入I2C設備。 - 該器件需要在“高壓”側(在這種情況下為5V)上具有輕的電容性負載才能正常工作(所有無源型電壓轉換器也是如此)。 - 不能用來驅動LED - 傳輸線不能太長,會有電容累積的問題 - 1.8V轉5V可能不太適合 - 最大支援110Mbps(Push Pull)/1.2Mbps(Open drain)的速率 德州儀器原廠建議針對I2C通訊介面的電壓轉換,改用以下兩種較佳 - PCA9306 (2-bit bidirectional I2C bus and SMBus voltage-level shifter) - TCA9517 (Level-shifting I2C bus repeater) (但只有2條線可給I2C專用,不符合現在6條線的需求) 以下為國外網友自行測試TXS/B 02/04/08可靠性 測試了TXS 02/04/08和TXB 02/04/08等,發現08版本不可靠。但是02/04可以。所以我已經使用02/04一段時間了,沒有任何問題。 我的結論是,對於I2C 100 kHz,在開漏模式下TXS/B 02/04可以使用短於30cm的導線,但對於推/拉模式應用通常不可靠。 就在幾天前,我了解到I2C導線不能超過6英寸左右,否則您可能會遇到傳輸問題。 **(引用自莊翔竣學長所寫的筆記<<TXB0108問題整理1100113>>)** ::: 並且同時期同學在SPI模組中使用TXB也產生了SPI通訊內容錯誤問題,因此最終版本中決定使用TXS當作ASABUS中的level shifter。 ![](https://i.imgur.com/dtkcKFt.png) ![](https://i.imgur.com/NAckMs6.png) 除了**CS/SS**與UART的**TX/RX**設計較為不同外(會在稍後章節做詳細說明),其餘PIN與level shifter之間的設計邏輯為:![](https://i.imgur.com/3KAIFTG.png) ### ASA ID、Master/Slave Seclect >從V3開始主控晶片與PC端通訊橋梁由FT232更改為atmega16U4: [16U4介紹](https://hackmd.io/JiKtGbkESTKBPib_TXMB5A) 除了原先FT232的:UART與USB之間做轉換。16U4還掌控了開發版的狀態,如:Master/Slave、Prog/Run、ASA ID number。 M128 V3版本開始將開發版設計為"中性版",中性版的定義為串列通訊中Master/Slave身分的"中性",也就是說可以任意改變此開發版為Master或者是Slave。而所謂Master/Slave的表現可參考上面**16U4介紹**中的主/樸章節。 由於M4開發板的設計全由V3使用心得衍伸的,因此這邊又需要讀者先行了解V3開發板上出現的硬體問題:[V3板BUG](https://hackmd.io/jRp7tShyQa-jSVSTQ-VfOQ) #### SPI的Master/Slave狀態 SPI在Master/Slave區別在於CS/SS路徑 在**Master**模式下CS走線為: ![](https://i.imgur.com/hAi9MlJ.png) 在**Slave**模式下SS走線為: (16U4在接收到來自ASA BUS的SS訊號拉低後進入中斷,此時判讀ASA BUS上的`ASAID`是否與此板的`ASAID`相同,若相同才會將SS輸出至主控晶片) :::warning 如上一小節所述,ASA BUS漸漸沒在使用。此設計所產生的delay是否會造成問題尚未驗證! ::: ![](https://i.imgur.com/LH6sIWo.png) #### UART的Master/Slave狀態 除此之外,V3在UART Master/Slave設計與40 PIN JUMPER設計存在衝突(詳見下一小節40 PIN I/O中提到的[V3 主控電路](https://hackmd.io/oL1haDvjQHOjV1UI4NtWQw)):Jumper使用於UART上後會造成Slave模式下主板的TX連接到自己的RX上,RX連到自己的TX上。 在M4設計上以周邊硬體數量解決上述問題(詳細硬體分布於後續章節介紹),因此這部分走線設計與V3無差別。 ### 40 PIN I/O > 這塊PIN設計的淵源可參考[V3 主控電路](https://hackmd.io/oL1haDvjQHOjV1UI4NtWQw)中的Jumper章節,會有此設計基本上是由XXX的創意發想而來。 筆者在使用過後沒有感受到設計想解決的議題,反而還帶來許多使用上的不便,因此在M4這塊設計上不繼續延續這個傳統。 由V3使用上的悲慘體驗,歸納出M4在40PIN I/O的選定原則: - 常用硬體的相關PIN腳提供數量要多 - GPIO盡量做到編號連續 - 與ASA BUS硬體功能完全獨立 整理實驗室最可能觸及到的周邊有:**DAC、ADC、PWM、TIMER、SPI、TWI、UART**。 於是有了以下候選者: ![](https://i.imgur.com/8Jyw0R6.png) >**SERCOM**為此晶片特有的周邊硬體,他能在各種串列通訊模式間進行切換。 **TC、TCC**基本上同樣為Timer/Counter硬體,可為一般Timer使用,也可PWM使用。而**TCC**與**TC**不同之處為:**TCC**相較為**TC**有更高的精確度與自由度,規格書上**TCC**的全名為<Timer/Counter for motor Contor>。 以下為40 PIN I/O Port成品 ![](https://i.imgur.com/sDWcwF4.png) :::warning 跟ASA BUS設計不同,40 PIN I/O Port處不考慮與實驗室開發版相容問題,因此這塊不連接level shifter,使用者請注意小心。 ::: ## 其他區塊介紹 ### Ether > 從M3開始發展(? > 在大神carry出這個模組後一直被放置至今,M4版本也只是預先開好硬體空間,韌體還沒開發,走線沒測試過是否會有問題,待後人測試繼續改進。 ![](https://i.imgur.com/Ip6JPx3.png) ![](https://i.imgur.com/6wVANDZ.png) ### Clock > 請參考[MCU主控板基本電路](https://hackmd.io/8CfD7A1cTvm9Xl9kPnAM3w),或稱最小系統。 > ARM系列通常可以掛載兩個高速clock及一個低速clock,M4開發版為考量40PIN I/O完整性,只掛了一個高速clock。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully