完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我正在利用PIC24FJ256GB406的DAC来转换我从加速度计接收的数据,并且我用示波器看到输出的信号。问题是,只有在高于确定电压的情况下,数据才正确地显示在示波器上。我的意思是,如果我做一个for循环,在DAC1DATA寄存器中写入0到1023的所有数字,我只能在示波器上看到一半的类锯齿信号。我想在示波器上发布一个信号的图像,让我写的东西更容易应付,但是论坛给了我一个错误(你没有权限访问我每次上传图像的时候。有人能帮我吗?我对我的英语感到抱歉,如果我漏掉了一些重要的东西(这是我的第一个DAC项目),所以请友好地告诉我,如果你需要一些其他的信息。谢谢。
以上来自于百度翻译 以下为原文 Hi, I am utilizing the DAC of the PIC24FJ256GB406 to convert the data that I receive from an accelerometer and I am using an oscilloscope to see the outputted signal. The problem is that the data are correctly showed on the oscilloscope only if higher than a determined voltage. What I mean is that if I make a for-loop where I write in the DAC1DAT register all the digits from 0 to 1023, I see on the oscilloscope only half of the saw-like signal. I wanted to post an image of the signal from the oscilloscope to make what I wrote more comprhensible but the forum gives me an error (You don't have permission to access everytime I try to upload an image. Can someone help me about it? I am sorry for my english and if I have left out something important (it's my first DAC project), so please be kind and tell me if you need some other information. Thank you Attached Image(s) |
|
相关推荐
9个回答
|
|
你能张贴你的代码(包括配置设置)吗?图像上的Y轴尺度是什么?“零”和最大电压在哪里?苏珊
以上来自于百度翻译 以下为原文 Can you please post your code (including the config settings)? Also what is the Y-axis scale on the image? Where is 'zero' and the maximum voltage? Susan |
|
|
|
我为端口定义了一个名称,定义了AxeldDac(LATGBET.LATG9),我设置了DAC寄存器和端口(如Microchip DAC数据表中所解释的)AccelyDAC=1;DelayMs(2000);DAC1CONBITS。DACRFF=0B10;DAC1CONBITS。DACFM=0;DAC1CONBITS。DACOE=1;DAC1CONBITS。DACEN=1;DelayMs(500);int B=0;这是我的主要循环:当(1){DAC1DAT= B;DelayMS(2);B++;如果(b & gt;1023)b=0;} i图像是自解释的,y轴中的0开始在紫色'3’旗子所在位置,伏特尺度为500 mV,因此最大电压为~3,5V。
以上来自于百度翻译 以下为原文 I define a name for the port #define ACCEL_DAC (LATGbits.LATG9) I set-up the DAC registers and the port (as explained in the Microchip DAC datasheet) ACCEL_DAC = 1; delayMs(2000); DAC1CONbits.DACREF = 0b10; DAC1CONbits.DACFM = 0; DAC1CONbits.DACOE = 1; DAC1CONbits.DACEN = 1; delayMs(500); int b = 0; This is my main loop: while(1){ DAC1DAT = b; delayMs(2); b++; if (b > 1023) b= 0; } I tought the image was self explanatory, the 0 in the Y-axis starts where the violet '3' flag is positioned, the Volt-scale is 500 mV so the maximum voltage is ~3,5V. |
|
|
|
你能检查AVDD引脚是否牢固地连接到VDD,并且所有其他需要的连接都适合于芯片?此外,你不需要玩LAT位-这是TrIS位,必须说明文件必须设置。苏珊
以上来自于百度翻译 以下为原文 Can you check that the AVdd pin is firmly connected to Vdd and that all other required connections are in place for the chip? Also you don't need to play with the LAT bits - it is the TRIS bits that the documentation says must be set. Susan |
|
|
|
“CinziaGWhat”是指配置吗?PIC配置?(他们相当长)AusieI检查了VDD引脚、GND引脚和所有其他引脚,它们都被牢固地焊接。TIS位和闩锁位不应该将端口设置为I/O,所以如果我没有错的话,结果应该是相同的。为了精简,我会用TrIS位来设置端口。
以上来自于百度翻译 以下为原文 @CinziaG What do you mean with CONFIGs? The PIC configs? (they are pretty long) @Aussie I checked the vdd pins, the GND pins and all the other pins and they are soldered firmly. TRIS bits and LATCH bits shouldn't make a difference for setting the port as I/O, the result should be the same if I am not wrong. To be scrupolous I will use the TRIS bits to set the port. |
|
|
|
|
|
|
|
|
|
|
|
不久前,我不得不为一个PIC24FJ256GB410上的DAC工作,我也遇到了同样的问题。如果我没记错的话,你需要通过TIS和ANS寄存器把DAC相关的PIN放在一个特殊的配置中。
以上来自于百度翻译 以下为原文 Not long ago, I had to work on a dac for a PIC24FJ256GB410 and I had the same problem. If I remember correctly you need to put the Dac associated pin in a special configuration via TRIS and ANS register. |
|
|
|
我问AVdd pin.SusanAVss更可疑?
以上来自于百度翻译 以下为原文 I asked about the AVdd pin. Susan AVss more suspect? |
|
|
|
您好,CescoGar sanI与PIC24FJ256GA406有相同的DAC输出问题。因此,DAC的配置设置是错误的。在使用DAC的情况下,它必须是ANSX=1,TrISX=1的条件。但是MCC生成的配置设置文件是错误的,ANSX=1,TrISx=0。
以上来自于百度翻译 以下为原文 Hello,CescoGar-san I have had same DAC output problem as yours for PIC24FJ256GA406. As a result, the configulation setting for DAC is wrong. It must be the configulation with ANSx=1, TRISx=1 in the case of using DAC. But the configulation setting files generated by MCC is wrong with ANSx=1, TRISx=0. |
|
|
|
只有小组成员才能发言,加入小组>>
5153 浏览 9 评论
1995 浏览 8 评论
1924 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3167 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2221 浏览 5 评论
719浏览 1评论
604浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
489浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
618浏览 0评论
517浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-16 23:35 , Processed in 1.280737 second(s), Total 95, Slave 78 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号