CANbus with the BASIC STAMP
LoopyByteloose
Posts: 12,537
Well, this is a first time posting of a completed project and it has taken me two years to having something that is really complete.· I am using the MCP2515 and MCP2551 chip set to interface SPI to the BasicStamp
I have wanted to create a network environment using BasicStamps, the SXes, and maybe the new Propeller.· The Internet is really overkill and a distraction [noparse][[/noparse]you have to worry about viruses and worms and hackers].· Also, this can be rural and powered from gel cells.·
To me, it just made more sense.
I also wanted lots of nodes as I have several Stamps and at least 30 SXes to play with.· So, having a low entry cost was quite important.· The chip set is about $6.· I won't quote the board price, but I will say that I have offered to let you copy my Eagle files for free.
The boards are stackable with cheap prototype perfboard.· And the wiring included the abilty to move power to just about anywhere you need it.
As it stands now, I have an Excel file that provides visual aid and cross-reference to the main documentation as Microchip's explaination leaves a lot to be desired.
I also have two PBasic Programs that demonstrate that the hardware is functioning and programible.· I still need to complete a few more to have a complete tutorial.
If there is really interest for this, I can order another 100 or so boards and sell them near my cost.· But I won't provide parts as I have to deliver via international air mail.· Just a good deal on bare boards and lots of information to share.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
Post Edited (Kramer) : 8/26/2006 11:05:09 AM GMT
I have wanted to create a network environment using BasicStamps, the SXes, and maybe the new Propeller.· The Internet is really overkill and a distraction [noparse][[/noparse]you have to worry about viruses and worms and hackers].· Also, this can be rural and powered from gel cells.·
To me, it just made more sense.
I also wanted lots of nodes as I have several Stamps and at least 30 SXes to play with.· So, having a low entry cost was quite important.· The chip set is about $6.· I won't quote the board price, but I will say that I have offered to let you copy my Eagle files for free.
The boards are stackable with cheap prototype perfboard.· And the wiring included the abilty to move power to just about anywhere you need it.
As it stands now, I have an Excel file that provides visual aid and cross-reference to the main documentation as Microchip's explaination leaves a lot to be desired.
I also have two PBasic Programs that demonstrate that the hardware is functioning and programible.· I still need to complete a few more to have a complete tutorial.
If there is really interest for this, I can order another 100 or so boards and sell them near my cost.· But I won't provide parts as I have to deliver via international air mail.· Just a good deal on bare boards and lots of information to share.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Post Edited (Kramer) : 8/26/2006 11:05:09 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
This example was written in SXB 1.51 and uses the new PIN command.
To "downgrade" it to a previous version, my guess would be to just change the PIN command to VAR in stead.
It starts by initiating the transfer speed to 250kBit/sec.
Then sending "Hello" from board 2 to board 1 and then having board 1 responding "World" to board 2.
That's it for now...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Living on the planet Earth might be expensive but it includes a free trip around the sun every year...
Experience level:
[noparse][[/noparse] ] Let's connect the motor to pin 1, it's a 6V motor so it should be fine.
[noparse][[/noparse] ] OK, I got my resistors hooked up with the LEDs.
[noparse][[/noparse]X] I got the Motor hooked up with the H-bridge and the 555 is supplying the PWM.
[noparse][[/noparse] ] Now, if I can only program the BOE-BOT to interface with he Flux Capacitor.
[noparse][[/noparse] ] I dream in SX28 assembler...
/Bamse
Your approach to programing the CAN Solo is quite different than mine. I never would have considered having one microprocessor attached to both CAN Solo's and working in a loop.
Also, I really took the overly cautious and EEPROM intensive route to initialize all 128 registers. You merely intialize less than 10 selected registers and have good results to show for it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
I kind of want to start small and build up so to say...
More examples will follow...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Living on the planet Earth might be expensive but it includes a free trip around the sun every year...
Experience level:
[noparse][[/noparse] ] Let's connect the motor to pin 1, it's a 6V motor so it should be fine.
[noparse][[/noparse] ] OK, I got my resistors hooked up with the LEDs.
[noparse][[/noparse]X] I got the Motor hooked up with the H-bridge and the 555 is supplying the PWM.
[noparse][[/noparse] ] Now, if I can only program the BOE-BOT to interface with he Flux Capacitor.
[noparse][[/noparse] ] I dream in SX28 assembler...
/Bamse
This version actually waits for a message and since the Interrupt is turned on an LED will light up on the board when the message is recieved...
More to come...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Living on the planet Earth might be expensive but it includes a free trip around the sun every year...
Experience level:
[noparse][[/noparse] ] Let's connect the motor to pin 1, it's a 6V motor so it should be fine.
[noparse][[/noparse] ] OK, I got my resistors hooked up with the LEDs.
[noparse][[/noparse]X] I got the Motor hooked up with the H-bridge and the 555 is supplying the PWM.
[noparse][[/noparse] ] Now, if I can only program the BOE-BOT to interface with he Flux Capacitor.
[noparse][[/noparse] ] I dream in SX28 assembler...
/Bamse
But since Bamse mentions them, here they are.
The purpose of the first is to verify the SPI interface is operational between the BS and the MCP2515.
The purpose of the second is to give you a complete overview of what occurs when you attempt to intialize each and every register.· Some registers [noparse][[/noparse]particularly most of the Rx buffers] are Read only and Some bits in some registers are Read only.·
Since this is 'need to know' info, I wrote the program to help new users assimilate what is actually happening more quickly.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
I have sucessfully completed my PBasic test programs that transmit and recieve endlessly at 250kbit/sec.
Still, I need to clean them up and try to organize the complete series [noparse][[/noparse]at least four programs] into a logical sequence for tutorial.
I am leaving them on for 24 hours just to be sure.
The third program is a Listen Only Program and the fourth is a Transmit Drone to verify the third.
So it is on to higher speeds, understanding the error reporting, adding multiple nodes, and real applications. I just have to complete my 10 remaining boards....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Living on the planet Earth might be expensive but it includes a free trip around the sun every year...
Experience level:
[noparse][[/noparse] ] Let's connect the motor to pin 1, it's a 6V motor so it should be fine.
[noparse][[/noparse] ] OK, I got my resistors hooked up with the LEDs.
[noparse][[/noparse]X] I got the Motor hooked up with the H-bridge and the 555 is supplying the PWM.
[noparse][[/noparse] ] Now, if I can only program the BOE-BOT to interface with he Flux Capacitor.
[noparse][[/noparse] ] I dream in SX28 assembler...
/Bamse
I would be interested, if the price is right.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"Imagination is the one weapon in the war against reality."
-Jules de Gaultier
I just sent you a PM about this.
For anyone else that is interested, you will reach me faster via the PM as I sometimes don't look in for a few days at a time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········