Bus Heavy Error - Pcan with Pic18

USB to CAN Interface
suleymaneskil
Posts: 6
Joined: Mon 13. Dec 2021, 20:32

Bus Heavy Error - Pcan with Pic18

Post by suleymaneskil » Wed 15. Dec 2021, 14:43

Dears,

I designed a board based on PIC18F and i want to use the CAN communication. We bought PCAN-USB and PCAN Explorer 6 to test CAN communication.

My Circuit information:
MCU: Pic18F26K83
Clock:8 MHz
CANBUS Speep: 250Kbps
CANBUS ID Mode: CanBUS Extented ID
CANBUS Tq(Time Quanta): 8
Sync Jump With:1xTq
Sample Point: %75
Sync Segment: 1xTq
Propogation Segment: 1xTq
Phase Segment 1: 4xTq
Phase Segment 2: 2xTq

When i measure the bus resistor with multimeter without power is 62.5Ohm.
The CAN H bus voltage on communication: 3.2V
The CAN L bus voltageon communication: 1.8V

When i start the communication on PCAN 6, the PCAN USB is blinking fastly as red colour.
I used just one board and Pcan USB to test CAN communication. I used the terminal resistor PCAN USB and on the my board. You not maybe see the schematic but after that i connected the terminal bus resistor(each terminal resistor is 120 ohm).
Image

I added the connection methode in the PCAN 6. But i always receice BUS HEIGH error as you can see below picture:
Image

I dont understand why do i get a mistake or where do i make a mistake, i read all related topic for this error, can you help me?

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Bus Heavy Error - Pcan with Pic18

Post by M.Heidemann » Wed 15. Dec 2021, 15:13

Hello,

i assume you use a regular PCAN-USB (IPEH-002021/IPEH-002022)?

In this case the default sample-point for 250k in the Bitrate dropdown is 87.5% (these are predefinied baudrates),
if your PIC18 runs at 75% you should consider to use the same
sample point on the PCAN-USB side, here's how:

Open up PCAN-Nets Configuration:
Nets_configuration.png
Nets_configuration.png (13.36 KiB) Viewed 8797 times
Right click to create a new PCAN-net for your PCAN-USB:
New_Net.png
New_Net.png (8.06 KiB) Viewed 8797 times
Click the "..." to open up the "Manage Bitrates" Menu:
Manage_Bitrates.png
Manage_Bitrates.png (9.74 KiB) Viewed 8797 times
Add your own Bitrate (1), adjust the settings (2) (you can use the ones shown here), check the resulting bitrate (3) and hit "OK" (4)
Custom_bitrate.png
Custom_bitrate.png (24.26 KiB) Viewed 8797 times
Afterwards you can select your custom bitrate to be used with the PCAN-Net you currently create (you can also use the custom bitrate with existing nets, by editing them):
SelectCustomBitrate.png
SelectCustomBitrate.png (18.06 KiB) Viewed 8797 times
Make sure you save your PCAN-NET:
ConfirmChangesSave.png
ConfirmChangesSave.png (29.28 KiB) Viewed 8797 times
Afterwards make sure to use the newly created NET and run your test again.

Does this resolve the issue?

Please let us know

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

suleymaneskil
Posts: 6
Joined: Mon 13. Dec 2021, 20:32

Re: Bus Heavy Error - Pcan with Pic18

Post by suleymaneskil » Wed 15. Dec 2021, 22:17

Hi Mr. Heideman,

I try your solution and i received same error "BUS HEAVY" as below pictures:
I know that i make a mistake but where is it?
Attachments
pcan_net_conf.png
pcan_net_conf.png (18.38 KiB) Viewed 8784 times
microchip_ecan_conf.png
microchip_ecan_conf.png (55.62 KiB) Viewed 8784 times
manage_bit_rates.png
manage_bit_rates.png (38.02 KiB) Viewed 8784 times
final_screen.png
final_screen.png (94.25 KiB) Viewed 8784 times
canbus_test_code.png
canbus_test_code.png (70.99 KiB) Viewed 8784 times

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Bus Heavy Error - Pcan with Pic18

Post by M.Heidemann » Thu 16. Dec 2021, 10:57

Dear,

After rechecking your shematic i noticed you only have a TXD-Line shown here,
which would prevent the CAN-Controller from working as intended.

Is there indeed no RXD line passed to the CAN-Controller?

You will need an RXD-Line to have frames acknowledged.

Without this you will only produce errors on the bus as no acknowledgement can be given
to the CAN-Controller of your PIC18 that the messages were successfully sent.

I did not notice this at first, pardon me.
MissingRXD.png
MissingRXD.png (160.58 KiB) Viewed 8775 times
Make sure you have an active RXD-line and try again.


Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

suleymaneskil
Posts: 6
Joined: Mon 13. Dec 2021, 20:32

Re: Bus Heavy Error - Pcan with Pic18

Post by suleymaneskil » Thu 16. Dec 2021, 13:00

Dear Heidemann,

There is a can rxd and txd as you can at the attachment.
But i initialed can bus rx and tx mode in the code but i didnt use can bus read function, i just use transiver function.
You can examine my code at the below message.

If you want to know about anything with the project, please dont hesitate to contact with me.
Attachments
MissingRXD.png
MissingRXD.png (180.9 KiB) Viewed 8766 times

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Bus Heavy Error - Pcan with Pic18

Post by M.Heidemann » Thu 16. Dec 2021, 13:19

Hello,

yes i noticed upon a second look.

Acknowledgement of a frame should be handled by the CAN-Controller
by default, it should not have to be coded specifically so i
assume this is not the cause.

However we cannot really assess possible cause on the PIC18 side as
we are not familiar with it, so we need to determine on which side
of this setup the issue arises.

Do you have another CAN-node to run a test with?

For example, do you have another PCAN-interface by chance?

Please let me know.

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

suleymaneskil
Posts: 6
Joined: Mon 13. Dec 2021, 20:32

Re: Bus Heavy Error - Pcan with Pic18

Post by suleymaneskil » Thu 16. Dec 2021, 14:08

Hi,

Unless, i don't have any can node or pcan interface.

I just make the simple code with code generator, i can upload the program or can debug the code.
The pcb doesnt heat, other specifications are fully working.
If you have an email address i can send fully, schematic and codes. I will also write microchip forum.

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Bus Heavy Error - Pcan with Pic18

Post by M.Heidemann » Thu 16. Dec 2021, 14:28

Hello,

We can only help you with the PCAN-side of things,
anything related to the PIC18 cannot be handled by our support.

Please see if you can get another Node to test with,
recheck all physical connections and also check your termination once again.

Check transceiver voltages on the PCAN-USB as described in this post:

viewtopic.php?f=120&t=52

This is about the extend of support we can provide at this point.

If there are new discoveries, please let us know.

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

suleymaneskil
Posts: 6
Joined: Mon 13. Dec 2021, 20:32

Re: Bus Heavy Error - Pcan with Pic18

Post by suleymaneskil » Tue 28. Dec 2021, 20:58

Dears,

I haven't solved yet this problem but the pcan usb is full working because when i try the loopback mode in pcan explorer 6, the pcan usb is fully working.
If i have a new news, i will inform you. I trying to solve.

suleymaneskil
Posts: 6
Joined: Mon 13. Dec 2021, 20:32

Re: Bus Heavy Error - Pcan with Pic18

Post by suleymaneskil » Sun 23. Jan 2022, 17:33

Dears,

I solved the problem and there is any error pcan side. There is an error Mplap IDE(Pic18fxx) configuration side of CANBUS phsical layer.
When i solved this problem, there isn't any error. Thanks for helping. Pcan explorer 6 and pcan usb are very useful.

Locked