1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,我现在正在开发一个在matlab/Simulink上开发的程序,嵌入在一个DSPIC上,并且我遇到了配置块“微芯片主控器”的配置问题。这个块来自微芯片库,其路径是下面的“MCHPB块集/系统配置”。它位于顶层系统中,是从这个块中选择的PIC的引用。我想能够从Simulink中设置PIC的内部看门狗。因为这个参数在这个块中是不可见的,所以我们已经使它在库的块中被启用和可见,从基本掩码编辑器(属性的“启用”和“可见”)在“掩码编辑器的“参数和对话框”选项卡中检查)。但是,当我在模型中使用这个块时,这在库之外没有任何效果。然后我注意到这个块的参数“目标”允许选择所使用的PIC,使用Matlab代码(回调)执行SIMULINK。在我们的例子中,被调用的代码是下面的“MCHPGMistar回调(GCBH,PICERF)”;然后根据所选择的目标修改该块的不同参数。该代码防止出现必要的参数来配置看门狗吗?如何从Simulink配置内部PIC看门狗?我想改变的参数是:{ PrimaMaqMatr.WdtPrimePrimaMatg,WdtPras-PrimaMang-FigiS.Prima配置FWDTENSorry,我没有设法附加文件来说明我所说的话。谢谢您的帮助。最好的问候,桑迪。
以上来自于百度翻译 以下为原文 Hi, I am currently working on a program developed on Matlab / Simulink, embedded on a dsPic and I encounter a problem of configuration of the configuration block 'MICROCHIP MASTER'. This block comes from the MICROCHIP library whose path is the following 'MCHP_Blockset / System Configuration'. It is located in the top-level system and it is from this block that the reference of the PIC used is selected. I want to be able to set the internal watchdog of our PIC from Simulink. Since this parameter is not visible in this block, we have already made it enable and visible in the block of the library from the base mask editor (properties 'Enable' and 'Visible' of this parameter checked in the 'Parameters & Dialog' tab of the mask editor). However, this has no effect outside of the library when I use the block in a model. I then noticed that the parameter 'Target' of this block which allows to select the PIC used, uses a Matlab code (Callback) that Simulink executes. In our case, the called code is the following 'MCHP_Master_Callback (gcbh,' PICREF ');'. The different parameters of this block are then modified according to the chosen target. Does this code prevent the appearance of the necessary parameters to configure the watchdog? How can I configure the internal PIC watchdog from Simulink? The parameters I want to change are: #pragma config WDTPRE #pragma config WDTPOST #pragma config WINDIS #pragma config FWDTEN Sorry, I didn't manage to attach files to illustrate what I say. Thank you in advance for your help. Best Regards, Sandy.T Attached Image(s) |
|
相关推荐
3个回答
|
|
嗨,桑迪,隐藏的参数不应该被看到或修改。看门狗选项是隐藏的;块集不处理这个选项。但是,如果你想强制看门狗,这里是解决方法:1)选择主块,并在Matlab提示符下键入:StIGPARAM(GCBH,FWDTEN),“启用”)W将启用看门狗定时器,并从生成的代码中删除行{PrimePrimeCopgfFWDTEN= OFF。(默认选项不生成代码)2)进入模型配置参数= & gt;自定义代码= & gt;在生成的= & gt;源文件中插入自定义C代码,并键入要为你的看门狗设置的γ-语用设置。记住在模型中重置你的监视狗。您可以使用C函数调用块来实现这一点。鲁宾
以上来自于百度翻译 以下为原文 Hi Sandy, Hidden parameters are not supposed to be seen nor modified... Watch Dog options are hidden ; the blockset does not handle this option. However, if you want to force Watch Dog, here is the workaround: 1) select the Master block, and type at matlab prompt: set_param(gcbh,'FWDTEN','Enable') This will enable the Watch Dog timer, and remove the line #pragme config FWDTEN = OFF from the generated code. (default options does not generate code) 2) Go to Model Configuration Parameters => Custom Code => Insert custom C code in generated => Source File and type the #pragma setting you want for your Watch Dog. Do remember to reset your Watch Dog in your model. You might use the C function Call block to do so. Lubin |
|
|
|
嗨,鲁宾,谢谢你的快速回复。我有一些困难,所以我通过同事的帐户“SICRCO”,但后来我也做了我自己的帐户。我不能附上文件来说明我所说的话,但最终看来是正确的。因此,请不要考虑我自己的帖子要求。无论如何,我感谢你的解决方案。它对我帮助很大。我一测试就给你回信。再次感谢你。桑迪,请致以最诚挚的问候。
以上来自于百度翻译 以下为原文 Hi Lubin, Thank you for your quick response. I had some difficulties to post so I did it via a colleague's account 'scricco' but afterwards I also did it with my own account. I could not attach the files to illustrate what I say but finally it seems to work. Therefore, please don't take it into account my own request to post. Anyway, I thank you for your solution. It helps me a lot. I will give you a return as soon as I have tested it. Thank you again. Best Regards, Sandy.T |
|
|
|
嗨,鲁宾,我已经测试了你的解决方法,而且效果很好。所以再次感谢你。最好的问候,桑迪。
以上来自于百度翻译 以下为原文 Hi Lubin, I have tested your workaround and it works perfectly. So thank you again. Best Regards, Sandy.T |
|
|
|
只有小组成员才能发言,加入小组>>
5242 浏览 9 评论
2031 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3207 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2256 浏览 5 评论
778浏览 1评论
668浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
595浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
677浏览 0评论
576浏览 0评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 15:14 , Processed in 1.420012 second(s), Total 80, Slave 64 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号