完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
大家好,最近,我们正在研究MCP2515 CAN总线监视器演示板。使用这个演示板的目的是将SPI格式数据转换为可以格式化数据。在开始之前,我们认为该板具有SPI输入并可以输出,这意味着该板可以自动转换数据。然而,我们发现在该板上通过SPI连接MCU(PIC18F450)和MCP2515。因此,我想知道是否有可能通过SPI头连接另一个板(具有SPI格式的数据输出)(请参阅吹图)。有了这个连接,我们希望可以使用MCU(Master)作为控制器,处理来自其他板(从机)的数据接收,并将数据转发到MCP2515(从机)到CAN总线数据。有人有这样做的经验吗?我很感激,如果你给我提供一些关于使用这个BARAD的信息!谢谢您!哦,另外,有必要购买PICtiT3或其他调试工具来闪动PIC18XXX设备,对吗?先谢谢,最好,X.W
以上来自于百度翻译 以下为原文 Hi all, Recently, we are investigating the MCP2515 CAN Bus Monitor Demo Board.The purpose of using this demo board is to convert SPI format data to CAN format data. Before getting started, we thought this board has a SPI input and CAN output, which means this board could convert the data automatically. However, we found that the MCU (PIC18F4550) and MCP2515 were connected through SPI on this board. Therefore, I want to know whether it's possible or not to connect another board (with SPI format data output) through the SPI header (See blow figure). With this connection, we hope we can use the MCU (master) as the controller, handling the the data receiving from the other board (slave), and forwarding the data to the MCP2515 (slave) to CAN bus data. Does anyone have the experience of doing this? I appreciate that if you provide me some information on using this borad! Thank you! Oh, in addition, it's necessary to buy the PICkit3 or other debugging tools to flash the PIC18XXX device, right? Thanks in advance. Best, X.W Attached Image(s) |
|
相关推荐
13个回答
|
|
|
你真的应该在你的图表上标出SPI信号。看起来你把所有的信号都连接到两个设备上。你需要单独的CS信号,每个设备都需要一个。其他三个(SCK,SDI,SDO)可以并行连接。是的,你需要一个PICTIT3或ICD3来编程和调试你的PIC。你必须使用PIC18F450吗?那是一种非常古老的装置。现在有新的、更好的、便宜的PIC18F设备。大多数将内置两个SPI外设。
以上来自于百度翻译 以下为原文 You really should have labelled the SPI signals on your diagram. It appears you are connecting all signals to both devices. You are going to need separate CS signals, one for each device. The other three (SCK, SDI, SDO), can be connected in parallel. Yes, you will need a PICkit3 or ICD3 to program and debug your PIC. Do you have to use a PIC18F4550? That is a very old device. There are newer, better, cheaper PIC18F devices available now. Most will have two SPI peripherals built in. |
|
|
|
|
|
你好,谢谢你的宝贵信息!我已经在图上标记了信号,使它更加清晰。我没有意识到主设备上有两个CS信号,应该有两个CS信号。然而,我发现PIC18F MCU只有一个CS信号用于连接。如果这是正确的,那么我们不能将两个SPI从设备连接到MCU。实际上,我们没有选择PIC18F MCU——它是MCP2515的一部分,可以监视演示板。对于这个演示板,似乎没有其他CS信号为用户提供。然后,我们不能添加另一个SPI从设备到这个演示板,对吧?你能提出其他解决这个问题的办法吗?目的是将SPI格式数据转换为可以格式化数据。这将是更好的,如果没有MCU上的董事会。[图像] C:用户xWang78TabeECE570LayOut2.2. PNG/[图像]最佳,X.W
以上来自于百度翻译 以下为原文 Hi, Thank you for your valuable information! I have labelled the signal on the diagram and made it more clear. I didn't realize that there are two CS signals on the master device, and there should be two CS signals. However, I found that the PIC18F MCU only have one CS signal provided for connection. If this is right, then we cannot connect two SPI slave devices to MCU. Actually we didn't choose the PIC18F MCU - it's part of the MCP2515 CAN Monitor Demo Board. For this demo board, it seems there is no other CS signal provided for the user. Then, we cannot add another SPI slave device to this demo board, right? Could you suggest for other solutions for this problem? The objective is to convert the SPI format data to CAN format data. That's would be better if there is no MCU on the board. [image]C:Usersxwang78DesktopECE570Layout2.png[/image] Best, X.W Attached Image(s) |
|
|
|
|
|
在主模式中,CS是由主设备中的代码创建的信号。您可以使用任何GPIO引脚,并且您可以有多个CS引脚。您以前使用过SPI吗?这将需要代码编写在你的部分,它不会工作的盒子。
以上来自于百度翻译 以下为原文 In Master mode, CS is a signal created by the code in the Master device. You can use any GPIO pin for it, and you can have multiple CS pins. Have you ever worked with SPI before? This is going to require code writing on your part, it won't work out of the box. |
|
|
|
|
|
嗨,PIC18F450是在演示板中使用的原因,它是在PC机上与USB演示软件一起使用的USB通信,它是在设计板时的当前产品,它后来被用PIC18F45 K50设备代替USB使用。如果不需要USB,PIC18FYXK22,PIC1MFP2515在CAN和SPI信令之间进行转换。要知道SPI仅仅是电电平信令,SPI本身不定义高级别协议,如CAN。将SPI连接到SPI,不太可能工作,除非您也知道这些设备。如果您知道电压传感器的规格和协议,可以使用PIC微控制器进行翻译。在演示板提供的源代码示例中,可以提供许多所需的软件块。迈西尔
以上来自于百度翻译 以下为原文 Hi, The reason PIC18F4550 is used in the demo board, is that it have USB communication for use with the Demo software in a PC, and it was a current product at the time the board was designed. It have later been replaced with PIC18F45K50 devices for use with USB. If USB is not needed, PIC18F__K22, PIC18F__K40 and many other have similar properties. The MCP2515 do translations between CAN and SPI signaling. Be aware that SPI is only electric level signaling, SPI in itself do not define a high level protocol, like CAN. Connecting SPI to SPI, is not likely to work, unless you also know that the devices are Known and Specified to be used together. If you Know the Specifications and Protocol of the Voltage Sensor, the PIC microcontroller may be used to translate. A lot of the software pieces needed, may be available in the source code examples provided with the demo Board. Mysil |
|
|
|
|
|
你好,谢谢你的信息!我似乎在演示板上找不到任何GPIO,这意味着我们不能在这个演示板上添加额外的SPI从设备。以前我从来没有使用SPI。实际上,我们的目标很简单——我们想在没有MCU的情况下找到一个SPI到CAN的设备,但是我们可以在它上做一些配置。ENT是这个计划的布局。你认为这个MCP2515 CAN总线监控演示板能完成这项任务吗?如果不是,你能推荐一些解决这个问题的方法吗?我非常感谢你的帮助!
以上来自于百度翻译 以下为原文 Hi, Thank you for your information! I seems that we cannot find any GPIO on the demo board, which means we cannot add extra SPI slave device to this demo board. I never worked with SPI before. Actually, our objective is quite simple - we want to find a SPI-to-CAN device without MCU on it, but we can do some configurations on it. Attachment is the layout for this plan. Do you think this MCP2515 CAN Bus Monitor Demo Board can finish this task? If not, could you recommend some solutions for solving this problem? I really appreciate your help! Attached Image(s) |
|
|
|
|
|
你好,Mysil,谢谢你关于SPI连接的详细信息。我知道SPI不同于CAN。因此,我们需要了解双方SPI设置的所有规范。对于电压传感器部分,我们正在寻找数据表和手册来查找SPI规范。但是,我们仍然对SPI到CAN转换器的配置是肯定的。附件是此配置的布局。对于这个转换器,这里有以下要求:从电压传感器获得并解释SPI数据,将SPI数据转换成CAN总线数据结构,您能推荐一些演示板来满足我们的要求吗?提前谢谢!最好的,X.W
以上来自于百度翻译 以下为原文 Hi Mysil, Thank you for your detailed information on SPI connection. I understand SPI is different from CAN. So we need to know all the specifications on SPI settings on both sides. For the voltage sensor part, we are looking data sheet and manual to find out the specifications on SPI. However, we are still sure about the configuration on SPI-to-CAN converter. Attachment is the layout for this configuration. For this converter, here are the requirements:
Thank you in advance! Best, X.W Attached Image(s) |
|
|
|
|
|
对于解决方案,我指的是一些类似的演示板,配置简单。祝您好运,X.W。
以上来自于百度翻译 以下为原文 For solutions, I mean some similar demo boards with simple configuration. Best Wishes, X.W |
|
|
|
|
|
你的最终目标是什么?你有一个旧板和旧照片。你可以用内置的CAN总线获得新的图片。你可以通过安装来完成你的任务。但如果你的目标是一个产品,你应该得到正确的PIC的工作。如果是业余爱好或学习项目,那只是额外的工作。
以上来自于百度翻译 以下为原文 What is your end goal? You have an old board with and old pic. You can get newer PICs with built in CAN bus. You can get that setup to do what you are asking. But if your goal is a product you should get the right pic for the job. If it is a hobby or learning project the it is just extra work. |
|
|
|
|
|
嗨,NKurzman,是的,你说得对。我们可以用内置的CAN总线获得更新的图片。但是我们需要使这个PIC连接到电压传感器以获得电压数据。该连接并不局限于SPI,但由于我们目前的电压传感器的输出是SPI格式,我们正在努力寻找一个合适的SPI到CAN转换器,以满足我们的要求,最终目的是获得电压信号,并以给定的格式和频率发送给CAN总线。这是一个学习项目,我想建立一个硬件平台的原型,测量电压信号并通过CAN总线发送。我不太理解“安装”这个词,你能再解释一下吗?非常感谢你的回复!最好的,X.W
以上来自于百度翻译 以下为原文 Hi,NKurzman, Yes, you are right. We can get newer PICs with built in CAN bus. But we need to make this PIC connected to the voltage sensor to obtain the voltage data. The connection is not necessary limited to SPI, but since the output of our current voltage sensor is SPI format, we are trying to find out a suitable SPI-to-CAN converter that meets our requirements. The end goal is to obtain the voltage signal and send it to CAN bus with given format and frequency. This is a learning project and I want to build a prototype of hardware platform that measure the voltage signal and send it through CAN bus. I don't quite understand the word "setup", could you explain it a little more on that? Thanks a lot for your reply! Best, X.W |
|
|
|
|
|
您好,您在演示板上的PIC18F45 50与当前PIC18设备没有明显不同,PIC18FXKK50、PIC18FXXK20、PIC18FXKK22和PIC18FXXK40的指令集和中断系统都是相同的。在所有这些设备中,SPI外围设备通常称为MSSP。一些设备家族具有2个SPI硬件实例,因此在寄存器名称中有一个额外的数字,1或2。一些现代设备家族具有PPS,外围引脚选择(PPS),将某些信号路由到D的可能性。不同的引脚。可能有一个额外的控制寄存器1位额外的SPI。在PIC微控制器上有大量的GPIO引脚在演示板上,但很少有连接到板边缘上的连接器,可以自由使用。4个信号到板上的%LED,都是G。PIO引脚,就像芯片上没有电源、接地或USB的任何引脚一样。稍加修改,您可以重新使用其中一个LED信号,为额外的SPI器件进行芯片选择。控制微控制器中的CS信号,与打开和关闭LED没有什么不同,只需在T中完成。他在代码中放置了PIC微控制器,内置了CAN硬件。在PIC18系列产品中,它们的型号为PIC18FXXK80。但是使用其中的一个,将不会使开发比MCP2515+PIC18F更简单。一个替代的开发板,一个好奇心8位高引脚计数板,可以用于PIC18设备在28引脚或40引脚PDIP封装:HTTP://www. MyCHIP.COM/DealthTooSts/StudioDeLiels.ASPX?PARTNO=DM164136它可以与此一起使用:HTTPS://Suff.MikROE.COM/CLICK/IdFACE/MCP2517FD,Mysil
以上来自于百度翻译 以下为原文 Hi, The PIC18F4550 on the demo board you have, is not significantly different from current PIC18 devices. The instruction set, and interrupt system in PIC18FxxK50, PIC18FxxK20, PIC18FxxK22 and PIC18FxxK40, are all the same. The SPI peripheral, called MSSP is generally the same in all these devices. Some device families have 2 SPI hardware instances, and thus an additional digit, 1 or 2, in register names. Some of the modern device families have PPS, Peripheral Pin Select (PPS), the possibility to route some signals to different pins. There may be one additional control register with 1 extra bit for SPI. There are plenty of GPIO pins on the PIC microcontroller on the demo board you have, but few of those connected to Connectors on the edge of the board, are free to use. The 4 signals going to %LEDs on the board, are GPIO pins, just as any pin on the chip that isn't Power, Ground, or USB. A little rework, you may repurpose one of the LED signals, to Chip Select for the additional SPI device. Controlling a CS signal in the microcontroller, is no different from switching a LED On and Off, it just have to be done in the right place in the code. There exists PIC microcontrollers with CAN hardware built in. In the PIC18 series of products, they have type numbers PIC18FxxK80. But using one of those, will Not make development any simpler than the MCP2515 + PIC18F... configuration you already have. As for an alternative development board, a Curiosity 8 bit High Pin Count board, could be used for PIC18 devices in 28 pin or 40 pin PDIP packages: http://www.microchip.com/developmenttools/productdetails.aspx?partno=dm164136 It might be used together with this: https://shop.mikroe.com/click/interface/mcp2517fd Regards, Mysil |
|
|
|
|
|
你好,Mysil,非常感谢你的详细信息!我正试图重新调整演示板上的一个LED。但是,我发现这些LED是连接在PCB级。我的意思是,我可以访问这些LED引脚,但是对于连接来说似乎不太稳定,因为这个引脚只有很少的金属。因此,我想问一下,是否有可能使用或不使用其他的头(如附件中所示)。引脚上的引脚是::CS,MSI,MSO,MSCK;//用于SPI连接的引脚,不能重新使用。INT,RXB0,RXB1;/ /中断-不好;接收缓冲器-不利于重新使用;TXCAN,RXCAN;/ /用于CAN通信-不适用。RTS0,RTS1,RTS2;/ /发送缓冲器-不适用.SOF;//帧起始似乎是CS重新可用的唯一一个,也检查用于SOF的MCP2515的数据表:如果启用,则在每个CAN消息开始时在SOF引脚上生成帧开始(SOF)信号。XCAN PIN。我认为,如果我们可以在代码中进行正确的修改,可以重新定义这个引脚作为CS。您认为可以用这种方式获得CS吗?谢谢您!此外,我还检查了您提供的演示板。看来他们是很好的开发板来实现我们的任务。我知道在好奇板上有两个SPI头用于交流。一个可以用于电压传感器连接,另一个可以用作SPI连接到CAN转换器-MCP2517FD点击板。但是我仍然关心如何配置CPU2517FD点击板,用于SPI到CAN转换。我检查了这个点击板的原理图。板通过MikROBUS点击板插座连接到好奇心板。我的问题是在这里:我们可以设置所有参数的CAN配置TCMCP2517FD点击板通过那些引脚(见附件)?我非常感谢你的帮助!再次谢谢!最好的,X.W
以上来自于百度翻译 以下为原文 Hi Mysil, Thank you so much for your detailed information! I was trying to re-purpose one of the LEDs on the demo board. However, I found those LEDs are connected on PCB level. I mean, I can get access to those LED pins, but it seems not very stable for the connection because there is only little metal for that pin. Therefore, I want to ask whether it's possible or not to use one of other headers (as I showed in the attachment)? The pins on the headers are: •CS, MSI, MSO, MSCK; // pins for SPI connection, cannot be re-purpose •INT, RXB0, RXB1; // interruptions - not good; Receive buffer - not good for re-purpose; •TXCAN, RXCAN; // used for CAN communication - not applicable •RTS0, RTS1, RTS2; // Send buffer - not applicable •SOF; // Start of frame - seems the only one available for CS re-purpose I also check the data sheet of MCP2515 for SOF as follow:
I think it's possible to re-purpose this pin as the CS if we can make correct modification in the code. Do you think it's possible to obtain the CS using this way? Thank you! In addition, I also checked the demo boards you provided. It seems they are good development boards to realize our tasks. I understand there are two SPI headers on the Curiosity board for communication. One could be used for voltage sensor connection, and the other could be used as SPI connection to the CAN converter - MCP2517FD click board. But I am still concerned about how to configure the MCP2517FD click board for SPI-to-CAN conversion. I checked the schematic for this click board. The board was connected to the Curiosity board through mikroBUS Click Board socket. My question is here: can we set all the parameters for CAN configurations to MCP2517FD click board through those pins (see attachment)? I really appreciate your help! Thank you again! Best, X.W Attached Image(s) |
|
|
|
|
|
嗨,我不想建议重新设置MCP2515 CAN控制器和PIC18微控制器之间的任何现有连接,因为我不知道控制器是否足以确定需要什么。此外,即使在有SUBRA的情况下,直接在MCU的小引脚上进行返工也是相当微妙的。L引脚未连接。我建议使用一个LED,因为它的焊盘和部件大得多。应该有可能把一根细丝焊接到一个LED的末端,那里通常有一个焊料的圆角。去掉LED不是必要的。在修改软件时,您可以保持LED的完整性,以指示温度传感器的CS信号。如果稍后怀疑LED对于快速CS信令来说负载太大,则您可以在以后移除LED的限流电阻器,或者在其上剪切迹线。信令引脚、SOFKCLKO和3个中断信号通过MikROBUS引脚从CAN控制器连接到PIC微控制器,除了STIBE信号到TIVION之外。我假设电路板是这样设计的,CAN控制器可以被控制。TasHeET似乎还不可用。也有点击板与MCP2515 CAN控制器。问候,Mysil。
以上来自于百度翻译 以下为原文 Hi, I didn't want to suggest repurposing any of the existing connections between MCP2515 CAN Controller and the PIC18 microcontroller, as I do not know the controller enough to be sure what is needed. Also, doing rework directly on the small pins of the MCU is quite delicate, even if there are several pins unconnected. I did suggest to use one of the LEDs, as the pads and components there are much larger. It should be possible to solder a thin wire to the end of one of the LEDs, there usually is a fillet of solder there. It is not nessesary to remove the LED. You may keep the LED intact to indicate CS signal for the temperature sensor when modifying software. If it later is suspected that the LED is too much load for fast CS signaling, you may later remove the current limiting resistor for the LED, or cut the trace there. On the MCP2517FD Click Board, SPI signaling pins, SOF_CLKO, and 3 interrupt signals are connected from CAN controller to PIC microcontroller thru the MikroBus pins, in addition to STBY signal to the transiever. I do assume that the board is designed such thet the CAN controller can be controlled. MCP2517FD seem to be on the edge, datasheet seem to not be available yet. There also are Click Boards with MCP2515 CAN controller. Regards, Mysil |
|
|
|
|
|
HiArne,谢谢你对重新工作的详细说明。因为我们找不到MCP2517FD的数据表,因为我找不到其他两个CAN转换器:MCP25625点击;链接:http://Malko.com/c……WiRe=和24;结果可以是SPI点击5V;链接:http://Suff.Mikro.com/CLICK/IdFACE/CAN-SPI-5V,我认为那些转换器可以是C。通过MikROBUS插座进行控制,如果它们连接到MCU。我将研究如何控制那些CAN转换器。非常感谢你们的帮助!最好的祝愿,Xiaochu
以上来自于百度翻译 以下为原文 Hi Arne, Thank you for your elaborate explanation on the re-purpose work. I will take a try on the LED. Since we cannot find the data sheet for MCP2517FD, I found other two CAN converter:
Thanks a lot for your kind help! Best Wishes, Xiaochu |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 04:15 , Processed in 1.012300 second(s), Total 67, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2330