Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:58 29 Oct 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CAN-bus with picomite/webmite and MCP2515, proof of concept

     Page 2 of 2    
Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5398
Posted: 11:16am 10 Sep 2025
Copy link to clipboard 
Print this post

Hi Arne,

There may still be a little speed gain in:
- changing SPI clock speed from 100k to 1000k.
- changing SPI from 8 bit to 24 bit transfers, and creating "commands".

from
'set receive buffer 0 control register RXB0CRTL to filters for standard identf.
Pin(2)=0:j=SPI(&H02):j=SPI(&H60):j=SPI(&B00100000):Pin(2)=1


to

'defines
const SET_CMD%=&h02<<16
const RXB0CTRL%=&h60<<8
const SET_RXB0%=SET_CMD% + RXB0CTRL%
const RXB0_VAL%=&b00100000

'in the code
Pin(2)=0:j=SPI(SET_RXB0% + RXB0VAL%):Pin(2)=1


You could even look into using SPI WRITE for these non-reading commands, such as opening SPI in byte mode.


DIM a%(2)
a%(0)=&h02:a%(1)=&h60:a%(2)=&b00100000
Pin(2)=0 : SPI WRITE 3,a%() : Pin(2)=1



Regards,

Volhout
Edited 2025-09-10 21:19 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8235
Posted: 11:40am 10 Sep 2025
Copy link to clipboard 
Print this post

I believe the count inputs on the Pico do use a hardware interrupt. All the other accessible interrupts are software and are polled after each command. It may be possible to use a counter.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025