完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
亲爱的社区,我想阅读时间和日历与PIC32 MZ2048 EFM144从外部RTC时钟的32.76kHz与MPLAB和谐。我可以设置日历的默认值(例如170101= 2017年1月1日和000000=00小时00分钟),但是当我运行程序时,RTCC寄存器(RTCtime)从不更新。我发现RTCLKON状态位永远不会设置为1,所以我相信这就是为什么它不运行的原因。当我选择MPLAB和谐中的LPRC时钟时,RTCTIME更新正确(即使RTCLKON状态仍然是0,这是正确的,根据数据表DS61125F)。我不能发现任何错误与我的外部时钟设置;有什么想法?在我的应用程序中,我使用命令:DrviRTCccSistar();/ /启动RTCpAppDATA RTCCTIMECT= DRVYRTTCCY TimeGET();
以上来自于百度翻译 以下为原文 Dear community, I want to read time and calendar with a PIC32MZ2048EFM144 from an external RTC clock of 32.76KHz with MPLAB HARMony. I can set up the default values for the calendar (e.g.170101 = Jan 1st, 2017 and 000000 = 00hr 00min 00sec), but when I run the program, the RTCC registers (RTCTIME) never update. I found that the RTCCLKON status bit is never set to 1, so I believe this is the reason why it is not running. When I select the LPRC clock in MPLAB Harmony, the RTCTIME updates correctly (even though the RTCCLKON status is still 0, and this is correct according to the datasheet DS61125F). I can't find anything wrong with my external clock settings; any idea? My drv_rtcc_static.c initialization: void DRV_RTCC_Initialize(void) { PLIB_DEVCON_SystemUnlock(DEVCON_ID_0); /* Unlock System */ /* Initialize RTCC */ PLIB_RTCC_WriteEnable(RTCC_ID_0); /* Enable writes to RTCC */ PLIB_RTCC_Disable(RTCC_ID_0); /* Disable clock to RTCC */ while (PLIB_RTCC_ClockRunningStatus(RTCC_ID_0)); /*Check if clock is disabled */ PLIB_RTCC_RTCTimeSet(RTCC_ID_0, 0x00000000); /* Set RTCC time */ PLIB_RTCC_RTCDateSet(RTCC_ID_0, 0x17010100); /* Set RTCC date */ PLIB_RTCC_AlarmDisable(RTCC_ID_0); /* Disable alarm */ while (PLIB_RTCC_AlarmSyncStatusGet(RTCC_ID_0)); /* Wait for disable */ PLIB_RTCC_AlarmTimeSet(RTCC_ID_0, 0x00000500); /* Set RTCC alarm time */ PLIB_RTCC_AlarmDateSet(RTCC_ID_0, 0x00010100); /* Set RTCC alarm date */ PLIB_RTCC_AlarmMaskModeSelect(RTCC_ID_0, RTCC_ALARM_ONCE_A_DAY); /* Set RTCC alarm mode */ PLIB_RTCC_ClockSourceSelect(RTCC_ID_0,RTCC_CLOCK_SOURCE_SOSC); /* Set RTCC clock source (LPRC/SOSC) */ } In my application, I use the commands: DRV_RTCC_Start(); // to start the RTCC appData.RTCCtime = DRV_RTCC_TimeGet(); |
|
相关推荐
16个回答
|
|
第一个想法是SOSC是否已经启用,不管它是否被外部时钟驱动。
以上来自于百度翻译 以下为原文 The first thought is whether the SOSC has been enabled, whether it is driven by an external clock or not. |
|
|
|
|
|
|
|
从勘误表的问题仍然在A3的PIC32 MZ-EF!外部RTC是:
以上来自于百度翻译 以下为原文 From Errata the issue still in A3 for PIC32MZ-EF! External RTC it is then :/ |
|
|
|
你是使用外部RTCC和外部时钟还是仅仅使用外部时钟与内部RTCC?
以上来自于百度翻译 以下为原文 Are you using the external RTCC and external clock or just using external clock with internal RTCC? |
|
|
|
有没有人试图在MZ上从LPRC运行RTC?我(也许相当愚蠢)改变了我们最近的设计从PIC32 MX到MZ,并已经放弃了二次振荡器XTAL,因为我现在使用一个12MHz的XTAL用于主振荡器获得USB工作,因为USB不能从FRC上的MXWAR时钟,我设法得到一个稳定的RTC与LPRC?我们制作的每一块板都需要调整吗?我现在有点担心,因为一些新的董事会迫在眉睫:
以上来自于百度翻译 以下为原文 Has anyone tried to run the RTC from the LPRC on the MZ? I have (perhaps rather foolishly) changed our design recently from a PIC32MX to an MZ and have dropped the secondary oscillator xtal as I'm now using a 12MHz xtal for the primary oscillator to get the USB working as USB couldn't clocked from FRC on the MX Will I manage to get a stable RTC with the LPRC? Will it need tuning for each board we make? I'm kinda worried about this now with some new boards due in imminently :/ |
|
|
|
如果你只需要+/-2HRS/天的精度,你就可以了。否则你就是索尔。
以上来自于百度翻译 以下为原文 If you only need an accuracy of +/-2hrs/day you should be OK. Otherwise you're SOL. |
|
|
|
遗憾的是,用附加的XTAL的第二振荡器错误来劫持线程并不能实际工作,如何让内部RTC有一个准确的时钟?应用32 kHz时钟的工作方式似乎有点模糊,任何人都有实际的解决方案的经验吗?谢谢
以上来自于百度翻译 以下为原文 Sorry to hijack thread So with the secondary oscillator errata of attaching an XTAL won't actually work, how does one go about getting the internal RTC to have an accurate clock? The workaround of applying a 32kHz clock anyway seems a bit vague, anyone have experience of practical solutions for this? Thanks |
|
|
|
使用外部的32 K振荡器,或者来自外部RTCC的FUT。我使用外部RTCC,因为它提供:VBat用于电池备份(在当前PIC32上没有提供或没有功能)。模拟频率修整。在启动时,我更新PIC RTCC,然后使用它对所有后续读取由于较高。访问速度,不必超过I2C。只要您只使用外部RTCC上的模拟修剪,而不是数字(因为这不会影响许多RTCC上的FUT FRQQ),PIC RTCC将保持完美的时间WRT外部RTCC。
以上来自于百度翻译 以下为原文 Use an external 32k oscillator, or the FOut from an external RTCC. I use an external RTCC, as it provides:- VBat for battery backup (not provided or not functional on current PIC32's). Analogue frequency trimming. I update the PIC RTCC on startup, then use it for all subsequent reads due to the higher access speed, not having to go out over I2C. As long as you only use the analogue trim on the external RTCC, not the digital (as this will not affect the FOut freq. on many RTCC's), the PIC RTCC will keep perfect time wrt the external RTCC. |
|
|
|
谢谢西蒙,你使用什么外部RTC?我需要找到一个POSC的外部时钟,因为我需要USB工作(它不能从FRC时钟)。有什么想法吗?我已经看到了一个应用笔记从LT开始从比较器电路,但温度稳定性可能是一个问题!
以上来自于百度翻译 以下为原文 Thanks Simon What external RTC do you use? I'm going to need to find an external clock for the POSC as I need USB to work (it can't be clocked from the FRC). Any ideas? I've seen an app note from LT which starts off with a comparator circuit, but temperature stability can be an issue! |
|
|
|
RTC -通常Intersil ISL1220(MSOP)或ISL120 22(SOIC),这取决于我的尺寸/精度要求。对于POSC,我使用MEMS振荡器,目前硅实验室501系列,但他们不推荐用于新的设计。另一种是SL 511系列,或新的微芯片范围,取决于成本。
以上来自于百度翻译 以下为原文 RTC - usually Intersil ISL1220 (MSOP) or ISL12022 (SOIC), depending on my size/accuracy requirements. For the POSC I use a MEMS oscillator, currently Silicon Labs 501 series, but they are not recommended for new designs. Alternative is SL 511 series, or the new Microchip range, depending on cost. |
|
|
|
好,很好。有一件事很奇怪,只要在周围搜索一下,就可以看到32 KHz振荡器的电流很轻,0.9UA,但是12MHz的是4mA左右。差别很大。它不应该是太多的问题,因为当我想把它准备就绪的时候,我可以切换到FRC,并立即把它计时。
以上来自于百度翻译 以下为原文 Ok, great. One thing that's odd, just having a search around it seems that the current draw for the 32kHz oscillator is very light, 0.9uA but the 12MHz one is around 4mA! Quite a big difference. It shouldn't be too much of a problem as when I want to put the uP to standby I can switch over to the FRC and clock it right down. |
|
|
|
功率秤的速度,这占了大部分的差异。32 kHz振荡器也将优化功耗,占其余。
以上来自于百度翻译 以下为原文 Power scales with speed, which accounts for most of the difference. The 32kHz oscillator would also be optimised for power consumption, which accounts for the rest. |
|
|
|
在这种情况下,别忘了把振荡器EN引脚连接到GPIO,这样当你在FRC上时,你就可以禁用它。
以上来自于百度翻译 以下为原文 In that case, don't forget to connect the oscillator EN pin to a GPIO, so you can disable it when you are on FRC. |
|
|
|
在这种情况下,不要忘记将振荡器EN引脚连接到GPIO,所以当你在FRC上时,你可以禁用它。是的,我有一个GPIO开关,用于显示/蓝牙模块等的一些调节器,所以我会把EN连接到这个,谢谢你的帮助!
以上来自于百度翻译 以下为原文 In that case, don't forget to connect the oscillator EN pin to a GPIO, so you can disable it when you are on FRC. Yes I have a GPIO that switches on a few regulators for the display/bluetooth module etc so I'll tie the EN to that thanks for your help! |
|
|
|
嗨,我正在更新我的设计。勘误表说,通过将时钟应用到SoSCo引脚并在FECFCG1中设置FSCOSEN位为0,则使用外部时钟作为辅助振荡器。有人尝试过这个吗?只是想确认之前,我敢打赌房子IITT实际上违背了第42章中的(PIC32扩展的振荡器)PIC32手册:
以上来自于百度翻译 以下为原文 Hi again, I'm updating my design. The errata says to use an external clock for the secondary oscillator by applying the clock to the SOSCO pin and setting FSOSCEN bit to 0 in DEVCFG1. Has anyone tried this? Just wanted to confirm before I bet the house on it It actually goes against what is in chapter 42 (Oscillators with Extended PLL) of the PIC32 manual: |
|
|
|
对。我已经使用外部RTC FUT驱动SOSCO/T1CKI(引脚73在100PIN)(*不SCOSIM*)上的几个项目,并使用SCOSCI作为GPIO,与FSOSCEN = OFF。
以上来自于百度翻译 以下为原文 Yes. I have used an external RTC Fout driving SOSCO/T1CKI (pin 73 on 100pin) (*NOT SOSCI*) on a couple of projects, and used SOSCI as GPIO, with FSOSCEN=OFF. |
|
|
|
只有小组成员才能发言,加入小组>>
5170 浏览 9 评论
2001 浏览 8 评论
1931 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3176 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2228 浏览 5 评论
737浏览 1评论
622浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
509浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
635浏览 0评论
531浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 19:12 , Processed in 1.552929 second(s), Total 110, Slave 92 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号