Posts: 22
Threads: 5
Joined: Mar 2023
Reputation:
0
2023-03-18, 08:31 PM
(This post was last modified: 2023-03-20, 01:00 PM by yiannis.)
Hi,
I saw how cheap this [
https://thepihut.com/products/isolated-r...spberry-pi] was and I thought that I could replace the USB-RS485 adapter for more or less the same money and have a HAT rather than a USB device hanging of my RasPi and an NMEA2000 interface for future expansion.
I sorted out the CAN side of things but I cannot understand how to enable/connect the RS485 ports. Anybody has done it? I tried adding this to /boot/config.txt
Code:
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25,,spimaxfrequency=1000000
dtoverlay=sc16is752-spi1,int_pin=24
But I got a conflict at the 'Check System' applet.
Any ideas?
TIA
--
Sailor and techie or techie and sailor?
Whichever way I am in the right place
Posts: 227
Threads: 3
Joined: Mar 2016
Reputation:
5
2023-03-18, 10:20 PM
(This post was last modified: 2023-03-18, 10:20 PM by holgerw.)
my config is this for can:
dtoverlay=mcp2515-can0,oscillator=12000000,interrupt=25
for RS485 bluetooth has to be disabled.
holger
Posts: 22
Threads: 5
Joined: Mar 2023
Reputation:
0
(2023-03-18, 10:20 PM)holgerw Wrote: my config is this for can:
dtoverlay=mcp2515-can0,oscillator=12000000,interrupt=25
for RS485 bluetooth has to be disabled.
holger
On some FB group, people told me that it might be because I am running 64-bit OP. So I did a trial with a 32-bit and it's still the same. I still get the error/warning.
This time I tested if the RS485 works and it's receiving data OK. I cannot test the CAN bus, though.
I tried disabling the Bluetooth, but still no luck. BTW, I am running a Raspberry Pi 4B.
BTW, my CAN HAT has a 16MHz oscillator so I set it to 16000000.
Here you can see the Serial, CAN Bus and System Check applets.
--
Sailor and techie or techie and sailor?
Whichever way I am in the right place
Posts: 227
Threads: 3
Joined: Mar 2016
Reputation:
5
Ok, you have another HAT, but the CAN chip is the same, only other frequency. and you have also 2 serial chips, so forget about bluetooth. i am running also on pi4 with 64bit, so this should work.
what makes me think: the eroor tells about the GPIO conflicts. so there are pins in use which your Hat wants to use.
Check for this in OP-GPIO. And did you enable SPI-Bus in raspi-config?
good luck. Holger
Posts: 22
Threads: 5
Joined: Mar 2023
Reputation:
0
Update:
After loads of head-scratching and head-banging-against-the-wall, I managed to find the culprit.
Inside my config.txt file there was the following line:
As soon as I commented that one out, the conflict disappeared.
Thanks for all the ideas, suggestions and help.
--
Sailor and techie or techie and sailor?
Whichever way I am in the right place
Posts: 227
Threads: 3
Joined: Mar 2016
Reputation:
5
fine - you got it...
maybe this helps for others.
how
Posts: 22
Threads: 5
Joined: Mar 2023
Reputation:
0
(2023-03-20, 09:17 PM)holgerw Wrote: fine - you got it...
maybe this helps for others.
how
Yes, that is my plan. When it's all done to post a step by step guide for it.
I still have a question, though: have you managed to use one of them as an output? I don't seme to be able to do it.
Thanks again.
--
Sailor and techie or techie and sailor?
Whichever way I am in the right place
Posts: 227
Threads: 3
Joined: Mar 2016
Reputation:
5
Of you Connect them with an cable, The characters will be Received.
Opencpn has an Option to set it as an Output Line.
Posts: 22
Threads: 5
Joined: Mar 2023
Reputation:
0
(2023-03-21, 01:22 AM)holgerw Wrote: Of you Connect them with an cable, The characters will be Received.
Opencpn has an Option to set it as an Output Line.
Thanks!
While you were typing I was playing with wires! I used the SK Simulator plugin (I just discovered it) and it all started spewing out data.
Thanks again!
--
Sailor and techie or techie and sailor?
Whichever way I am in the right place