PIC18, MPLAB X IDE, XC8, ADC, rotation_sensor
4MHz frequency 사용
- Clock : Fosc/4
- AN0 : adc port
- 10bit value
0. 참고 사항
- https://www.waveshare.com/wiki/Open18F4520
- [ ] https://www.microchip.com/wwwproducts/en/PIC18F4520
- [ datasheet ] http://ww1.microchip.com/downloads/en/devicedoc/39631a.pdf
1. HW 연결
2. 소스 설명
full 소스는 아래 github를 통해 확인하세요.
ADCON2 = 0x14; // ADFM ? ACQT2 ACQT1 ACQT0 ADCS2 ADCS1 ADCS0 |
3. 소스
4. 결과
'PIC18' 카테고리의 다른 글
PIC18, MPLAB X IDE, XC8, LCD1602, 8bit mode (0) | 2018.09.17 |
---|---|
PIC18, MPLAB X IDE, XC8, CCP1, infrared (IR) (0) | 2018.09.16 |
PIC18, MPLAB X IDE, XC8, SPI, at45dbxx data flash (0) | 2018.09.13 |
PIC18, MPLAB X IDE, XC8, I2C, pcf8563 (0) | 2018.09.13 |
PIC18, MPLAB X IDE, XC8, PWM, buzzer (0) | 2018.09.13 |