Go to advanced search

by msperl
Wed Mar 11, 2015 11:47 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

No problem
BTW: you now use the latest foundation kernels with the device overlay for the mcp2515!
by msperl
Wed Mar 11, 2015 6:09 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

If everything is identical, then it should work - as long as the cabling polarity is correct and the bus is properly terminated. As for the "poor mans logic analyzer": [*]Connect a can transceiver to your can bus [*]connect the rx pin via a voltage divider to a pin on the rpi [*]run a programm that ...
by msperl
Tue Mar 10, 2015 9:04 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

The only thing I can imagine is that you have a mismatch in bitrates. Do you have the same oscillator on the pic+mcp as you have on the rpi? If so and you use the 3.12 kernel, then I believe you get the cnf registers printed out to dmesg when configuring the bitrates of ithe interface. Try to use th...
by msperl
Tue Mar 10, 2015 7:09 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

Are you sure you want to configure a baud-rate of 50k not 500k?

I wonder because such errors you would get when you have a speed mismatch that result in bit stuff errors/missing acknowledge...

Just checking if it is not a typo.
by msperl
Mon Mar 09, 2015 10:34 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

Code: Select all

sudo rpi-update
is your friend...
by msperl
Fri Mar 06, 2015 5:30 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

Ok, so if I use the "loopback" mode when modprobing the mcp251x, I can cansend and candump back and forth over can0 in two ssh sessions. That should indicate the PICAN board is working, correct? So then it must be wiring, right? this indicates that the chip is correctly detected (assuming you use t...
by msperl
Thu Mar 05, 2015 10:37 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

Hi Martin Is there anything missing or is this only working after the next kernel includes the mcp25X driver? you might need the latest firmware installed - but checking shows that there has not been an update to the firmware over the last few days, so it might not be fully ready (i was hoping that...
by msperl
Tue Mar 03, 2015 8:31 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

Note that the next kernel by the foundation will finally contain the mcp251x driver compiled in. Also there is now an overlay to make things work Essentially add the following to your /boot/config.txt: dtparam=spi=on dtoverlay=mcp2515-can0-overlay,oscillator=16000000,interrupt=25 You may optionally ...
by msperl
Sat Feb 28, 2015 12:38 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 132666

Re: SPI driver latency and a possible solution

Something new: I have restarted somewhat from scratch with the goal of solving the "low hanging fruit" and getting them included. Some of those have been fixed. I have now also recaptured the situation with all sorts of measurements and came up with a few improvements that are giving real improvemen...
by msperl
Sat Feb 28, 2015 12:32 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

@xxethanixx: no idea what that could be - maybe reverse polarity/wrong wireing/wrong clock speeds.
It really would require a logic analyzer here to see what is happening...
by msperl
Tue Feb 24, 2015 5:52 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

Those errors would most likely be related to can bus speed mismatches, which means that the stuff bits are not inserted correct for the configured speed (after 4 identical bits on the physical bus one stuff bit of the opposite polarity needs to get sent) and also the checksum does not match. As for ...
by msperl
Mon Feb 23, 2015 9:08 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

Hello All, 1.) Bit timing not defined - in dmesg (provided below) 2.) no bittiming in the dir: /sys/class/net/can0 -Ethan Both of them are essentially one and the same interface - you have the interface up (but not configured). It is similar to having a network interface up, but you have not config...
by msperl
Mon Feb 23, 2015 6:09 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GPIO: switching between ALT functions
Replies: 14
Views: 29405

Re: GPIO: switching between ALT functions

This kind of things would best get handled via device tree overlays - it then sets things up correctly on boot...

Martin
by msperl
Sun Feb 22, 2015 6:02 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

See: https://github.com/raspberrypi/firmware/issues/371 for the request to enable CAN drivers in the firmware...
by msperl
Sun Feb 22, 2015 5:12 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

After a long absence here a "trick" that works with the new device-tree enabled kernels which also works on the rpi2 or a device-tree enabled kernel for a RPI1... /* * Device tree overlay for mcp251x */ /dts-v1/; /plugin/; / { compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; fragment@0 {...
by msperl
Sun Feb 22, 2015 5:04 pm
Forum: Advanced users
Topic: New device tree kernel is in testing
Replies: 356
Views: 72352

Re: New device tree kernel is in testing

Would it be possible to add a means to update 2 fields with one "parameter"? Its most practical use would be to configure incoming interrupts with one "parameter". Right now we have to provide 2 parameters: can0_interrupt = <&can0_pins>,"brcm,pins:0"; can0_interrupt2 = <&can0>,"interrupts:0"; with i...
by msperl
Thu Jul 17, 2014 6:42 pm
Forum: Camera board
Topic: picam producing strong orange tint
Replies: 2
Views: 998

picam producing strong orange tint

Hi! I have experienced this now quit often: the rpi-cam does produce images with a very strong orange tint during sunset. (even without direct sun). While with the naked eye or an iphone camera it has more of a pink touch... So I wonder if there is anything to do about it? I guess it is a repeated q...
by msperl
Wed May 14, 2014 2:16 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

Cable polarity?
by msperl
Sat May 10, 2014 2:23 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Transparent RS232 pipe
Replies: 5
Views: 1882

Re: Transparent RS232 pipe

Sercd in conjunction with xinetd allows for a tcp-socket to get connected to a serial port. That should be mostly sufficient.
by msperl
Wed May 07, 2014 10:06 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

No idea - I use my self-compiled kernel, so I do not know the package you are using is included.

But, yes - the mcp2515 driver does not support all the features:
* one-shot
* loopback
* listen-only
* triple-sampling

the mcp251x driver supports all of those (but is buggy in other ways...).
by msperl
Wed May 07, 2014 9:07 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

if you load the mcp251x driver instead of the mcp2515: rmmod mcp2515 modprobe mcp251x Then you can add: "one-shot on" to your /sbin/ip command - this way the mcp2515 will only try to send the message once possibly also sending an error frame that it was not acknowledged... With that you should see t...
by msperl
Wed May 07, 2014 8:01 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

Everything that you shared indicates that: a) the communication with the MCP2515 chip is working b) the interface is up My guess is that you have NOT added another device on the CAN bus. Unless this is added your packet will not get delivered anywhere (as there isn't a single recipient to acknowledg...
by msperl
Tue Apr 29, 2014 9:46 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

candump any,0:0,#FFFFFFFF dumps data and error frames, while candump can0 only dumps data frames. so you are possibly seeing an error frame... for all the options of candump run: candump this returns: Usage: candump [options] <CAN interface>+ (use CTRL-C to terminate candump) Options: -t <type> (ti...
by msperl
Sun Apr 27, 2014 7:06 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

Looks as if your clocks do not match (especially: are you sure you got a 16mhz clock connected to the mcp2515?) or you connected with the wrong polarity. The other thing is: which driver did you use: mcp251x or mcp2515? If you use the mcp251x, then you probably hit the interrupt issue which is why y...
by msperl
Tue Apr 22, 2014 9:57 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 332221

Re: CAN controller

Lessons learned from supporting this case: for initial testing use the shell-script below (without any SPI drivers loaded) - if you see the expected response, then the communication with the mcp2515 works fine. next step is testing with the mcp251x driver, as this one really verifies that the device...

Go to advanced search