Dalaoer
      • 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

      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.
      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
    • Engagement control
    • 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 Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control 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

    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.
    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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    [TOC] # 背景知識 - [微處理器基礎](https://hackmd.io/6Rj1vNC5S2ya2y2MNScFbg) - **C與嵌入式C** - 針對輸出入來說,一般**C語言**程式通常與特定硬件無關,並且可以在不同的平台上進行編譯和執行。**嵌入式C**則高度依賴於特定硬體,需要直接訪問和控制硬體資源(如I/O端口、計時器、中斷等),因此嵌入式C通常是針對特定的處理器或微控制器編寫的。 - 對於大型運算或受限硬體,嵌入式C需注意記憶體資源或時鐘限制等需求 - 微處理器常需要處理硬件中斷或實時性問題,必須確保程式能夠快速響應硬體事件並且在預定時間內完成任務,因此有時要盡量避免阻塞型寫法或避免使用可能卡住的while迴圈 - 嵌入式C一些常見但你可能不熟的關鍵詞 - [const, static, extern, volatile.........](https://hackmd.io/@ITTfbB0ERYiVmzZhsSs2uw/rkzjHE7MF) - [**基礎控制原理**](https://hackmd.io/uVwsvbctTvyy-59kZsJwLQ) - [**直流有刷馬達原理**](https://youtu.be/-GlYAJTQxRE) - **驅動器** - [驅動器](https://hackmd.io/ahwAnss7RhOiV-Dmt7td_A) - 雖然DC馬達接上正負電源就能做動,但通常微處理器的輸出電流都有限制,除了特小的馬達外幾乎無法驅動,而且直接用接腳接上馬達也有其他問題。試著問問chat哥 : - 為什麼需要馬達驅動器 - 直接用微處理器接馬達正負端有什麼風險 - DC馬達最常見的驅動電路是[H橋電路](https://techweb.rohm.com.tw/product/motor/brushed-motor/brushed-motor-basic/260/) # STM簡介 - [初識STM32](https://ithelp.ithome.com.tw/articles/10264112) - 新訓使用**STM32F407VG**開發板,相關資訊手冊可見FTP - 需注意硬體資訊 - <font color="red">STM32工作電壓為3.3V</font> - 一般拿電表量輸出腳位高電平為3V左右,而有些腳位做為input則是 5V tolerance的,使用上需注意 # 開發方式 ## 軟體介紹 - 教學使用CubeMX、Keil、STMstudio做開發,網路上也有使用其他軟體做 - **CubeMX**圖形化介面可以方便的設定晶片暫存器成指定功能或模式,最後可生成一份含有這些設定的程式碼草稿方便編輯。 - **Keil**主要用於編譯與燒錄,同時也有debug功能能在運行時監測數據 - 在keil中使用debug模式監看全域變數時,若在watch window中,變數的Type顯示uchar,數值無法顯示時,可以嘗試: 1.在main函數中,while迴圈之前,再對變數賦質。 2.將option for target中 C/C++ 欄位的優化選項改成disable。 - **STMstudio**主要用於運行時監測數據 - 使用方法見PPT ## STM 程式庫 - [HAL與LL](https://www.yahboom.com/public/upload/upload-html/1701740148/HAL%E5%BA%93%E5%92%8CLL%E5%BA%93%E4%BB%8B%E7%BB%8D.html) - 實驗室目前使用HAL庫開發,查找資料須注意 ## HAL庫與功能使用 - 以下教學多有查找 Library 部分,對於Library在功能實現上會更有感覺,看過即可不必較真 ### [以LED實例看GPIO與HAL庫](https://hackmd.io/Qt0iS497R3SHwmm_C4xTaA?both) ### [STM的NVIC與GPIO外部中斷](https://hackmd.io/tGaNgWrpTeOGctcVgKFdWA) ### [stm的時鐘樹與總線](https://hackmd.io/CjAqkyoISyy1WQEHbDXYyg) ### [stm的timer與timer中斷](https://hackmd.io/wYWiJ8uUTzaSe_S_LzIykQ?both) ### [stm的高級timer和pwm輸出](https://hackmd.io/TxKDANhpTLCuXCzVzh-R2g) ### [stm的QEP](https://hackmd.io/yXilh4vxT_iCwBD1UJcV5w) ### [stm的ADC](https://hackmd.io/HQB1gfhWQQKIBUjwuMMqng) # 新訓馬達控制 - [新訓馬達控制](https://hackmd.io/cB_Dh7OTQKOQlXPTXn6mNw#%E6%96%B0%E8%A8%93%E9%A0%85%E7%9B%AE)

    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

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    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