Hard Light Productions Forums
Off-Topic Discussion => Programming => Topic started by: JGZinv on September 07, 2011, 02:53:44 pm
-
Well while I'm sitting here unemployed I figure I might as well not waste my time at least,
and have decided I need something to study. Since I repeatedly get the deer in the headlights
look when I tell people I don't code (even if I am a PC tech)... I figure why not start there.
Most of what I hear about via job listings is either C++, Java, or what sounds like corporate specific
languages. But besides it's application here (being LUA, C/C++) I'm not sure what direction to take
or what might be a good book to start with?
If nothing else, even if I can't manage to grasp it entirely, I figure I'll at least be able to communicate better
around here and with other techs.
So what suggestions have you HLP?
-
My personal recommendation would be to start with the deep end and head straight for C++. If you have some experience there, the other languages derived from it, like Java and C#, will be much easier to learn. The reason why I recommend C++ over the other two is because IMO, a good grounding in programming close to the bare metal gives you a better appreciation, and a better capability to evaluate what the Java Virtual Machine (JVM) or .Net library (for C#) can do for you.
Just as a personal preference, I would stay away from scripting languages like Lua and Python until you are comfortable with the other languages mentioned above. While the entry for these languages may be lower, the possible depth attainable with them is lower as well; and some of them (like Lua) are downright ugly and encourage habits that may bite you later on, like Luas' typeless variables.
-
I would recommend starting with either Java or C# as I had the experience that those are easier and less frustrating to learn as with C++ you have to handle that whole memory and pointer things yourself but if you want to start to program on a level that is rather near to your hardware then I would indeed recommend using C++ for the reasons The E noted above.
-
I would recommend starting with either Java or C# as I had the experience that those are easier and less frustrating to learn as with C++ you have to handle that whole memory and pointer things yourself but if you want to start to program on a level that is rather near to your hardware then I would indeed recommend using C++ for the reasons The E noted above.
This is actually an argument to start with C++. It'll be a hassle to go from Java to C++ because Java does a lot of runtime error checking for you that C++ doesn't do, and that'll lead to huge problems down the road.
-
One thing I've read once (can't remember where) is that a programmer needs to understand four things. Variables, loops, recursions and pointers.
The first one will come easy to anyone who has done even slightly advanced math.
The second one, again, is relatively easy, but there are some pitfalls, the most common ones being known as fencepost errors or off-by-one mistakes.
The third one, well, this is where things get tricky. If you have ever done a proof by induction, this is very similar, but again, pitfalls exist. Namely, that unlike mathematics, computers are finite, and can only recurse a limited (albeit large) number of times before things get hairy.
The fourth one, pointers, is where most people will have problems. Pointers are an area where an uncautious programmer can wreak unbelievable amounts of carnage with a few simply typos.
Languages like Java and C# help you avoid the hairiest bits of pointer manipulation by hiding them under a layer of abstraction, but that same safety net will make things difficult once it's removed, because a programmer used to the automatisms of managed languages like those can miss a few of the intricacies of pointer magic.
-
Most of my uni classes have been in Java, and while I think there's a fair amount of irony in teaching, say, algorithm efficiency in a slow interpreted language, it's a good place to start.
Java and C++ have a lot of the same syntax (basic operators and flow control are almost completely the same, and the OOP stuff like the new keyword will become very familiar in either case), so you can really start with either one and move to the other. I'm in a class right now called "C++ for Java programmers"- I know a substantive amount of C and a little bit of C++, so what I'm really taking out of this class is the difference between Java and C++.
To put it simply, Java is sort of the "easier" language to start with. You don't have to deal much with pointers, as The_E said, which can be helpful early on but won't help at all in the long run unless you learn them early on. Also, Java has a very nifty garbage collector which automatically gets rid of anything you're no longer using. C++ makes you do this yourself- Once you no longer want to use an object, you'll have to delete it explicitly or you'll have a memory leak (basically, an accumulation of objects (memory) that your program is no longer using meaningfully but has not deallocated).
If I had it my way, the uni class I've taken would be in C or C++, as IMO (and this is a very uneducated opinion coming from a uni student, but take it for what it's worth) it's better to learn the complicated, routine stuff early on so you understand what's being done once you get to a higher level language like Java.
Also, one more thing
Do not write a game in Java
Looking at you, Notch
Seriously wtf I get 3 fps at times
-
Do not write a game in Java
Well.
No. Sorry. If Minecraft gets "less than 3 FPS at a time", that's more an issue of your computer rather than of Java. The whole "Java is slow" thing hasn't been true for a loooooooong time now.
-
Well let me put this out there...
I can't say I've ever been enthusiastic or great at math, mostly because it was shoved down my throat
throughout school. On the other hand I love structure, and form, having things setup in definable patterns.
Even within Fringespace, I've talked to various people that code and seem to help them resolve problems
even when I know little to nothing about the coding language they are using. Logical order and so forth seems
to come naturally.
*scratches head* So eh, I'm not intimidate by learning "higher level" math, but I'd sure like to probably
find the Idiot's Guide to it or get started with plenty of info at my own pace. Learning hands on seems to be
the best way to absorb and retain info in either case.
-
You don't really need "higher level" math to do programming unless you're actually doing higher level math in your program. It's nothing you should be worried about.
The_E: Sorry about the slow Java thing. I did some research and tried to correct some outdated misconceptions- it turns out that a Java program is 375.29845 times faster than an Assembly program that does roughly the same thing. In fact, I think I'll be using Java for everything I program from now on.
Is there any way to install Java on a slide rule?
-
My favorite language to code in so far has been C++, and I'll insist you start with that one.
Go over to, well, here: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express
...And grab VS 2010 C++ Express for free - I think they'll ask for a Windows ID (like Hotmail), but that's the end of it. There's a whole slew of online help tutorials for the program, many on HLP code in C++, and heck, I'll even send you a textbook if you're interested. I think as far as structure and order are concerned, you'll be hard pressed to find something better than C++.
-
The_E: Sorry about the slow Java thing. I did some research and tried to correct some outdated misconceptions- it turns out that writing a Java program is 375.29845 times faster than an Assembly program that does roughly the same thing.
fixed that for you
-
I'm being serious broski I ran some Java programs for benchmarking purposes and they turned my PC into a quantum computer
it executes an infinite loop in 6 seconds now
-
I'm being serious broski I ran some Java programs for benchmarking purposes and they turned my PC into a quantum computer
it executes an infinite loop in 6 seconds now
bah
the same program would run in three if you used visual basic
-
Let's not get distracted with who's is harder, better, faster, stronger now...
I did get another suggestion for C# this evening by a local guy..... but it would appear the consensus is C++ is the best place to start.
So looking at that, what are some of your favorite resources or good books you can recommend for starters?
-
http://www.cplusplus.com/doc/tutorial/
nothing beats having a project that you want to work on and a reference manual
-
As for books, I like Stephen Prata's C++ Primer Plus (http://www.amazon.com/Primer-Plus-5th-Stephen-Prata/dp/0672326973/). There's a new edition (http://www.amazon.com/Primer-Plus-6th-Developers-Library/dp/0321776402/) coming out next month.
I've found cplusplus.com's reference section (http://www.cplusplus.com/reference/) to be extremely helpful with looking up details about the C++ standard library.
-
C++ for the win, I'm gonna put my vote in that pile. Like others have mentioned before me, it's important to gain an awareness of stuff like memory management fairly early on. That and the fact that C++ is very widely used in industry, and (this has also been said before) it's very similar syntactically to several languages including Java.
Oh, and if you get good at C++ you can start programming for FSO! If that's not an incentive then there's something wrong with you. :D
-
This is all making me want to finally take a crack at looking at the SVN checkout that's sitting on my hard drive. :p
-
I feel odd saying that I'm starting my third year of a programming degree and I haven't had to touch C++. Almost every class (except ones specific to their language) has been done in straight ANSI C with the occasional dip into C99. Java was what we did in the class specific to Object Oriented.
Guess I really should do some C++ on my own time.
-
Which isn't a bad thing. I just recommended C++ as an entry point because it is a good OOP layer on top of C; your route really accomplishes the same thing.
-
Personally I think whether you start on C++ or Java is a matter of two things.
1. What you want to do with your qualification.
2. Your style of learning.
Let's deal with 2 first. If you would rather start hard and never have to relearn anything, pick C++. You'll have to learn pointers and deal with memory leak prevention right from the start (which makes learning the language harder). On the other hand you can learn Java first but when you learn C++ you have to remember that certain things which worked in Java won't work in C++
As for 1. The reverse is true is having learned C++ you want to learn Java. In Java many of the tricks you've learned in C++ simply won't work. If you only want to learn C++, do all your programming in it and never bother with Java, start with C++. But if you want to be able to get jobs in Java or C++ then you need to think about both points to determine which one you choose first.
-
I guess a relevant question then would be, what relationship has Java usage wise, with C++ - that having both is beneficial to some sort of project?
C++ seems like a foundation for a lot of programs, Java... while I know it claims to be used in controls or devices, I don't see it outside of doing Java updates
on PCs... Java script... etc.
Yes I'm not looking at it as a hobby, I should realistically be able to list on a resume that I've got some (insert choice here) experience and can back that up.
Basically what I'm planning is to review my A+ books since it's gotten fuzzy, then go into coding or Network+ study. How well I'll do depends on the materials and
how well I can apply myself. What I think I need is a good introduction to programming, so that I can find my way around from there.
-
Java... while I know it claims to be used in controls or devices, I don't see outside of doing Java updates
on PCs... Java script... etc.
Javascript is completely different. Also, I know at least one bank who've created their online banking service with Java.
-
Well, there you go. A good indicator of my level of familiarity with Java.
I've got more exposure to ActionScripting in Flash then... which amounts to about an hour or so.
-
I guess a relevant question then would be, what relationship has Java usage wise, with C++ - that having both is beneficial to some sort of project?
C++ seems like a foundation for a lot of programs, Java... while I know it claims to be used in controls or devices, I don't see it outside of doing Java updates
on PCs... Java script... etc.
Java is finding a niche right now in mobile apps. Android apps are written in a dialect of Java, for instance.
One of the great advantages of Java is that you basically do not have to care about differences between various operating systems, which makes it attractive for cross-platform products.
-
i find i end up doing a lot of programming in straight c. especially since i started programming microcontrollers. i also pretty much started with c when i was in highschool. i like c++ for game programming since classes are easier to work with that structs. starting with either one is a good idea. they are good middle ground between high level and low level languages. so c/++ gives you a good foundation for learning other languages.
i do like lua but for entirely different reasons. besides being interpreted and thus slow, the big problem with starting with lua is that it follows a completely different paradigm than most other programming languages. it attempts to combine features of arrays and objects to form tables and therefore is table oriented. lack of useful datatypes is somewhat annoying, sometimes i wish they would add an integer type since sometimes you need integer math. i should also point out that lua is a memory whore and elements within a table take more space than the data they contain. habbits learned in lua do not carry over well to other programming languages. it has its place but not as a way to learn programming.
-
I'm going to go against the grain and recommend NOT starting with C++. It has enough strange syntax and edge cases that learning that will trip you up and get in the way of learning the basics of actual programming. You'll want to learn it eventually, but I think it's a terrible place to start.
I'd actually recommend something like Python as a good place to start. The syntax is clear, the language is powerful, and you can use it for a wide variety of things.
It really depends on what you're trying to accomplish and how far you want to go. If you're interested in a career in software development, plan to learn as many as you can. If you just want to know something about how to program and potentially make your life easier, pick a language that focuses on flexibility and ease-of-use over speed or enterprise scalability.
-
Actually, I think it might be a good idea not to use an object oriented programming language to learn the basics, such as variable, loops, recursivity and pointers. I agree with Sushi : C++, while quite a powerful language, kinda has a weird syntax. I'd recommend you start with something not object oriented, like C, before moving to C++, Java SE, C#, Python or else.
Side note: whatever happens, stay the hell away from ADA
-
HOW TO WRITE CODE IN PYTHON
1) Write pseudocode
2) Indent
-
I'm going to go against the grain and recommend NOT starting with C++. It has enough strange syntax and edge cases that learning that will trip you up and get in the way of learning the basics of actual programming. You'll want to learn it eventually, but I think it's a terrible place to start.
I'd actually recommend something like Python as a good place to start. The syntax is clear, the language is powerful, and you can use it for a wide variety of things.
It really depends on what you're trying to accomplish and how far you want to go. If you're interested in a career in software development, plan to learn as many as you can. If you just want to know something about how to program and potentially make your life easier, pick a language that focuses on flexibility and ease-of-use over speed or enterprise scalability.
you'd be better off with Scheme, honestly
-
Urrrrrgh, Scheme. Utter not that name in my presence.
-
FORTRAN 77
:nervous:
-
What about object oriented cobol :D ?
-
I learned in pascal, the course then migrated to C+ and VB for the second year. not really programmed since college though so forgotten most of it
-
Actually, I think it might be a good idea not to use an object oriented programming language to learn the basics, such as variable, loops, recursivity and pointers. I agree with Sushi : C++, while quite a powerful language, kinda has a weird syntax. I'd recommend you start with something not object oriented, like C, before moving to C++, Java SE, C#, Python or else.
Side note: whatever happens, stay the hell away from ADA
i really think it depends on the angle youre coming in at, if your coming in from he hardware up, its better to learn something close to machine code, straight c, perhaps some asm. now if youre coming in from the software down, learn something with oop, c++ maybe java or interpreted languages. if you want to do game programming definitely learn something that is fast, like c. there is no definite learn me first language, it all depends on what you want to do with it.
also isnt ada meant for mission critical systems for things like medical fields and avionics, systems that if crash cause people to die? its a language designed to result in stable as **** executables.
-
Choosing which language to learn depends almost entirely on what you're wanting to do in the end, and the only way to really assess that is to experiment with different applications of programming--and by applications, I mean the different uses for programming--game development, utility applications (text editors, audio converters, that sort of thing), web application development, and the like.
My best advice would be to start with something C-like--if not C or C++, then something like Java or C# (I especially recommend Java and C# for entry-level, but that's just me). Try out as many languages as possible, get a bit of experience in each one, and then start applying the skills to little mini-projects--a small Breakout or PONG clone, for instance, or a simple OGG media player, or a simple content management system for a website--and whichever one you end up liking the most in the end, go for it.
If you want a bit of insight on how else to figure out what's best for you, also think of what you enjoy seeing as a result of the fruits of your labor. If you want instant gratification with results that will be entertaining based on how much time and effort you put in, I would say go for game development.* If you're more into practical things, or you like to solve problems that can be beneficial to both you and other people who are likely to have the same problem, I'd say go for application programming.** If you like the instant gratification feeling of game development but you also prefer more practical solutions to problems, web development is what you'll probably like.***
It's really all up to what you end up liking to do the most. I'd recommend specializing in a field that appeals to you the most, but don't ever limit yourself to just that. If you can, try and gain experience even in the programming subcategories you don't like. In the real world, unless you're a skilled developer like Will Wright or Notch, you probably won't get the chance to develop exactly what you want, and you'll probably end up developing something that your managers want you to develop--so, again, it's best not to totally limit yourself to one field.
* C(++), C# especially, or a dialect of BASIC are the best starting points for game development, but either way, you'll need C(++) experience somewhere in there.
** Java is very good for application development for something that isn't game design--Minecraft nonwithstanding. C and C++ also apply to this field just as much.
*** PHP is what you'll probably end up using if you choose web dev, but there's also ASP.NET if you like Windows servers and ColdFusion if you like proprietary, not-so-well-documented code.
-
I'd actually recommend something like Python as a good place to start. The syntax is clear, the language is powerful, and you can use it for a wide variety of things.
you'd be better off with Scheme, honestly
Why? This makes zero sense to me.
-
the syntax is clear, the language is powerful, and you can use it for a wide variety of things
edit: no 4 srs, the syntax in c++ that would trip up newbies is used by the sort of things that newbies won't be using unless they're not actually newbies. It's a terrible reason to instead start in a language with dynamic typing and auto memory management. And if you're going to be doing that anyway, I personally find Scheme to convey actual programming ideas much better than python (admittedly I've used scheme much more than python, so take that with a grain of salt).
-
@sigtau that's a pretty decent explanation.
As I've said earlier, I'm looking at this for job purposes and for potential use here. So essentially application and game development.
Web development, granted there's a mountain of job openings in that area - and while I do have some graphics experience that would help
with content creation. I can't say I've got any real passion for doing it. For whatever reason, the social media, web design, blogging, etc etc... stuff never caught
on with me to have an interest in making web content. Which in turn is probably why I update FringeSpace news as little as possible. Which I realize we're somewhat
talking apples and oranges coding vs. other aspects of web design - but I sort of feel the same about it either way.
-
also isnt ada meant for mission critical systems for things like medical fields and avionics, systems that if crash cause people to die? its a language designed to result in stable as **** executables.
Yup, and it is really painful to code in it, especially if you want to use arrays or pointers.
Anyway, there has been lots of suggestions so far. It's gonna be hard for JGZinv to pick one :p
-
Well the consensus seems to be C++, and unlike the others, I've already had some resources posted for it.
It would appear that going from C++ to Java is wise though.
A couple FSO related questions....
Is netcode typically still C, or is that actually handled by something else?
If several people here are saying LUA is inefficient / not really a great language, why aren't we using something else?
-
The netcode (as most of FSO) is coded in C.
And we're using lua because, while it isn't as good as a general-purpose language, it works quite well as an interpreted scripting language, and it has the immense advantage of being relatively easy to integrate into an engine.
-
when the scripting system was being implemented it was a toss up between lua and python. i think lua won out for being somewhat faster. i think its one of the faster interpreted languages out there, and also has a tiny, easy to implement c api.
-
Well in any case, probably going with C++. I'll see if I can't pick up that book mentioned earlier when it comes out.
I grabbed VS2010 Express so I suppose that's someplace to start.
-
Well in any case, probably going with C++. I'll see if I can't pick up that book mentioned earlier when it comes out.
I grabbed VS2010 Express so I suppose that's someplace to start.
JG, I had two courses freshman year in C++, and I honestly have to say that I learned very little from it, perhaps only some of the syntax and general form of things.
Fastforward a couple of years later, I learned assembly for the MC9S12 chip, which is not a PC but rather a general purpose microcontroller designed for automobiles. Fastforward a little more to my most recent quadrotor project, I had to re-learn C if I ever wanted to get it to do something useful.
I would suggest going through C first to learn the basic program architecture: data types, arrays, loops, recursion, etc.
Then, pick up a microcontrollers, preferably one that isn't a RISC or a Harvard architecture, and learn to code some basic programs in assembly, so you can get a general idea of how von Neuman/Turing computers operate while having fun with blinking LED's and keypads and such by building your own driver software.
Then, try doing the same programs with C, and then later see what C++ has to offer.
One of the biggest things that put me off with learning C++ the first time was the fact that we really couldn't make a program that actually DID anything physical. I didn't see what was so fun (or interesting) about making programs that sorted numbers in a text file.
-
I didn't see what was so fun (or interesting) about making programs that sorted numbers in a text file.
Ahh, to be in high school again...
-
I didn't see what was so fun (or interesting) about making programs that sorted numbers in a text file.
Ahh, to be in high school again...
The sad thing is that the C++ course was offered as a freshman level class in my community college. My High School didn't have any programming courses whatsoever.
But I did have some fun with making sprites move around on the TV with a Commodore 128 my dad had scavenged from somewhere. :yes:
-
Well in any case, probably going with C++. I'll see if I can't pick up that book mentioned earlier when it comes out.
I grabbed VS2010 Express so I suppose that's someplace to start.
JG, I had two courses freshman year in C++, and I honestly have to say that I learned very little from it, perhaps only some of the syntax and general form of things.
Fastforward a couple of years later, I learned assembly for the MC9S12 chip, which is not a PC but rather a general purpose microcontroller designed for automobiles. Fastforward a little more to my most recent quadrotor project, I had to re-learn C if I ever wanted to get it to do something useful.
I would suggest going through C first to learn the basic program architecture: data types, arrays, loops, recursion, etc.
Then, pick up a microcontrollers, preferably one that isn't a RISC or a Harvard architecture, and learn to code some basic programs in assembly, so you can get a general idea of how von Neuman/Turing computers operate while having fun with blinking LED's and keypads and such by building your own driver software.
Then, try doing the same programs with C, and then later see what C++ has to offer.
One of the biggest things that put me off with learning C++ the first time was the fact that we really couldn't make a program that actually DID anything physical. I didn't see what was so fun (or interesting) about making programs that sorted numbers in a text file.
i concur. if you want to learn asm, id recommend starting with microcontrollers, the instruction set is so much smaller (i think an atmega has 131 instructions) where a modern x86 cpu has a ****ton of instructions (http://en.wikipedia.org/wiki/X86_instruction_set), which makes the job of and asm programmer quite tedious. i got into mcus with arduino but it was either too big for what i wanted, or didnt have enough pins, and the ide while useful doesnt really let you do anything with any degree of performance. you learn to write really tight code when you only have a couple k or less of ram.
im actually working on starting a project, designing an 8 bit "videocard" for an mcu, and im going to need to dip into some asm for timing purposes. using a series of latches, buffers, bus transceivers and a dedicated mcu to handle video output timing and a pair of 32k*8 srams which will act as a double buffer, so that you can draw to one memory with an external processor while the processor on the board works to output the signal using the contents of the other sram. when the external processor is done it will signal the other mcu to swap chips. i figure i can output 8 bit greyscale over composite or 332rgb over vga. im already designing it in eagle cad but im not sure when il have all the parts to actually build it. the real challenge will be in programming.
-
I was trained on the MC9S12, an ol' Motorola chip that was designed as a central MCU for automobiles. As a result, it has an ***ton of pins (112 to be exact) that so far haven't been completely used up.
Although not specifically stated anywhere, the chip's pretty much an intermediate architecture that still allows you to put variables wherever you want, and had up to 256Kb paged flash... which again hasn't been completely used up (yet).
Nuke, I remember coming across a "GameDuo" shield over at Sparkfun.com that allowed an Arduino to hook up to a TV using the old RCA plugs. That sounds like what your working on, but with a couple of improvements. I'm dangerously interested, Lol.
As a side note, JG, and everyone else reading this, I wouldn't recommend learning assembler for an x86 chip because 99.999999....9% programs today made for them are in high level languages. Unless you where looking for a job as a compiler programmer, its just no use to learn a CISC's asm when your just beginning.
P.S.: Out of curiosity, Nuke, is your system going to be mainly parallel data transfers or will there be a few serial lines?
-
I was trained on the MC9S12, an ol' Motorola chip that was designed as a central MCU for automobiles. As a result, it has an ***ton of pins (112 to be exact) that so far haven't been completely used up.
Although not specifically stated anywhere, the chip's pretty much an intermediate architecture that still allows you to put variables wherever you want, and had up to 256Kb paged flash... which again hasn't been completely used up (yet).
Nuke, I remember coming across a "GameDuo" shield over at Sparkfun.com that allowed an Arduino to hook up to a TV using the old RCA plugs. That sounds like what your working on, but with a couple of improvements. I'm dangerously interested, Lol.
As a side note, JG, and everyone else reading this, I wouldn't recommend learning assembler for an x86 chip because 99.999999....9% programs today made for them are in high level languages. Unless you where looking for a job as a compiler programmer, its just no use to learn a CISC's asm when your just beginning.
P.S.: Out of curiosity, Nuke, is your system going to be mainly parallel data transfers or will there be a few serial lines?
there are a few ways to get video support on arduino. theres the gameduino which uses an fpga, it has a full set of features, backgrounds, sprites, collision detection, and outputs to vga. theres the tv out library which bitbangs 1 bit video over composite, ive played with it a little, but it uses up so much cpu time that you really cant use it for anything but simple games. there was another video board that implemented the same kind of graphics as the tv out library, had text and graphic primitives. ive seen a few diy methods on hack a day that im loosly basing mine off of. many of those used a single sram, with a latch to multiplex address and data lines and some kind of dac.
i intend to use a brute force mentality and use several chips. everything is parallel. address bus is 15 bits and data bus is 8. the memory also requires 2 control lines. on top of that i will have an additional 2 lines to control/indicate bus switching status. one for input to request a bank flip, and the other indicates to the external processor that the bus flip has occured (transition indicates memory ready, while the level indicates which bank is currently attached). for performance i intend that both sram chips will operate simultaneously. you will be able to draw to one, while the other one is used for signal output, so that you dont have to wait for blanking periods to run code. you will draw, request flip, and when the chip controlling the signal output hits a blanking period (could be each line or each frame, whis may be a configuration setting) it reads the control line, and if its high flips the bus and sets a bit informing the cpu that the memory is ready to be written to again.
i intend to use 4 3-state octal bus transceivers to switch the i/o bus. each sram will connect to a pair of transcievers, one will go to the port for an external cpu, and the other will go to the internal bus. the pairs would be cross connected so that the internal buss can be connected to one sram bank while the other sram bank is routed to the external port. the internal bus connects to the internal mcu, and through a buffer or two, to the dacs (to support both greyscale on composite and 332rgb on vga i will need one for each, though i havent really thought this part out very well).
address bus line are one way, so only buffers are required to switch them. unfortunately at 15 lines apiece it will take about 8 3-state octal buffers to do this. im thinking of using a latch to multiplex the bus and address lines with the data lines to reduce the amount of bus. this would require only 4 transceivers, 4 buffers and 2 latches. i may also need some inverters to reduce the number of onboard control lines. hopefully i can control the bus with one of the atmega328s i have on hand, which has 20 available pins. 15 for io/addres bus, 2 for we/oe pins on the sram, 1 for the latch, and 2 control lines to the external processor, bus switching would probably be done with the bank indicator line. im going to have to scan over the datasheets to make sure i can do this with 20 pins or less, otherwise im gonna need a chip with more pins.
everything would be running at 20 mhz. the ram is asynchonus so i dont think there is any need for the external processor to match clock speed or to be in sync. everything will be in a dip package, since im not setup for surface mount. i have fresh pcbs and a recipe for home made etchant. dont have a laser printer to print toner transfer sheets, so i may just end up drawing the pcb patterns freehand. external processor will be an atmega1284, which by itself has a good amount of memory. 128k flash, 16k ram, 4k eeprom, and can be run at 20mhz. will be a fun little project.
-
Dangerously interested, indeed. One of these days I'll have to look into making one for myself. :yes:
Your probably going to have a bit of trouble designing the bus traces, get them too close, carrying too much current, etc. and they'll induce a current to their neighboring traces. Hopefully your pcb cad will have a tool to help you out, but I can't really say much more 'cause I haven't made any custom pcb's from scratch yet (really want to though).
I did make some home-brew etchant recently, had a real simple recipe of muriatic acid (pool shock) and copper-clad board as a primer. Just toss the copper-clad into the acid, wait till it turns green, and your good to go. I think a few capfuls of hydrogen peroxide is used to revive the solution when the it starts getting saturated with copper ions (REALLY dark green with clouds that fall to the bottom of the jar).
I haven't used the stuff since I made it though... didn't have time to find a good way of drawing the traces.
-
my recipe is hydrogen peroxide, acetic acid, sodium chloride. actually 2 of these can be found in my spice rack. ive been scrounging around thrift stores and garage sales trying to find an old laser printer to do the toner transfer method, though i havent found one yet. i hear if you stick photo paper into a laser printer it works quite well. just iron on the pattern and etch. you can hack an old inkjet for direct to pcb printing, but that is a project unto itself. i did have a highschool electronics class, and we made pcbs from scratch using toner transfer and ferric chloride, with pretty good results. you can also use a sharpie and some stencils, but that can be tedious and error prone. granted you can have professionally made pcbs made to spec for less than 50 bucks. but im poor and not really willing to spend more than a few bucks here and there to build this contraption.
anyway i think my resolution will be 240*136, this will also allow my an extra 128 bytes for configuration data. the vid board will start up and wait for a bank flip request as soon as it gets one it will read the first 128 bytes (really i cant imagine needing more than a few bytes for this) and if there is data there, use that data to configure the video mode, the remaining data will be frame buffer. i also re-examined my design and found that i will need an mcu with more pins on the board, because i forgot that it would need a couple more lines to control sync signals, especially on vga where you need independent horizontal and vertical sync lines, with composite you only need one which is added to the dac output. so i will need 22 pins if i use bus multiplexing, or 29 pins if i dont (not 30 cause i dont need to drive a latch line). bus management is going to be tricky, but im using dual side pcbs, i could put address lines on one side and data lines on the other. there arent gonna be many support components, voltage regulator and caps, crystal and caps, and a few pulldown resistors here and there, and i think the srams need a cap each for power stability. probably wont need inverters if i have more pins on the onboard mcu to work with.
-
For anyone that was following this thread before the off-topic derailleur (it was refreshing I think...):
I found a cool C++ reference website: http://www.cplusplus.com/doc/tutorial/ (http://www.cplusplus.com/doc/tutorial/)
So far the only bias I've found is against Fortran and the like. Seems not many people these days like GOTO statements. :shaking:
-
well, if you look at the instruction set of a cpu. you wont find a for, you wont find a while, but you will find a jump. the control structures we use are not really representative of the way a cpu works. a goto on the other hand is. its just bad programming practice because they are hard to read in code.
-
well, if you look at the instruction set of a CPU. you wont find a for, you wont find a while, but you will find a jump. the control structures we use are not really representative of the way a CPU works. a goto on the other hand is. its just bad programming practice because they are hard to read in code.
Right, because many of the control structures (for, while, case) can be easily made by a combination of jumps and compare statements. It's a bit difficult (and costly) to make an opcode for everything. The general consensus with CPU manufacturers is to make the chip as multipurpose as possible, so that you sell your chip in more than one market.
In high-level languages, mechanisms such as the GOTO statement should be reserved for cases where it would be too roundabout if you did it with other structures. Spaghetti is for food, not programs! :)
-
Go for Fortran, it's great for impressing the ladies ;)
Seriously though, I started on BASIC (Because that was pretty much the only option when Spectrums, BBC Micros and C64's were all that was available). I then got a BBC Micro and discovered the [] tags, which actually allowed you to code in 6502 machine code in the middle of your programs.
I then moved to learning Z80 machine code on an Amstrad, and Turbo Pascal on something like a 286. Tried to learn Fortran, failed to epic levels.
More recently, I learned Java, it's not as bad as some make out, but is memory hungry and the supposed 'hiding' of the complexities of things like references actually makes it feel a little ambiguous at times. Sometimes you aren't certain whether you are assigning a value to a variable or a reference to a value, and that can cause problems.
I will say this for Java, though you can do it in C++, but it isn't often done, and that is Java is very good if you want to learn how to divide your code up into managable sized pieces, and because it has high- and low- level interpretation, a lot of the code can be error-checked before running. On the down side, in my opinion, there's far too much recasting, which never makes me feel comfortable.
-
Since I didn't directly reference what I was doing....
I took a introduction to C class (5 hour thing) and got a basic book to start with on that. Haven't been able to spend
a lot of time on it honestly.
After I get some sort of grasp on C I'll look into C++.
-
C++ should only take you 3 weeks
(http://www.freeimagehosting.net/t/1t5xd.jpg) (http://www.freeimagehosting.net/1t5xd)
-
Other computer languages you should be able to pick up quicker.
(http://ecx.images-amazon.com/images/I/4193W7ZT5BL._SL500_AA300_.jpg)
-
C++ should only take you 3 weeks
*imgsnip*
Not sure if serious. I'd say it takes more like several years (http://norvig.com/21-days.html).
Also, impressive bump.
-
C++ should only take you 3 weeks
*imgsnip*
Not sure if serious. I'd say it takes more like several years (http://norvig.com/21-days.html).
Also, impressive bump.
Heehee, I was just thinking about posting that.
-
C++ should only take you 3 weeks
*imgsnip*
Not sure if serious. I'd say it takes more like several years (http://norvig.com/21-days.html).
Also, impressive bump.
ive read 3 books like it and i barely get c++ as it is. as i told aardwolf the other day, the more i learn about c++, the more i like c.
-
Personally whenever I'm forced to use C I always happen to find excellent places to use C++ constructs. IMHO void pointer casting and explicit typedefs aren't worth giving those features up, and I'm not a fan of how C lets you prototype functions without arguments.
granted, if I had to personally write a compiler for one I'd probably go with C, but thankfully there are plenty around already for both languages.
edit: and for the record there is a big difference between teaching yourself C++ in 3 weeks and teaching yourself how to program in 3 weeks.
-
edit: and for the record there is a big difference between teaching yourself C++ in 3 weeks and teaching yourself how to program in 3 weeks.
Do you mean that the first part would read "teaching yourself C++ in 3 weeks, given that you already have some programming background (even if programming backgrounds can vary widely)"?
-
Well, I'm sure you could do it if you had a background in object programming.
But then you wouldn't be buying "teach yourself in 21 days" kind of books...