6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 3:07 pm

All times are UTC




Post new topic Reply to topic  [ 149 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10  Next
Author Message
 Post subject:
PostPosted: Fri Sep 16, 2011 9:44 pm 
Offline

Joined: Tue Aug 16, 2011 6:18 pm
Posts: 74
Location: USA Pa
WoW wasn't expecting that ... Great for robotics where getting from point A to B should be a fluid movement .. But if your doing CNC with it you would have to just send 1 Axis move at a time or it would alter the shape your trying to produce... I will have to try it once I'm up and running again and see how it behaves..

_________________
When falling from a high place, You might as well try to fly


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Sep 16, 2011 10:12 pm 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
I think this is what you would want your CNC machine to do.

You send it start and end coordinates and it moves between them in as close to a straight line as possible.

The TeachMover does that in six dimensions simultaneously.

Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Sep 16, 2011 10:17 pm 
Offline

Joined: Tue Aug 16, 2011 6:18 pm
Posts: 74
Location: USA Pa
Pretty astounding little program for just 4k of code... Starting to see where the 6502 fast Interrupt response comes in handy for robotics..

Lee ... Thought I would mention this because its probably embedded in the code your looking at and may cause confusion as to what you are seeing... Because of the way the Robot is cable driven, As you move the shoulder and elbow the gripper cable changes length so the gripper motor has to constantly readjust to keep the jaws in the same relative position... You may also find other code that compensates for cable length changes, Like the shoulder affecting the elbow cables .. It's one of the downfalls of cable drive... but I keeps the Robot from having to lift the weight of its own motors..

With Concurrent movement, It depends On what you were trying to do, It can be a Plus or a Minus... But as long as you were aware of how the program operates.. You can easily modify the way you send the control commands, To get your desired result... Maybe the TeachVAL program lets you send Simultaneous or Sequential move command sequences... like you may want to move up and left at the same time to move a cutter to a new start point, But then straight down 50 steps as when placing the cutter on the project and then cut material for 200 steps to the right... You wouldn't want the last two commands to run concurrently..

Question; Anybody chime in,, On the Microbot board they are double inverting Phi2 using 2 inverters in the LS14, In essence creating a 40ns delay line on that clock signal going to all chips that require it including the LS138 decoder, Can anybody think of a reason why they are doing that... Seems it would break some rules and possibly cause some overlap with Phi1 on the trailing end of Phi2...

_________________
When falling from a high place, You might as well try to fly


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Sep 17, 2011 1:24 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
falcon5252 wrote:
Is there a 6502 Basic that can be compiled or am I out of luck on that...

[plug] A robot like that is an ideal vehicle for becoming acquainted with the Forth programming language! From the Wikipedia article on Forth:
Quote:
A Forth environment combines the compiler with an interactive shell. The user interactively defines and runs subroutines, or "words," in a virtual machine similar to the runtime environment. Words can be tested, redefined, and debugged as the source is entered without recompiling or restarting the whole program.

Memory requirements for Forth are modest and the performance varies from fast to blistering. And you can count on lots of enthusiastic support from the Forth fans on 6502.org :D [/plug]


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Sep 17, 2011 3:04 am 
Offline

Joined: Tue Aug 16, 2011 6:18 pm
Posts: 74
Location: USA Pa
FORTH May be compact and powerful but doesn't look like the syntax is very intuitive to learn.. I looked at a couple of code sequences very abstract language...I don't know if I'm up to the challenge... I think I'll stick with Basic for now.. I could put in one of the Banked flash memory blocks and toy with it .. How much prom space does it require

_________________
When falling from a high place, You might as well try to fly


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Sep 17, 2011 3:59 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
falcon5252 wrote:
FORTH [...] doesn't look like the syntax is very intuitive to learn..
Fair enough, I admit it may seem alien. But if an experienced person were there and you could watch as they whipped up and tested some robot Forth, the light bulb would go on for you in a big way. I bet a live tutor would have you flying in short order. Hard to convey that except in person, though.

Quote:
On the Microbot board they are double inverting Phi2 using 2 inverters in the LS14, In essence creating a 40ns delay line on that clock signal going to all chips that require it including the LS138 decoder, Can anybody think of a reason why they are doing that... Seems it would break some rules and possibly cause some overlap with Phi1 on the trailing end of Phi2...

Some extension of the trailing edge of Phi2, yes exactly. I haven't studied the wiring details but the delay would have been added to improve their timing margins. When the 6502 does a read cycle it records (latches) what's on the data bus data at the end of Phase 2 (no added delay). If the device being read (ie, driving the bus) continues driving the bus a few extra nanoseconds, that guarantees valid data remains until well after the 6502 has "taken the picture," as it were. There are actual spec's for all this, of course -- setup time, hold time etc, as shown on the data sheets for the devices in question. Hope that helps,

Jeff
ps- instead, it's also possible their concern was with a write operation. It's more than I can explain at the moment, but the same general principle applies: the transmitting device needs to put valid data on the bus and the receiving device has to capture it -- all within mutually acceptable timing windows. The 'LS14 inverters delay the peripheral device but not the 6502. Presumably they thought the relative timing between them would be better with the peripheral device delayed.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Sep 17, 2011 5:33 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Quote:
FORTH May be compact and powerful but doesn't look like the syntax is very intuitive to learn. I looked at a couple of code sequences very abstract language. I don't know if I'm up to the challenge. I think I'll stick with Basic for now.. I could put in one of the Banked flash memory blocks and toy with it .. How much prom space does it require

Actually, Forth hardly has any syntax. :D It's not hard to learn, but it is an entirely different way of thinking; and it was my experience that although I initially thought I saw things it would never be able to do, at least not gracefully, as I gained experience I found that it not only could do them, but extremely elegantly-- it's just that much of the capability does not initially meet the eye. Its extreme flexibility tends to make good programmers better and bad ones worse.

You can get under the hood and modify or extend the compiler itself, for example to make a new kind of program structure or data structure or other defining words, or even define new operators. Forth had the tools to do OOP even before it was called that. (You don't particularly have to understand that yet just to get gong though.) You can develop applications much more quickly than you probably ever thought possible, and with less debugging necessary. You can mix assembly in with high-level Forth, and you can also write words (routines basically) in high-level Forth to prove a concept and then re-write them in assembly for maximum performance if desired, without changing the routines that call them. You can dictate that your creations will have one behavior at compile time and another one at run time. Everything you write becomes part of the language itself.

Uh-oh, I feel myself starting to be an excited salesman again. I better stop.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Sep 17, 2011 12:12 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
If one were interested in just getting started with Forth, let's say on a C-64 system, what book or program would you guys recommend?

And just for comparison what type of environment are you both (Jeff & Garth) using Forth on now? compared to the early days of home computers?

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Sep 17, 2011 3:46 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
ElEctric_EyE wrote:
If one were interested in just getting started with Forth, let's say on a C-64 system, what book or program would you guys recommend?

Hmmm... should we open a thread in the Forth section for this?

My own first experience with Forth involved the FIG (Forth Interest Group) release for the 6502. The source listing FIG FORTH 6502 [FORTH65.ZIP: 32KB] is downloadable from the Monitors, Assemblers, and Interpreters section here. That's not an introductory text but you'll get to see how FIG Forth is composed of lots of short routines (aka "words"), which mostly tend to be short & simple and are written either in machine code or Forth, or occasionally a mixture.

Earlier I quoted the line, "A Forth environment combines the compiler with an interactive shell. The user interactively defines and runs subroutines, or "words," in a virtual machine similar to the runtime environment." I should have emphasized that there's NO hype or marketing in that statement, and you needn't be intimidated by all the apparent buzzwords. For example, the "shell" is not some glitzy GUI -- it's common to just use the command line. You'll find that that same sort of surprise -- "oh, it's simple!" -- will pop up again and again. Forth is bloat-free, stripped to the bone, and so fundamental, open and just-common-sense that it's downright subversive! Hmmm... like Garth, I'd better shut up soon.

Quote:
And just for comparison what type of environment are you both (Jeff & Garth) using Forth on now? compared to the early days of home computers?
Frankly, my Forth environment has pretty much stayed the same! Simple, right? But the PC platform has brought me access to much better text editors and file storage.

I don't do much coding nowadays but when I do I use a mutant Forth that used to be more or less 8086 FIG Forth. But I reworked the kernel to switch the "cell" (basic integer) size from 16 bits to 32, and to boost the address space from 64K to 1 megabyte, with addresses passed on-stack as "flat" 20-bit values. It all runs in Real Mode on an embedded 8088, 80186, 486 etc, and naturally on the PC platform also. If needed, of course, there are much more powerful Forths out there.

-- Jeff


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Sep 17, 2011 6:56 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
An excellent place to learn Forth is Leo Brodie's book "Starting Forth". My copy is copyright 1987. It's definitely dated in how it refers to things like disc sizes and the super-minimalist screen editor, but the timeless fundamentals of Forth are presented clearly and humorously. A free online transcription which aparently has been edited to add some ANSI-standard Forth info is available at http://www.forth.com/starting-forth/index.html . I haven't been through this one myself to give an evaluation, but at first glance it looks good. They even preserved the old cartoons which were a riot, something other online transcriptions have not done.

There's a follow-up book by the same author called "Thinking Forth" which is really more about programming methods and structure and not just about Forth. Once you've gotten a good start in Forth, this book will benefit your programming in any language.

I think the FIG-Forth source code on this website (at http://6502.org/source/ , about 70% down the page) was for the Apple II and the assembler that came with it (which was apparently not a nice macroassembler, judging from the source code). It is an assembly source to build the initial Forth kernel. After you get that going, you can expand it using Forth itself. Wally Daniels (a member here who doesn't check in often) ported it to another 6502 platform and got it going. Be aware that this source has the 32-bit division bug which I give a solution to at http://6502.org/source/integers/ummodfix/ummodfix.htm . Bruce Clark has a version he says is a little faster (I haven't tried it, but I trust him because he's great at algorithms) which I thought was in the wiki at http://6502org.wikidot.com/start but I can't find it.

If an SBC Daryl (8BIT) or someone else produces becomes kind of a standard that quite a few people are using, I would like to port my '816 Forth to it so the beginner would have a turnkey Forth solution that would work right out of the box. Something like that is sorely needed. I'd like to do it with my '02 Forth also but I would have to re-write portions that are left from some copyrighted material from a metacompiler we bought 20 years ago. I've already modified it so heavily (to fix bugs and add features) there probably wouldn't be any problem, but I want to stay safe.

Quote:
Hmmm... should we open a thread in the Forth section for this?

Go ahead if you want to, but I put my response here because this is material that I know I have previously posted in the Forth section in various forms.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Sep 17, 2011 7:46 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Quote:
And just for comparison what type of environment are you both (Jeff & Garth) using Forth on now? compared to the early days of home computers?

I'll jump in again here because I see I didn't answer this question above. For me, it hasn't really changed since my post, the third post at viewtopic.php?t=1368 , although the monitor pictures there do not show actual Forth code.

And copy-and-pasted from another post:
My 6502 use is geared more toward controlling things and taking data on the workbench, as opposed to being human-I/O-intensive like consumer PCs; so my workbench computer just has a 16-character LCD and 5-key keypad which is usually enough. I do the software development on the PC so I have the hi-res monitor and keyboard and mouse there plus the programmer's text editor and file-keeping capability, and just feed text over an RS-232 line to the workbench computer, which assembles, compiles, or interprets, as approriate, on the fly. The PC doesn't need any special software to do that, as it just thinks it's printing out sections of the source code file to an RS-232 printer. I could even use my HP handheld computers as hosts, but eventually I would like to have a workbench computer completely independent of a host computer. I have a few bigger LCDs (like 40x2 and 40x4 intelligent character LCDs, not graphics LCDs) which I have hooked up and watched work too, but have not really used them.

It's hard to communicate just how simple it is to do this. Maybe someday I'll post a video.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Sep 17, 2011 10:53 pm 
Offline

Joined: Tue Aug 16, 2011 6:18 pm
Posts: 74
Location: USA Pa
If Anybody is interested, This is the list from the Allegro site, And lists all current DC Motor and Stepper Motor driver chips currently in production, There are still a few DIP package devices Left.. But they are mostly step and direction devices in Serial and Parallel control,, Keep in mind 6 wire Uni-Polar stepper's as found in this robot can be run in Bi-Polar mode..

http://www.allegromicro.com/en/Products ... /motor.asp

Here's a valuable little freeware tool, It's called Universal Extractor v1.61.. It installs as a shell extension , And it will extract any compressed installation file,, Like, Install Sheild, MSI, EXE, and most things WinRAR won't touch.. If you need a couple of files from a install or just want to snoop its great.. Sometimes the format you get is not what you expect but by matching file sizes will help You find the file..

http://legroom.net/software/uniextract

Guess I throw this in to,, Nirsoft Freeware utilities .. Especially useful are their USB, Bluetooth, Network Diagnostic utilities.. Most run from a exe and require no installation..

http://www.nirsoft.net/

_________________
When falling from a high place, You might as well try to fly


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Sep 18, 2011 4:13 am 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
Disassembly complete.

Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Sep 18, 2011 4:59 am 
Offline

Joined: Tue Aug 16, 2011 6:18 pm
Posts: 74
Location: USA Pa
Lee ... Great, It looks good.. It has to be the best notated code I have ever seen... Now what neat things can we do with it..

Did you see my questions a quite a few messages back.. About how hard is it to relocate I/O and working Memory area.. Basically port it to a new board Or fully decode the I/O on the present board into a 2k block from $0800 to $0FFF.. And change the base addresses in the code.. Does it use globally declared base addresses and then offset from them or are they all hard coded.. I could probably figure it out if I stared at the code long enough but its easier to ask... But if I had to Guess it looks hard coded..

Going to dump the prom from the new board I just bought as soon as I get it .. Don't know if it will be very interesting.. All I know is it was made by Star Arcade.. I emailed a pic to Tony but he does not recognize it.. Will post it to see if there is any interesting code in it... looks like a 16 or 32k prom and 16k ram with R65C02P2 with 2 VIA's and allot of data drivers and latches to sip & dip connectors...Looks more like a controller board of some sort...

I bought it cause its a nice compact project board..

_________________
When falling from a high place, You might as well try to fly


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Sep 18, 2011 5:37 am 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
Quote:
About how hard is it to relocate I/O and working Memory area.

Easy now, just change the equates that set the addresses at the start.

Quote:
And change the base addresses in the code.

Unless I've missed something that should just be a case of changing the .ORG at the start of the code and putting another .ORG in before the hardware vectors.

I've updated the archive to remove some typos (I never see them until after I post it) and put in the second .ORG as a comment.

Quote:
I emailed a pic to Tony but he does not recognize it.

Care to post it somewhere so we can all take a look?

Lee.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 149 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10  Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 13 guests


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

Search for:
Jump to:  
cron