BasicMicro - Forums

www.basicmicro.com
It is currently Sun Sep 05, 2010 11:23 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 80 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: New Manual
PostPosted: Thu Dec 17, 2009 12:08 pm 
Offline
Master

Joined: Mon Jul 17, 2000 10:00 am
Posts: 151
We have decided to make the new manual available as its being worked on (WIP). Every time something is updated I will post a link here and public comment is invited. Typos, Grammer, Things that don't make sense, its all open for comment.

We are consolidating what would be 3 manuals into one. Currently the layout is being worked on. The first post should become available with in the next few days.

Also, any one contributing will be given credit for the world to see. Unless of course you want to remain anonymous.

_________________
Basic Stamp - On Steroids!
DC Motor Speed Control - Robo Claw!
Servo Controller - ARC32!


Top
 Profile E-mail  
 
 Post subject: Re: New Manual
PostPosted: Thu Dec 17, 2009 12:42 pm 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 291
Sounds great,

I will help when I can :)

Kurt


Top
 Profile  
 
 Post subject: Re: New Manual
PostPosted: Fri Dec 18, 2009 2:46 pm 
Offline
New User

Joined: Thu Jul 23, 2009 12:41 pm
Posts: 2
:D
What a great Christmas gift to all your users, thank you. Will eagerly await the first post.
Peter Strong (atomtonano)
:D


Top
 Profile E-mail  
 
 Post subject: Re: New Manual
PostPosted: Sat Dec 19, 2009 7:54 pm 
Offline
Master

Joined: Mon Jul 17, 2000 10:00 am
Posts: 151
This is a unified manual. Its work in progress. I'm focusing on all the non timing critical commands first. Once that is complete then its onto things like hservo, adin, hwpm and so on. Afterwhich it will be math. The last part will be a tutorial on the IDE, Terminal window and built in ICD.

There is a supported list for every command. If the command is supported but some timing or syntax is different it is noted in the support list.

Supported
BA - Supported.
BAN - Supported.
BAP - Supported.
BAP40 - Supported.

This first post is not checked for grammer and I currently no concerned with it. The first pass of the manual is getting the comamnds in place with real working sample code. I wrote every piece of code and tested it until working as expected. There are notes on the side where something is broke. This is for Nathan to use to fix the compiler. The plan is to release this manual with everything documented and anything needing fixed completed.

The first pass of the manual I'm using AtomPro. I have tested most of this on the Nano. Once the commands are all in there I'll go back over them and test with Nano / Atom before moving on to the other sections.

I suspect it will take me at least until January to finish. We are taking our time to get this right ;-)


Attachments:
AtomPro_wip.pdf [41.67 KiB]
Downloaded 118 times

_________________
Basic Stamp - On Steroids!
DC Motor Speed Control - Robo Claw!
Servo Controller - ARC32!
Top
 Profile E-mail  
 
 Post subject: Re: New Manual
PostPosted: Sat Dec 19, 2009 10:22 pm 
Offline
Master

Joined: Mon Jul 17, 2000 10:00 am
Posts: 151
New update.


Attachments:
All_Atom_wip.pdf [54.04 KiB]
Downloaded 96 times

_________________
Basic Stamp - On Steroids!
DC Motor Speed Control - Robo Claw!
Servo Controller - ARC32!
Top
 Profile E-mail  
 
 Post subject: Re: New Manual
PostPosted: Mon Dec 21, 2009 12:05 am 
Offline
Master

Joined: Mon Jul 17, 2000 10:00 am
Posts: 151
Finished Count and Button. Started I2CIN / I2COUT, sample code was written and tested on AtomPro28 and Nano40. Monday I plan on wrapping up I2C and trying to finish PWM, HPWM and maybe SOUND / SOUND2.

All Atom Manual WIP v4.


Attachments:
All_Atom_wipV4.pdf [66.32 KiB]
Downloaded 85 times

_________________
Basic Stamp - On Steroids!
DC Motor Speed Control - Robo Claw!
Servo Controller - ARC32!
Top
 Profile E-mail  
 
 Post subject: Re: New Manual
PostPosted: Mon Dec 21, 2009 7:39 am 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 291
I am glad to see it coming along :D

A couple of quick comments:
1) Personally I find it easier to read your examples when you indent the stuff within ifs or loops.
For example you for/next loop in the LOW example makes it easy to see what is in the loop. Would be nice if you did similiar in the do/while, while/wend, and repeat/until. Example, I find something like:
Code:
;ALL - all_repeat_until.bas
Index var word
Main
   Index = 0
   Repeat
      index = index + 1
      ;lets print the value index
      serout s_out, i9600,[0, “Couting: “, dec index]
      pause 75
   Until index > 100 ;run until index is greater than 100
   serout s_out, i9600, [13,13, “Index = “, dec index]
   serout s_out, i9600, [13, “My condition is no longer false.”]
   serout s_out, i9600, [13, “Index is now greater than 100”]
End

Easier to read and follow than the current:
Code:
;ALL - all_repeat_until.bas
Index var word
Main
   Index = 0
   Repeat
   index = index + 1
   ;lets print the value index
   serout s_out, i9600,[0, “Couting: “, dec index]
   pause 75
   Until index > 100 ;run until index is greater than 100
   serout s_out, i9600, [13,13, “Index = “, dec index]
   serout s_out, i9600, [13, “My condition is no longer false.”]
   serout s_out, i9600, [13, “Index is now greater than 100”]
End


2) Example in the Goto command. I think it might confuse people to have 2 gotos in a row, where one can never be used (i.e. it is dead code).
Code:
basic
   Pause 800
   serout s_out,i9600,[0, “Basic”]
   pause 800
   goto micro
   goto basic
micro
   ...


Again I am very happy to see that this is coming along!
Kurt

P.S. - Would you prefer the comments like these in this thread, different thread, or email?


Top
 Profile  
 
 Post subject: Re: New Manual
PostPosted: Mon Dec 21, 2009 5:04 pm 
Offline
Master

Joined: Mon Jul 17, 2000 10:00 am
Posts: 151
Here is fine. Once the manual is "done" I'll delete most of it and use this forum for errors and omissions. Also post what version you make a referrence to. I'm updating spelling and grammar as I go. I'm changing things around allot. So every version may have something tweaked. No I can't make a list of what I did. This is already a fairly big task ;-)

Also get ready for allot of code to be broken. I noticed some timings were changed for commands like sound which was silly. I'm making Nathan change the commands that dont need microsecond timing back to millisecond. He also made some changes to I2C which are more generic but I think you may already know about these. Any other oddities will be addressed during the writing of this manual. After which whether anyone agrees are disagrees all comamnds will be locked. No more syntax changes that break code.

_________________
Basic Stamp - On Steroids!
DC Motor Speed Control - Robo Claw!
Servo Controller - ARC32!


Top
 Profile E-mail  
 
 Post subject: Re: New Manual
PostPosted: Mon Dec 21, 2009 5:23 pm 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 291
Basic Micro wrote:
After which whether anyone agrees are disagrees all comamnds will be locked. No more syntax changes that break code.

Thank You :!:


Top
 Profile  
 
 Post subject: Re: New Manual
PostPosted: Mon Dec 21, 2009 11:31 pm 
Offline
Master

Joined: Mon Jul 17, 2000 10:00 am
Posts: 151
My head hurts, but here is an update. It took me all day to finish I2C. I tried to cover it all since it seems people get hung up on I2C. There are 3 example programs. 1, demo byte address. 2, demo word addressing. 3, demo paging. It also spells out the A0,A1 and A2 pins and how they affect the commands.

I think most people that had issues were connecting the I2C eeproms wrong. I tested 24LC01, 24LC08, 24LC256 and 24LC512. Yes 24C are same as 24LC expect volt range and temp. ALL 8 pin will be connected somewhere. So if you have a free pin, you got it wrong. Even WP needs to be tied to GND.

Tomorrow I'll start on HPWM since that saw some recent changes. I'll probably focus on some easier comamnds so I at least feel like more got done.

BTW, all sample code I have saved and will release soon along with the manual.


Attachments:
All_Atom_wipV5.pdf [74.06 KiB]
Downloaded 107 times

_________________
Basic Stamp - On Steroids!
DC Motor Speed Control - Robo Claw!
Servo Controller - ARC32!
Top
 Profile E-mail  
 
 Post subject: Re: New Manual
PostPosted: Tue Dec 22, 2009 10:07 am 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 291
Hi Nathan,
I did a pass through the I2C section of ...v5.pdf

Same minor comments about indenting of loops and the like helps me in reading code...

First sentence of Description of IC2OUT mentions IC2IN.

Something that confused me earlier is that you mention: SCL and SDA as the pins. So you look at the module pin outs and see that the hardware pins are P6 and P7. But with these commands you don't need to use these hardware pins and if you do may cause problems...

What happens if there is an error. For example the address is not found. In the older versions of the command there was an optional error label that the command would jump to if for example the device did not respond.

Also it would be nice to have another example showing some other type of hardware. For example an SRF08. I hacked up some older code I had to the new format, but I have not tested it yet. (Need to reset up breadboard and the like:
Code:
SDA   con P0
SCL   con P1

;===================================== SRF08 =================================================
;
; SRF helper functions      
SRF08a   Con 0xE0   ' 1st Sonar I2C Address
SRFCmdReg   Con 0      ' Sonar Command register
SRFLightReg Con 1      ' Sonar Light sensor register
SRFRangeReg Con 2      ' Sonar 1st Range register

wRange      var word
wRangePrev   var   word

;================================ Main Loop =================================================
   wRangePrev = -1      ; make sure it won't match the first time...
main_loop
   gosub SRFPing[SRF08a], wRange;
   if wRange <> wRangePrev then
      serout s_out, i9600, ["Range: ", dec wRange, 13]
      wRangePrev = wRange
   endif
   pause 500
goto main_loop

;------------------------------------------------------------------------------
; Simple Ping function
;------------------------------------------------------------------------------
srfAdr var Byte
srfRange    Var Word   ' 16 bit variable for Range
SRFPing[srfAdr]
    I2COut SDA, SCL, srfAdr, [SRFCmdReg, 80]   ; do a ping in inches...
    srfRange = 0
   pause 67
      
    ; lets try to wait until the Ping completes
    I2COut SDA, SCL, srfAdr, [SRFRangeReg]   ; do a ping in inches...
    i2cin SDA, SCL, srfAdr, [srfRange.HighByte, srfRange.LowByte]
      
   return srfRange


Again I have not tested this, not sure what happens if hardware not found... Used to depend on it not responding as a way to say the ping is not done yet.

That is all for now.

Kurt


Top
 Profile  
 
 Post subject: Re: New Manual
PostPosted: Tue Dec 22, 2009 11:38 am 
Offline
Master

Joined: Mon Jul 17, 2000 10:00 am
Posts: 151
I2Cout / I2Cin are software based. All the code in the manual is tested and guaranteed to work. The manual was setup as a 8.5x11 which is full page. Some example programs are to long on each line and won't allow me to indent as much as I would like. But referrencing the BS2 manual they indented even less ;-)

You are correct about the error label. I'll add that back in there. Also couldnt think of anything else for I2C. Dont have an SR08, but is this the mostly likely I2C device to be used ?

_________________
Basic Stamp - On Steroids!
DC Motor Speed Control - Robo Claw!
Servo Controller - ARC32!


Top
 Profile E-mail  
 
 Post subject: Re: New Manual
PostPosted: Tue Dec 22, 2009 12:41 pm 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 291
Sounds good,

As for the most likely other devices, that is always hard to say. I do think there are a lot of people doing robots with some of the Devantech sensors: Range finders: (SRF08, SRF10, ...), Compass, Thermal array. I believe I have also seen some real time clocks.

Kurt


Top
 Profile  
 
 Post subject: Re: New Manual
PostPosted: Tue Dec 22, 2009 3:27 pm 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 291
I forgot to mention other I2C uses I have seen up on Lynxmotion and other websites. Some have used them for IO expansion. Using something like: http://ww1.microchip.com/downloads/en/DeviceDoc/20090b.pdf

I also believe there are some AtoD versions of this as well.

Kurt


Top
 Profile  
 
 Post subject: Re: New Manual
PostPosted: Tue Dec 22, 2009 11:51 pm 
Offline
Master

Joined: Mon Jul 17, 2000 10:00 am
Posts: 151
I think the I/O extender is most usefull. I will order some and update sample code to the manual.

MCP23016-I/SP-ND

_________________
Basic Stamp - On Steroids!
DC Motor Speed Control - Robo Claw!
Servo Controller - ARC32!


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 80 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO