Hi Daniel, this code was programed in mplab v8 with c18? I cannot import this project in mplab x with c18, this project can run on pic18f4550? sounds it's very interestingdanjperron wrote:Hi Softpy,
I had fun trying to use a canbus system with two MPU6050.
I used a PIC18F26K80 with the source forge code from http://sourceforge.net/projects/canopen ... Node-1.10/
I did have to modify it for compatibilities with the new cpu and I add DIP switches for NodeId. This way I could use up to 64 modules without changing the code.
The canbus speed is set to 1MBS.
Each module is capable to run 2 MPU6050 at 500 samples/sec. With that sample rate, one canbus network will be able to handle 7 modules. If you reduce the sample rate to 100, you will be able to have 35 modules which will be 70 accelerometers.
this is the github of the code with all modifications done.
You could just use the Grav1.hex file to program the CPU using the burn program I made https://github.com/danjperron/burnLVP. which is on that post http://www.raspberrypi.org/phpBB3/viewt ... 43#p430643
This is a picture of my prototype board with two MPU6050s in operation https://dl.dropboxusercontent.com/u/488 ... 160931.jpg
This is the can bus analyzer result output
This show you one module output result with accelerometer information with a sample rate of 500/sec.
This module is Node 1, address 181 is accelerometer 1 output, 182 is accelerometer device 2 output.
The can bus address 201 was received from the module to set the sample rate,(This is done manually by me).
And this is the schematic of the board
https://dl.dropboxusercontent.com/u/488 ... MODULE.png
This post will give you information on how to connect the can bus to the Raspberry Pi.
http://www.raspberrypi.org/phpBB3/viewt ... lit=canbus
Code: Select all
this code was programed in mplab v8 with c18? I cannot import this project in mplab x with c18
No. You need a cpu with CAN hardware. PIC32 cpu have CAN also.this project can run on pic18f4550?
Users browsing this forum: No registered users and 10 guests