完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
嗨,我是MPLABX XC8编译器的新手,正在使用PIC16F1777设备。我想测试DAC输出(分别是RC0、RE1、RA5、RA2到1.8、2.2、2.5、3.0V)。我不知道该怎么做。请任何人指导我。感谢Vi.a
以上来自于百度翻译 以下为原文 Hi, I'm new to MPLABX XC8 compiler and i'm working with PIC16F1777 device. I want to test DAC outputs (RC0, RE1, RA5, RA2 to 1.8, 2.2, 2.5, 3.0V respectively) I don't have any idea about how to do this. Please can anyone guide me.. Thanks Vidisha |
|
相关推荐
3个回答
|
|
设置DAC并将值写入寄存器。这甚至不需要任何软件——使用ICD或PICkit。只需通过该工具编写寄存器并监视结果。(但是,当涉及到性能评估时,您必须编写一些软件。切换寄存器值0 /0x3FF RESP。0/0x1f)。其他模式可能适用于特定任务。希望这有助于继续进行。
以上来自于百度翻译 以下为原文 Set up the DAC(s) and write values to the register. This can be even done without any software - using an ICD or a PICkit. Just write the registers via the tool and monitor the results. (Though, when it comes to performance evaluation, you will have to write some software. Eg. toggling the register values 0 / 0x3FF resp. 0 / 0x1F). Other patterns might apply for specific tasks. Hope this helps to proceed |
|
|
|
我希望你不打算在DAC输出上加上一个负载。当前的驱动是不存在的。DAC输出1,2,5,6(10位)将需要由运算放大器缓冲,以获得可用的读数。当用作内部比较器参考时,将是很好的。
以上来自于百度翻译 以下为原文 I hope you are not planning to put a load on the DAC outputs. Current drive is nonexistent. DAC outputs 1,2,5,6 (10 bit) will need to be buffered by the op amps to get a usable reading. The will be fine when used as internal comparator references. |
|
|
|
嗨,我写了下面的代码,但仍然没有得到任何引脚上的电压,WATS错误?
以上来自于百度翻译 以下为原文 Hi, i wrote the following code, but still not getting the voltage on any pins, wats the mistake? /* * File: Using DACs of PIC16F1777 * Author: vids * * Created on October 19, 2016, 5:08 PM */ #define _XTAL_FREQ 8000000 #include // CONFIG1 #pragma config FOSC = INTOSC // Oscillator Selection Bits (INTOSC oscillator: I/O function on CLKIN pin) #pragma config WDTE = OFF // Watchdog Timer Enable (WDT disabled) #pragma config PWRTE = OFF // Power-up Timer Enable (PWRT disabled) #pragma config MCLRE = ON // MCLR Pin Function Select (MCLR/VPP pin function is MCLR) #pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled) #pragma config BOREN = ON // Brown-out Reset Enable (Brown-out Reset enabled) #pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin) #pragma config IESO = ON // Internal/External Switchover Mode (Internal/External Switchover Mode is enabled) #pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is enabled) // CONFIG2 #pragma config WRT = OFF // Flash Memory Self-Write Protection (Write protection off) #pragma config PPS1WAY = ON // Peripheral Pin Select one-way control (The PPSLOCK bit cannot be cleared once it is set by software) #pragma config ZCD = OFF // Zero-cross detect disable (Zero-cross detect circuit is disabled at POR) #pragma config PLLEN = ON // Phase Lock Loop enable (4x PLL is always enabled) #pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will cause a Reset) #pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), low trip point selected.) #pragma config LPBOR = OFF // Low-Power Brown Out Reset (Low-Power BOR is disabled) #pragma config LVP = ON // Low-Voltage Programming Enable (Low-voltage programming enabled) void main(void) { OSCCON = 0b11110010; TRISA = 0x00; TRISC = 0x00; TRISD = 0x00; TRISE = 0x00; ANSELA = 0x00; ANSELB = 0x00; ANSELC = 0x00; ANSELD = 0x00; ANSELE = 0x00; DAC1CON0 = 0b10100000; DAC2CON0 = 0b10100000; DAC5CON0 = 0b10100000; DAC6CON0 = 0b10100000; DAC1REFL = 0xFF; DAC1REFH = 0x01; DAC2REFL = 0x66; DAC2REFH = 0x02; DAC5REFL = 0x70; DAC5REFH = 0x01; DAC6REFL = 0xC2; DAC6REFH = 0x01; DACLD = 0x00; while(1){ RD4 = 1; __delay_ms(5000); // 1 Second Delay RD4 = 0; __delay_ms(5000); // 1 Second Delay } } |
|
|
|
只有小组成员才能发言,加入小组>>
5212 浏览 9 评论
2019 浏览 8 评论
1944 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3192 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2246 浏览 5 评论
760浏览 1评论
647浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
567浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
659浏览 0评论
557浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-12 10:33 , Processed in 1.800910 second(s), Total 79, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号