View previous topic :: View next topic |
Author |
Message |
sezgin ozan
Joined: 05 Jan 2014 Posts: 15
|
pic18f46q83 - canbus |
Posted: Sat Apr 12, 2025 4:10 pm |
|
|
Hi everyone, I will start a new project with pic18f46q83 and use canbus, wizard says use mcp driver but for pic18f25k80 for example I used can-18f4580.c, which driver is for pic18f46, I am not sure , tried can-18f4580 but it gives some errors, any suggestion |
|
 |
ccxenova
Joined: 03 May 2025 Posts: 1
|
|
Posted: Sat May 03, 2025 11:54 pm |
|
|
Can anyone provide some insight on this topic? I'm interested because I've encountered similar situations. If anyone has a solution or suggestions, please let me know. Thank you guys.. |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9475 Location: Greensville,Ontario
|
|
Posted: Sun May 04, 2025 8:57 am |
|
|
'gives some errors'...
OK, which ones
Do you have proper wiring and terminations ?
Do you have proper power supply ? |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19831
|
|
Posted: Sun May 04, 2025 9:24 am |
|
|
The point is that the Pic18f46q83, does not have a built in CanBus peripheral,
so you need to be using an external CanBus interface. The MCP 2515 or
2551, is the standard device to use. The driver you need will depend on
which peripheral you use. The chip drivers are for devices that have got
an internal CAN peripheral. The 4580, has a can peripheral. The 25K80
has the ECAN module, so can use either the standard internal CAN driver
or the ECAN driver (preferably the latter).
Think 'peripheral first'. If your device has a particular peripheral, look for
what other chips have this same peripheral, and then for the drivers for
these. If your chip doesn't have a peripheral, then instead you need to be
using an external peripheral and the drivers for this.
The wizard is saying that since the chip does not have a can peripheral,
you need to be using the drivers for the MCP peripherals (ad fitting these)..... |
|
 |
jaka
Joined: 04 May 2014 Posts: 39 Location: Finland
|
|
Posted: Mon May 05, 2025 12:20 am |
|
|
The PIC18F46Q83 does have CAN peripheral (and Q84 family has CANFD peripheral).
However, I haven't tried to use CAN with Q83/Q84 devices. I have only used CAN with PIC18F26K83. It does work with CCS supplied drivers. |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19831
|
|
Posted: Mon May 05, 2025 2:33 am |
|
|
Not according to the data sheet......
As you say the Q84 does, but not the 46Q83. Microchip appear to be
partially documenting things wrongly. Their 'features' page says it
has the CanFD peripheral, but if you go to the device selector, and
specify CAN, it does not list the device, and the data sheet does not
show CAN anywhere.....
It has a DALI interface but not a CAN interface, unless the data sheet is
wrong.
I think a direct question to MicroChip is needed.
The device editor says 'CANOBJ', not CAN, ECAN, or CANFD, which
are the normal peripheral selections. There is no driver listed for CANOBJ,
and no reference to this in the manual...  |
|
 |
dyeatman
Joined: 06 Sep 2003 Posts: 1956 Location: Norman, OK
|
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19831
|
|
Posted: Mon May 05, 2025 4:42 am |
|
|
The data sheet currently on their site still does not show it./ Without this,
it becomes impossible to know how to drive it. That CCS have listed thw
CANOBJ entry is very odd, since they give the peripherals as CAN, ECAN,
and CANFD, no mention of CANOBJ. There are no drivers for CANOBJ,
so driving this is currently basically a matter of trying each driver, and
then being prepared to fiddle when they don't work. Without data, the
'fiddle' part is going to be impossible....
We don't even know what if any registers it actually has, or what the
features of each are.
I'd go to a chip with data I'm afraid. Trying to drive this if it does have
a CAN peripheral is going to take an absolute age. |
|
 |
dyeatman
Joined: 06 Sep 2003 Posts: 1956 Location: Norman, OK
|
|
Posted: Mon May 05, 2025 5:30 am |
|
|
Strange. Not sure what datasheet you are seeing.
The one I see on the regular site as of today shows CAN as well.
https://www.microchip.com/en-us/product/pic18f46q83
Table 1 in this sheet shows all three versions having it. It is also listed under Digital Peripherals _________________ Google and Forum Search are some of your best tools!!!! |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19831
|
|
Posted: Mon May 05, 2025 8:16 am |
|
|
That is fun. I have the same data sheet, pulled on Friday at 16:09, and it
has not got the CAN section........
Anyway if you look at that, the chip has the more sophisticated controller
that support objects. So the driver needs to be can_pic18_obj.c
annoyingly this one CCS do not provide as example for. |
|
 |
|