Recent Posts

Pages: [1] 2 3 ... 10
1
ARM Processors / Re: 28 USB on-the-go full-speed (OTG_FS)
« Last post by tha on March 31, 2023, 10:51:30 am »
Suspended state

The OTG_FS peripheral ตรวจสอบกิจกรรม USB อย่างต่อเนื่อง. หลังจากการนับ 3 ms of USB idleness, the early suspend interrupt (ESUSP bit ใน OTG_FS_GINTSTS) จะถูกปล่อยออก, และยืนยัน 3 ms ต่อมา, ถ้าเหมาะสม, โดย the suspend interrupt (USBSUSP bit ใน OTG_FS_GINTSTS). จากนั้น The device suspend bit จะถูกเซ็ตโดยอัตโนมัติใน the device status register (SUSPSTS bit in OTG_FS_DSTS) และ the OTG_FS เข้าสู่ the suspended state.

The suspended state อาจมีทางเลือกถูกออกโดย the device ตัวมันเอง. ในกรณีนี้ the application เซ็ต the remote wakeup signaling bit ใน the device control register (RWUSIG bit ใน OTG_FS_DCTL) และเคลียร์มันหลังจาก 1 ถึง 15 ms.

เมื่อ a resume signaling ถูกตรวจพบจาก the host, the resume interrupt (WKUPINT bit ใน OTG_FS_GINTSTS) จะถูกสร้างและ the device suspend bit จะถูกเคลียร์โดยอัตโนมัติ.
2
ARM Processors / Re: 28 USB on-the-go full-speed (OTG_FS)
« Last post by tha on March 31, 2023, 10:02:52 am »
Default state

ใน the Default state the OTG_FS คาดว่าจะได้รับ a SET_ADDRESS command จาก the host. ไม่มี other USB operation สามารถเป็นไปได้. เมื่อ a valid SET_ADDRESS command ถูกถอดระหัสบน the USB, the application เขียน the corresponding number ลงใน the device address field ใน the device configuration register (DAD bit in OTG_FS_DCFG). จากนั้น The OTG_FS เข้าสู่ the address state และพร้อมที่จะตอบรับ host transactions ที่ theconfigured USB address.
3
ARM Processors / Re: 28 USB on-the-go full-speed (OTG_FS)
« Last post by tha on March 31, 2023, 09:37:42 am »
Soft disconnect

The powered state สามารถถูกออกโดย software ด้วย the soft disconnect feature. The DP pullup resistor จะถูกเอาออกโดยการเซ็ต the soft disconnect bit ใน the device control register (SDIS bit ใน OTG_FS_DCTL), เป็นเหตุให้ a device disconnect detection interrupt บน the host side ถึงแม้ว่า the USB cable ไม่ได้ถูกถอดออกจาก the host port จริงๆ.
4
ARM Processors / Re: SD card using SPI in STM32
« Last post by tha on March 31, 2023, 09:36:04 am »
คุณแอดมินช่วยลบออกด้วยก็ได้ครับ เคยแปลแล้วบทความนี้
5
ARM Processors / Re: 28 USB on-the-go full-speed (OTG_FS)
« Last post by tha on March 31, 2023, 09:14:58 am »
28.5.2 Peripheral states

Powered state

The VBUS input ตรวจพบ the B-Session valid voltage โดยที่ the USB peripheral ถูกอนุญาตให้เข้าสู่ the powered state (see USB2.0 par9.1). จากนั้น The OTG_FS จะเชื่อมต่อโดยอัตโนมัติ the DP pull-up resistor เพื่อให้สัญญาน full-speed device connection ไปยัง the host และสร้าง the session request interrupt (SRQINT bit ใน OTG_FS_GINTSTS) เพื่อแจ้งให้ทราบ the powered state.

The VBUS input ยังช่วยให้แน่ใจว่า valid VBUS levels ถูกจ่ายไฟโดย the host ในระหว่าง USB operations. ถ้าการลดลงของ VBUS ต่ำกว่า B-session valid ที่เกิดขึ้นถูกตรวจพบ (ตัวอย่างเช่นเนื่องจาก a power disturbance หรือ the host port ถูก switched off), the OTG_FS จะตัดการเชื่อมต่อโดยอัตโนมัติและ the session end detected (SEDET bit ใน OTG_FS_GOTGINT) interrupt จะถูกสร้างเพื่อแจ้งให้ทราบว่า the OTG_FS ได้ออกจาก the powered state แล้ว.

ใน the powered state, the OTG_FS คาดว่าจะได้รับ some reset signaling จาก the host. ไม่มี other USB operation สามารถเป็นได้. เมื่อ a reset signaling ถูกรับ the reset detected interrupt (USBRST in OTG_FS_GINTSTS) จะถูกสร้าง. เมื่อ the reset signaling เสร็จสมบูรณ์, the enumeration done interrupt (ENUMDNE bit in OTG_FS_GINTSTS) จะถูกสร้างและ the OTG_FS เข้าสู่ the Default state.
6
อบรม หลักสูตร การออกแบบPCB เบื้องต้น PADS 2005/2007จากผู้อบรมที่มีประสบการณ์ตรงจากการทำงานด้านออกแบบ PCB ด้วย PADS มากว่า 15 ปี ผู้เข้าอบรมจะได้รับความรู้ทั้งด้านการเขียน schematic และ ออกแบบ PCB รวมทั้งเทคนิคต่าง ๆ ในการออกแบบ PCB จนสามารถนำไปออกแบบ PCB ได้จริง สอนตัวต่อตัว ใช้เวลาสอน 3 วัน หลังจากอบรมไปแล้วไม่เข้าใจสามารถปรึกษาได้ตลอด อัตราค่าอบรม 4,000 บาท/ท่าน
 สนใจติดต่อ email : katt093@hotmail.com  ,http://www.facebook.com/Sriprai.PCBDesign

7
อบรม หลักสูตร การออกแบบPCB เบื้องต้น PADS 2005/2007จากผู้อบรมที่มีประสบการณ์ตรงจากการทำงานด้านออกแบบ PCB ด้วย PADS มากว่า 15 ปี ผู้เข้าอบรมจะได้รับความรู้ทั้งด้านการเขียน schematic และ ออกแบบ PCB รวมทั้งเทคนิคต่าง ๆ ในการออกแบบ PCB จนสามารถนำไปออกแบบ PCB ได้จริง สอนตัวต่อตัว ใช้เวลาสอน 3 วัน หลังจากอบรมไปแล้วไม่เข้าใจสามารถปรึกษาได้ตลอด อัตราค่าอบรม 4,000 บาท/ท่าน
 สนใจติดต่อ email : katt093@hotmail.com  ,http://www.facebook.com/Sriprai.PCBDesign

8
ARM Processors / SD card using SPI in STM32
« Last post by tha on March 28, 2023, 10:08:54 am »
https://controllerstech.com/sd-card-using-spi-in-stm32/

ขอแปลหน่อยนะครับ ขอขอบคุณเขามา ณ ที่นี้ด้วย ท่านใดพอจะมีทรัพย์ก็ Donate เขาด้วยนะ ฟังภาษาอังกฤษเขาในยูทูบก็ฟังง่ายดี(เปิดคำบรรยายด้วย)ครับ

                                                        SD card using SPI in STM32

คุณรู้อยู่แล้วว่าคุณกำลังมองหาอะไร และนั่นเป็นสาเหตุว่าทำไมคุณถึงมาที่นี่ ดังนั้นฉันจะไม่เสียเวลาของคุณกับความจริงที่ว่าการ์ด SD คืออะไร ? มันทำงานอย่างไรและทั้งหมดนี้ ..

ในบทช่วยสอนนี้ เราจะเชื่อมต่อการ์ด SD กับไมโครคอนโทรลเลอร์ stm32 โดยใช้โหมด SPI ฉันใช้คอนโทรลเลอร์ STM32F103C8 และขนาดการ์ด SD คือ 1 GB นอกจากนี้ เราจะดำเนินการจัดการไฟล์พื้นฐานบางอย่าง เช่น การสร้างไฟล์ การเขียน การอ่าน การลบ เป็นต้น

การดำเนินการขั้นสูงบางอย่าง เช่น การดำเนินการเกี่ยวกับไดเร็กทอรี จะกล่าวถึงในบทช่วยสอนอื่น ลองกระโดดลงไปหามันเลย

Reference: https://m.blog.naver.com/PostView.nhn?blogId=eziya76&logNo=221188701172&proxyReferer=https%3A%2F%2Fgithub.com%2Feziya%2FSTM32_SPI_SDCARD

UPDATE 1

The code ถูกอัฟเดตด้วย new libraries ขอบคณไปยัง

https://blog.naver.com/eziya76/221188701172    SPI สามารถทำงานได้สูงถึง 10 Mbps

ถ้าได้รับ FR_NOT_READY error, ใช้ some external 5V power source. Power จาก board ดูเหมือนจะไม่เพียงพอ (มันอาจเป็นกระแสไฟที่ต้องการสำหรับ the module)

เพื่อทราบ errors เหล่านี้, ใส่ a Breakpoint หลังจาก f_mount และดูค่าของ fresult.

UPDATE 2

หากคุณได้รับ FR_NO_FILESYSTEM (ส่วนใหญ่เกิดขึ้นกับ LOW storage cards), ให้ใช้ไลบรารีเก่าจาก https://controllerstech.com/wp-content/uploads/2020/07/SDCARD_SPI_OLD_F103.zip

เพื่อทราบ errors เหล่านี้, ใส่ a Breakpoint หลังจาก f_mount และดูค่าของ fresult.
9
ARM Processors / Re: STM32 Timers #9. One Pulse Mode
« Last post by tha on March 04, 2023, 02:35:49 pm »
                                                                                Additional Setting

Generating Multiple pulses

การกำหนดค่าข้างต้นจะสร้าง a single pulse ของการหน่วงเวลาและ pulse width ที่กำหนดไว้ล่วงหน้า. หากคุณต้องการสร้าง a pulse train บน a single trigger signal, คุณต้องเขียนค่าใน the Repetition counter. นี้ถูกแสดงไว้ด้านล่าง.



การกำหนดค่าส่วนที่เหลือยังคงเหมือนเดิม ฉันได้แก้ไข the Repetition counter value เป็น 5 (6-1) เท่านั้น การจัดเตรียมนี้จะสร้าง the 6 pulses ที่มีความกว้างเท่ากันเมื่อได้รับ a trigger signal บน the channel 2.
10
ARM Processors / Re: STM32 Timers #9. One Pulse Mode
« Last post by tha on March 04, 2023, 11:28:17 am »
Timer configuration

ฉันจะใช้ timer 1 สำหรับ application นี้. The setup ถูกแสดงข้างล่าง.



1.  The timer ต้องถูกกำหนดค่าใน the slave mode ด้วย trigger mode.
     •  ฉันได้เลือก the trigger source เป็น TI2FP2, คือ the channel 2 of the timer. ที่นี่เราจะเชื่อมต่อ the signal pin.
     •  The channel 1 จะถูกใช้สำหรับ the output compare. ที่นี่เราจะได้รับ the output จาก the timer.
2.  ตรวจสอบให้แน่ใจว่าได้เลือก the one pulse mode.
3.  The prescalar ที่ 90 จะทำให้ the clock ลดลงเป็น 1MHz. นี่คืออัตราที่ the counter นับและแต่ละนับจะใช้เวลา 1us.
     •  ฉันได้เซ็ต the ARR เป็น 50000, ดังนั้น the maximum width ของ the pulse จะเป็น 50ms.
     •  โปรดทราบว่า the Repetition counter ถูกเซ็ตเป็น 0, ซึ่งหมายความว่าเราต้องการเพียง a single pulse. หากคุณตั้งค่านี้เป็น 10
         (11-1), จะมี 11 pulses สำหรับแต่ละ trigger.
4.  The Mode ใน output compare จะถูกเปลี่ยนแปลงในภายหลังใน the code.
     •  The pulse value (the CCR1 value) ถูกเซ็ตเป็น 10000. นี่หมายความว่า the pulse จะถูกหน่วงเวลา 10000 counts, คือ
         10ms หลังจาก the trigger.

การกำหนดค่าข้างต้นจะสร้าง a pulse of 40ms (ARR – CCR) ในแต่ละ trigger บน channel 2 ของ the timer 1.

เราใช้ 2 channels สำหรับ the timer 1, ข้างล่างคือ the pinout สำหรับสิ่งเดียวกัน.



ที่นี่ the pin PA9 (TIM1_CH2) จะถูกใช้เป็น the input pin, ที่ที่เราจะส่ง the external signal. และ the pin PA8 (TIM1_CH1) จะถูกใช้เป็น the output pin, ที่ที่ the one pulse จะถูกสร้าง. เราจะมอนิเตอร์สิ่งนี้บน the oscilloscope.
Pages: [1] 2 3 ... 10