That is correct! I have a name I am not an ASCII 0x3F character!
This thread has been very active. Iāve skipped a number of posts because iāve been lazy this weekend.
But, wouldnāt an octopod technically not need too much more torque since there are two more legs to help spread the load? Of course if its balancing all the weight on 4 legs it would need a lot of torque. Especially if the other legs are high in the air. How would an octopod even walk?
Yes, the MCP23017 has to be configured. It can be used as two 8 bit ports or a single 16 bit port. The data is also written to and read from registers on the device.
We are starting to go way off topic here, and Iād like this to stay on the topic of the new dual PIC board we are designing.
We can start other threads if we want to talk about octapods. These also interest me a lot since I want to build one someday.
Yeah, I know youāre pretty busy, and donāt really have time to participate in all of the threads. But I thought you might be secretly working on an octapod! New product!
Actually, I hadnāt thought about the change in gaits needed other then the obvious need to move eight legs instead of 6. That part is relatively easy.
Iām glad you brought it up! I can see why; more legs needed down to carry the weight. But it would be 4 vs 3 legs, or 133%, and I suspect the total weight of the 'bot would only go up 125% (guessing)? Plenty of time to figure it all out, I donāt have all my legs yet!
Pentapedal gaits? 4 -2 gaits? Do you have any references? Iād just started to investigate last Friday.
OK, I think I am starting to understand Peteās I2C code now. It looks like he sends the register address as the first byte of data after sending the device address. I got a little help in understanding this from Barry (ginge) over on the Open Servo forums. However, my problem now may be that Peteās code does not like running slower than 10 Mhz, and the math for 8 MHz does not work out exact.
I may have to wait until I get my 20 Mhz crystals to work with this more, so I can start out with 10 Mhz.
On this note I saw something go by earlier about the crystal on the UBW being only 4MHz⦠it depends on which incarnation you have. The SMT one from sparkfun (SKU#: DEV-00762) has a 20MHz ceramic resonator (noted on the UBW homepage when you select the specifi bootloader.hex file for your version.)
If you have a 8 MHz XTAL and want to use it; then you may be able to just change the PLL multiplier, or a timer re-load. What is it exactly thatās not working? A baudrate for I2C? Whereās the math?
Anything having to do with the MCP23017 is not working at all. I canāt tell whether the 4550 is actually sending down the I2C lines or not. The 4550 and 4620 PICs seem fine. I have temporarily switched back to a 4620. My code seems like it should be working, but it is not. Here is my current up to the second code for my i2cleds project. I believe I am doing things right, accoding to how Pete is doing things in his code, but it is not working for me. I still think there might be a problem with the 8 Mhz clock rate, but I am not sure.
I just took a look, and second_ticks = 80 looks like it could be changed to correct the timing for your xtal. Might be other things. This is a point where a DIVISOR could be calculated for you in relation to the XTAL frequency. Not important if youāre not going to change the XTAL frequency, but then you should be making this calc at one time or another.
If I donāt think something is working at all, itās the time I drag out the 'scope (or a logic analyzer). If you donāt have that, then a good logic probe can indicate some activity.
I am using the internal 8 Mhz oscillator right now, because I donāt have any crystals yet. I have several 20 Mhz crystals on order.
I donāt even own a DMM right now, but am hoping to get one next month, if i have the spare cash. I would love to have a logic analyzer, even the lower priced BitScope, but that is even expensive for me.
Where is this line in the code? If you can point me to a file and line number, it would help.
They are useful for a project I am working on. I like them for sequencing LEDs, and I have one Atom project I want to revisit to see if I can get it to work with a PIC now.
Itās not too bad switching between the 4620/4680 and the 4550. I just have to change my pull-ups and I2C lines to different pins.
I was looking at datasheets, and was reading a thread over on Spark Fun about the CAN bus. So, I checked the datasheet for the 4680 which has CAN, I2C, SPI, etc. The CAN pins do not conflict with the I2C/SPI pins. I also didnāt realize until then that the dsPIC4011 also has CAN, and the I2C and CAN pins do not conflict. The 4680 is pin compatible with the 4620. This is interesting, so I ordered some chips I have never used before - the MCP25055 which is a CAN bus expander. I figured it would be an easy way to experiment with CAN, much like I am doing with I2C and the MCP23017.
In other news, I think I have a power related problem, as in not enough, on my breadboard. I tried setting up to program a dsPIC4011, but I am not able to do it. I can program 18F parts just fine though. Iām going to have to find a nice little low cost 5V/12V power supply so I can power my circuits and have the ICD2 powered from the circuit also.
The register SSPADD is what controls the speed at which I2C talks at⦠The equation for it is so:
((CLOCK/BITRATE)/4)-1
Pete has it set for 24, i.e: ((10,000,000/100,000)/4)-1 = 24. You need to set it to 19:
((8 000 000 / 100 000) / 4) - 1 = 19
because you are using an 8MHz internal crystal, not 10MHz like Pete. I totally forgot about that register. Try updating it to 19 and see if it works now.
It wouldnāt work with 24 because you are talking to the MCP at a weird speed and it is just like āwTF?ā and ignores it. It can only support 100, 400, and 1Mb I think. It canāt support the weird speed 24 set for you.
I made the change, but it didnāt help. I know I have some power related problems, as in not enough current, etc. I wonder if this is what is causing I2C not to work - increased current draw as the MCU starts doing more.
I currently have a 4550, a 4620, an MCP23017, and 11 LEDs powered in two separate circuits. The 4550 is driving 9 LEDS and the 4620 circuit is driving 2 LEDS. Itās really no wonder now that I have been having weird problems. Right now everything is powered from the ICD2, since I donāt have a real good way to get power to everything otherwise.
I may try tapping off WALTERās bot board again. That did seem to work OK before but I didnāt have as much on my breadboard as I have now.
I believe I have enough current supply to my breadboard now. I tapped off one of WALTERās bot board servo connectors. I was able to program a dsPIC4011, so that is definitely a good sign. I now have the ICD2 powered from the circuit and all that seems to be working perfectly now.
I still have not got I2C working though. I am starting to fiddle with some I2C stuff Grasshoppah gave me, so we will see if I can make that work. His code is much smaller, and easier to work with as a first I2C PIC project.