Weirdness! I checked on the shelf and they do have the 32k eeproms in em. Are you sure it arrived like that? Let me know and I will send you the correct part.
Oops Looks like you are right! I was looking at an old adapted to V2 board earlier. My newer ones have the 256… Still looks like I will have to limit my Save on the Arc32, but should be able to store everything on a Bap28/Arc32 combination…
Also looks like the Arc32 will be having more memory (guess I should not just go off, what I read in a manual or web site
Sounds like the Arc32 will also have 32K. The prototypes were built with what he had available. My eyes could not read what was on mine, so a little convoluted code later:
#ifdef TMB1
; simple test to see how much EEPROM I have...
; Assume I have at least 4k 24lc32
; Will first test for 32K, by trying a high memory location
wAddr = 0x08000 ; start off address
fFound = 0
while ((fFound = 0) and (wAddr > 2000))
readdm wAddr-32, [ab(0)] ; try to read a byte at about 24K
ab(1) = !ab(0)
writedm wAddr-32, [ab(1)] ; try to write the negated value
pause 100 ; give it some time
readdm wAddr-32, [ab(2)] ; Read it back in.
writedm wAddr-32, [ab(0)] ; try to restore the old value
if ab(1) = ab(2) then
hserout "EEPROM address: ", dec wAddr, " Worked!!!", 13]
fFound = 1
else
if (ab(1) = ab(2)) then
hserout "EEPROM address: ", dec wAddr, " Failed unchanged", 13]
else
hserout "EEPROM address: ", dec wAddr, " Failed: ", hex ab(1), " ", hex ab(2), " different", 13]
endif
wAddr = wAddr / 2 ; try the next size down...
endif
wend
#endif
I did receive the message: EEPROM address: 32768 Worked!!!
So now on to having my apps write stuff out. I will probably reserve the first 1K for non-sequences and then simply write the stuff out…
This diversion of downloading sequence to the Arc32 and then running them is taking a little longer than I expected, but making progress.
I now do have a VB application, that you can browse for EEP files and then download them to a Bap28\SSC-32 or Arc32. So far I have been able to take one with 3 sequences in it and download it to my test Bap28 with an SSC-32 and then plugged the SSC-32 into the PC and Sequencer was able to read and display the sequences
. I also think I have stuff downloading to Arc32, but have not been able to test what was actually saved yet. Now hacking up Phoenix code to try running them…
Here is a screen shot of the VB app after it downloaded:
I have the app output more information than what is necessary, but it helped me debug…
If anyone would like to play with this, I can upload the code and/or compiled VB app…
You never stop to amaze me Kurt!
It would be fun to try out this one time, so if you are willing to share the VB app, that would be awesome!
(I’m just waiting for some Lynxmotion parts to make my ARC-32 project done… )
Thanks it still is a work in progress. Probably OK now for simply moving EEP files from one phoenix to another without having to dig in and get to the SSC-32.
Now trying to decide on how to handle things on the Arc32. This involves both what is saved and translations/transformations to the data and when/where to do it…
Issues include: Pin number differences. - Your EEP files you create for your phoenix using SSC-32 will probably use different pin numbers for the servos than what I will use on the Arc32. Do I assume the pin numbers are correct? Have hard coded translations. If so on VB side or Bap side? Or should I have the VB app have a user settable translation which they can turn on or off. The later is probably better but more work…
Sequence servo values: on the Arc32 should I save them in the same format: 1500 center… Or should I translate them to the corresponding HSERVO values, before I save them. That way I don’t have to do it each time I run the sequence. I am now leaning toward that…
I would like to add more bidirectional capabilities. That is I would like to be able to know what sequences are on the BAP/SSC-32 and be able to Replace/Append sequences… Maybe later: first want me phoenix to walk and play…
Note: the vb app in the zip file was created using beta2 of VB 2010. I think I have all of the sources in it as well as a compiled exe…
Kurt
Edit: I updated the VB app that it now shows the sequence information…
I have made some more progress with the phoenix. need to work more in cleaning up the wiring and it looks like my servo zeroing is still a little off. I changed the servo zero program to store full words instead of bytes for the offsets as on the SSC-32 it uses registers which are 32 bits…
I then played with the Sequence download VB program and Arc32 program. The VB app is working OK:DownloadSeqs.jpg
It shows the sequences and it does have another form/dialog that can remap the pin numbers…
The main phoenix program appears to walk and do body rotates and the like. It uses the servo offsets and today I finally got it to run a sequence which was downloaded with the other programs…
Also while I was trying to debug what was stored out on the EEPROM and why the sequence was not working, I wrote a quick and dirty EEPROM dump utility. You can enter in the starting address in decimal or hex (0xffff) followed by a space and optional count of bytes. You can also switch the dump to signed or unsigned decimal numbers…
Working with PS2 - Mine is currently having some issues staying synced up properly on the Arc32. Might be a slight timing issue. Am investigating.
Side note: I missed having sound on the Arc32, so purchased a a 8-ohm mini speaker from Radio Shack (273-0092) and I currently have it hooked up straight to P19 on the Arc32. Changed the code to use a defined constant instead of P9. Nice having startup sounds again. Need to find a nice place to stick it on the Phoenix. (Not much room)
Looks like your having fun! Great progress. I’ve not tried your baphexsf yet, just read your comments. Are the offset limited to +/-1900 (sbyte when /15) only now that you use sword sized offsets?
I like your suggestion of adding a speaker to the ARC-32.
I watched your sequence video, great work! But did I see correctly if some of the legs (especially the front right) need some adjustment?
Currently I have it set for a maximum offset of 2000, But since I last uploaded the program I finally changed the code to keep it from being hard coded and instead uses a defined constant (MAXOFFSET con 2000). There is absolutely no reason I can think of, that if this offset is not sufficient, you could not make the Max 4000 or … I just left it at 2000 as with about 200 hservo units per degree on the arc32, it gave me ± 10 degrees. Forced me to have to move some servo horns…
Thanks, I think BM will be offering some stuff like this at some point. Just be careful that you don’t purchase something like the radio shack 273-074, like I first did as it turned out to be a buzzer
Thanks, and yes it did still need some more adjustments. I think some of my first attempts to download multiple sequences may have overwritten my offsets. I need to figure out if my board has 32K (like the production boards will have) or only 4K (like first prototypes as they had these laying around) eemproms. If only 4K, then check to see if the write beyond this went to never never land or did it wrap around and write some place else… Yesterday I did reuse the offset program and now all of the feet are on the ground.
I have been playing some more with the sequence download code. I thought it would be fun to see if I could get the code to understand the .CSV files that PEP generates, so I and/or others do not need to have to go to SEQ to convert to EEP files to download.
Also since our Arc32 boards currently maybe only have 4K of EEPRoms I am changing the code to show each sequence in a list that has checkboxs, such that we can choose which ones we want to download now. The list and checkboxs are in place still a little clean up. I have not updated the actual download code yet to check the state of the checkboxs yet.
Zenta, I am not sure if my .CSV file and the .EEP file are consistent with each other? Also trying to figure out how best to convert the angles that are stored in the CSV file to pulse widths. At first I thought I could do it simply like:
pulse width = 1500 + (angle/90.0)*1000 (This assumes 500-2500 range maps to -90 to 90 degrees). I know that this is probably off by some. Looking at Pep, when you are talking to the SSC-32 you have it calculated by table lookup for each servo, where you have different multipliers for each servo and the multiplier is different for positive and negative angles. But my question is when you pass the information off in the .CSV file and/or SHP file, I don’t see where these conversion factors are passed on to SEQ.
My conversion of the csv file is not looking very close to the info in the EEP file. for example in sequence1 steps 1 and 2 the values are:
My guess is that the SEQ is doing the same calculation as I was doing to convert the angle to pulse width. I updated mine for now to convert using the same formulas as we did on a Bap28 for the brat and the like: HSERVO = angle * 166.6 Then using the formulas for converting pulse widths to hservo value: pw*16 - 240000. So I reversed the math and it comes up to something like: pw = 1500 + angle * (166.6/16)…
I finished this round of changes. I can now read in either the EEP files or CSV files and the list of sequences show up in list with checkboxs. So you can now check which sequences you want downloaded. I confirmed on my test BAP/SSC-32 that the sequences were readable after the update…
I uploaded a zip file with the stuff. There is an application that runs on either Bap28/SSC-32 or Arc32. There is the VB10 code. The full solution for VB10 is there. But if some wants to try playing with it, their is a Retail directory which has a compiled version of the VB app…
Now back to playing with the Phoenix with the Arc-32 as well the VB program I had for downloading sequences.
On the Arc32 I started to develop a keyboard monitor that runs on S_IN/SOUT (actually HSERIAL), that I currently only call when the Bot is not active. May relax that in a bit. With this monitor, I can now enter commands to do some of the following:
D <EEPROM addr> <cnt> - Does a memory dump of the specified EEPROM locations. Defaults to hex byte, but can output decimal words, and signed decimal words as well
O - Enters Servo offset mode
S - Download Sequence(s) Note this only works with the VB code as after the initial line is binary data with acks...
T <debug level] - Displays the current debug level or sets it. This allows me to set bits for debugging different things and be able to turn them on or off at run time.
V <sn> = This will display the sequence. with 1 line showing the servo pins and the following lines showing the Time and servo values for each step.
I have enhanced my VB Download sequence program, where now I can resize all of the lists (List of Sequences, Sequence data for the currently selected Sequence, and status output listbox). I then added the capabilities of a real dumb terminal program to it. So you can now connect to the comm port (which then runs on a secondary thread). I added a text box that you can enter lines into which are echoed into the status listbox and any lines of text received on the comm port are also added to the status list. This status list now also me to select line(s) and has a context menu where I can clear it, select everything, and do a copy to the clipboard…
So for example from a current session I can then show a sequence that was converted to run on my phoenix:
[code]*** Thread Start ***
Phoenix-Arc32 keyboard monitor
D ]] - Dump EEPROM memory
O - Enter Servo Offset mode
S - Download sequence(s) - VB call only
T ] - Set or show debug Trace level
V - View Sequence
In case some one wishes to play around with it I have uploaded my current versions of the VB app and also my Arc32 phoenix code. Warning: I have not updated the Download Sequence program in the zip file to work with the updates to the Basic program. I can easily do this if others wish to try this out.
EDIT: In the Download Seqs.zip file is now a preliminary updated squences utility program for the Bap28. It appears to still have some problems downloading the first sequence in the list???, but it appears to allow downloads of the others. It also allows you to dump the SSC-32 EEPRom and it also allows you to view a sequence out of the SSC-32 memory. Note: the View command is 0 based, the display is 1 based, but…
Code for download of sequences appears to be working fully for both Bap28 with SSC-32 and my Arc32 code. Changed Arc32 to save values now in Pulse widths (same as SSC-32) and I translate to Hservo values when I run them. Fixed problem from previous post for first item in the CSV or .EEP file not downloading on Bap28. Not enough memory… Now downloads are saved with each packet of 32 bytes downloaded…
So now with the VB and Program on Bap you can download sequences, view them, dump EEProm memory…
Wow Kurt, thanks! this looks great! I’m sure this will become a very popular thread when the ARC-32 is available. I here it is coming along nicely. Thanks again!
The other thing I thought people might be interested in, was the ability to download sequences to their robot (from either EEP files or CSV files directly out of Pep) without having to change the wiring on their robot… (Could possibly integrate the VB code into PEP to do this…)
I’ve just started testing out your code for the ARC-32. Really impressive work again Kurt!
The servo offset mode seem to work very fine. I got some strange letters on the terminal, maybe different baud rates where used? 38400 seemed to be correct for the servo offset part though.
Since you defined both USESP2 and USEXBEE I guess you are using both? At first I just want to use the DIY XBEE remote (remarked the USEPS2 con 1 line).
I just can’t find to what pins (on the ARC-32) you connected the XBEE module? EDIT:
Oh, you did already write about that …
Looks like there are no need for the RTS… 2. EDIT:
I tested it with the XBEE module I used for Phoenix and it seemed to work very fine! I had only one servo connected though, but from the respond from the DIY remote and the text strings that came up on the DIY remote everything worked fine!
Btw, do you have any update to this code before I start converting it for controlling a biped?
I am doing OK, still taking it easy with my right hand, but…
Thanks, it has been awhile since I played with Arc32. Been playing with C phoenix, plus roboclaw… I think the last change was a month ago 4/7 and it looks like the zip file is the last updated file so I think it should be up to date.
I think I used 38400 everywhere for debug terminal as it is a uart…
You plug it into the HSERIAL2 IO pins TXD2/RXD2, which are in a real funky location. It is on the Aux1 header, which is those pins sticking out horizontal from the board near the power pins. If you look at the official data sheet: downloads.basicmicro.com/downloa … _B0010.pdf on page 9 it will show the pins. I used the IO pins on Aux header 2 to control the PS2. I have set it up for this code as well as my C Phoenix code that I can build with both of them…