Vấn đề Fail-Safe Clock Monitor (FSCM) trong DsPic
trong Datasheet có nói:
The Fail-Safe Clock Monitor (FSCM) allows the device to continue to operate even in the event of an oscillator failure. The FSCM function is enabled by programming. If the FSCM function is enabled, the LPRC internal oscillator runs at all times (except during Sleep mode) and is not subject to control by the Watchdog Timer. In the event of an oscillator failure, the FSCM generates a clock failure trap event and switches the system clock over to the FRC oscillator. Tôi thiết lập FCKSM<1:0> Configuration bit is 00 // có khả năng giám sát và Chuyển Clock. và lúc bật nguồn tôi dùng bộ dao động FRC oscillator. sau đó tôi dùng các lệnh trong thanh ghi OSCCON để chuyển sang Primary (XT) oscillator với không PLL, và đã chuyển thành công, trong lúc đang chạy tôi tháo bỏ thạch anh ra, thì đáng lẽ ra nó vẫn tiếp tục chạy vì Fail-Safe Clock Monitor sẽ tự động chuyển sang FRC oscillator, nhưng nó lại dừng chương trình, vậy nguyên nhân do đâu xin anh em trả lời giúp |
Trích:
Code:
void __attribute__((interrupt, no_auto_psv)) _OscillatorFail(void) |
tôi thấy trong datasheet nó đâu có nhắc gì về cờ OSCFAIL đâu mình không xóa nó thì chương trình cũng chạy mà.
The FSCM monitors the system clock. If it does not detect a system clock within a specific period of time (typically 2 ms, maximum 4 ms), it generates a clock failure trap and switches the system clock to the FRC oscillator. The user application then has the option to either attempt to clock to the FRC oscillator. The user application then has the option to either attempt to restart the oscillator or execute a controlled shutdown. À mà cho hỏi ý của câu này là gì vậy: The user application then has the option to either attempt to restart the oscillator or execute a controlled shutdown. nó kêu hoặc là cố gắng khỏi động lại bộ dao động hoặc điều khiển quá trình shutdown, tức là mình không thể cho chương trình tiếp tục chạy à. |
Trích:
|
Múi giờ GMT. Hiện tại là 05:08 AM. |
Tên diễn đàn: vBulletin Version 3.8.11
Được sáng lập bởi Đoàn Hiệp.
Copyright © PIC Vietnam