|
Forum Index : Microcontroller and PC projects : CAN-bus with picomite/webmite and MCP2515, proof of concept
| Author | Message | ||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5398 |
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 KingdomPosts: 8235 |
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 |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |