Show Posts
Pages: [1] 2 3 ... 73
1  Community / Bar Sport / Re: teaching debugging on: March 19, 2014, 09:46:05 pm
Another reason some might be out of ideas is this - They wrote the code and just cannot see the obvious error in their own code. Someone else looks at it and it is glaringly obvious. I get away from coding for a bit and this particular problem creeps up.  So you leave the code alone for a day or two and then take a look at it again and you sort of wonder what idiot made that obvious mistake... Same reason I used to hand my drafting designs to one of the other guys in the engineering department. He didn't know what I was drawing and he could spot the missing dimension before I released that part to the shop.
2  Using Arduino / Motors, Mechanics, and Power / Re: Need help with writing code for two stepper motors on: March 19, 2014, 09:20:49 pm
Make your own drivers - http://forum.arduino.cc/index.php/topic,84809.0.html - is one I did using ATtiny2313. The transistors you use can be sized for the current you need to drive your motors.
3  Using Arduino / Microcontrollers / Re: attiny85/84 as stepper motor controller for miniCNC milling? on: March 19, 2014, 09:15:07 pm
Take a look at this - http://forum.arduino.cc/index.php/topic,84809.0.html

I used an ATtiny2212. has a few more pins than needed but that is generally easy to deal with...

Started out in Arduino but went to Assembly for the final.

Easy to do regular stepping, wave stepping or half stepping. Could use some of the unused pins to select.
4  Using Arduino / Storage / Re: Building a working flash memory programmer. on: January 03, 2014, 03:49:20 pm
And here is a board layout. Single Sided, Red lines are wires on the top side of the board, and blue are teh traces on the bottom.
5  Community / Bar Sport / Re: What do you call a citizen of the United States of America? on: January 03, 2014, 10:28:58 am
Merican is sort of like Yank or Brit or Limey (or Jack) or Frog or a host of other nicknames that we have all come up with for those originating from other places. And whether it is taken as an insult depends on the attitude of the one receiving the comment. Some can be offended just by saying "Good Morning" to them and others just let it roll off and don't make anything of the comment. And some of these names have little meaning in one region, and are heavily loaded in another regin.
6  Using Arduino / Programming Questions / Re: Arduino Port Manipulation - Reading Port Data on: January 02, 2014, 06:25:30 pm
Reading an encoder is a good application for using an interrupt. Trying to keep a loop fast enough to read an encoder with more than just a few counts per revolution is an exercise in futility in Arduino C. You have to account for the software overhead of the language and there is just too much going on to be able to read I/O fast enough for an encoder.

The exact routine you use to read the encoder depends on the resolution you need. There are 4 states - A on- B on, A On- B off, A off-B off, A off-B-on. With 1 interrupt (Change on Signal A) you can use these states to tell forward or reverse rotation of the encodet and a resolution of 1/2 the encoder lines.
7  Using Arduino / General Electronics / Re: New PCB production tool on: January 02, 2014, 01:57:14 pm
For a 1 sided board I should make an adapter for my plotter and print directly on the board.  Tape the board to a piece of 8.5 x 11 paper. Thanks
8  Using Arduino / Microcontrollers / Re: Stops at 1778 bytes without errors on: January 02, 2014, 01:20:00 pm
Function typing. You have a number of functions of type int that have no return. Should they be type void?
9  Using Arduino / General Electronics / Re: Coin cell on: January 02, 2014, 01:10:08 pm
Coin cells are low current devices. They can't supply enough current to power the Arduino. Might have to use 6 or more in parallel to supply enough current. Would be better served with AA's or AAA's., but they will discharge rather quickly.
10  Using Arduino / Microcontrollers / Re: Out of memory Attiny2313 on: January 02, 2014, 01:06:49 pm
I must say that in some way I disappointed because the low flash memory of this chip, I really don't check the amount of memory before  to buy it (my bad), I just count the 18 pins and all the ports and the 4 pmw  pins that it has.

but I have learned some stuff about the memory and how to keep it low, I could reduce a 2202 bytes sketch to 2000 bytes just below the 2048 of the attiny2313.

after a rest and go to hear the message, thinking about other tings....
I couldn't understand how a micro with a "lot of pins" just has 2k of flash or at last 2k must be enough to handle all the pins , the ting is that I'm believe that the arduino's IDE is keeping more memory that it must in other way for example the simplest sketch keeps 310 bytes, and  adding one pinMode(); isntruction it reaches 508 bytes.
Code:


void setup(){}
void loop(){}

please some advice in front of this matter


I come a bit late to this...

But the part numbers tell you how much flash and ram you have to work with. The memory avail is not a function of the number of pins, but rather the size of the die inside the chip.  32K in an arduino is a bit absurd, in my opinion, but cost wise it makes sense, as the chips with less ram aren't much cheaper. Like someone else said, if you need more memory, go for the 4313. twice the flash, same pinout.

Using your logic I should be complaining that the 2313 has too much memory. I programmed a 2131 as a stepper controller. 1200 bytes in Arduino. Wanted it faster, 88 bytes in assembler. No RAM usage as everything is in registers.

Waht you need to aks is this - Is your code as efficient as possible? Not sure what your programming experience is, but folks with PC programming experience can sometimes write some rather bloated code because there is so much memory and so much storage that it doesn't really matter. As you code the Tiny series of chips you really need to think about the memory cost of every bit of code you write.  Is it necessary, and could it be coded cleaner?
11  Community / Bar Sport / Re: What do you call a citizen of the United Kingdom? on: January 02, 2014, 11:07:31 am
We call them lots of things, but that is probably not what you meant...
12  Community / Bar Sport / Re: Scientists favourite jokes on: January 01, 2014, 10:39:23 pm
I guesses these jokes could be referred to a nerdities?
13  Community / Bar Sport / Re: C or c++ programming. on: December 30, 2013, 12:25:23 pm
I have programmed in a number of languages - Probably totally ruined because I started out in BASIC... Then moved on to Z80 Assembler. Funny thing is I used the GOTO there also...(known as a jump) then I learned Turbo Pascal.  Wrote a bunch of code in college using that. Got a C compiler and started learning C.. Great as a system language, lousy as a data processing language, but it can be used for that purpose also... Learned CoBOL, a really elegant language for its time.Still in use. Learned a little RPG. never used it. Done a lot of special program s in Visual Basic 6, the newer versions are badly broken to the point of being useless (my opinion) ANd I als learned a bit of AVR Assembler. Now that speeds things up and really lightens the memory usage. Simple app, 1200+ bytes in C and 88 in assembler. Same results, only quicker.

Have tried to learn C++ and every example I have seen just seemed to add complexity and obfucation to an already obfuscated language. Never could see the benefit to giving everything a NEW and FANCY name (METHOD??? its just a function) and when all was said and done  I could never make much sense of it. SO - I use C and VB6 and Assembler. Recently "completed" an Emulator, assembler and dis-assembler for Z80 in VB6 and am working on a similar package for the 65C02.
14  Community / Bar Sport / Re: What do you call a citizen of the United States of America? on: December 30, 2013, 12:11:24 pm
And folks form Puerto Rico and American Samoa and a couple other protectorates are also Americans, thoug some there might have other feelings/leanings....

 
15  Community / Bar Sport / Taking a moment to say THANKS... on: December 30, 2013, 12:06:15 pm
Having read a couple posts from one of the idiots that sometimes like to make their presence known on forums such as this,I would like to thank the moderators and other knowledgeable folks that rattle around the Arduino forum. For the most part you have been more than helpful, and in the couple of times where it didn't help, no harm was done. All in all I would say you are doing great, especially considerring that the amount i have invested with you all (2 Arduino boards, most stuff is made from scratch..)

Arduino is a product that is easy to use (well, as easy as it is to use C...) and really rather tolerant of abuse and really adaptable to many applications that I am sure were never imagined when it all began.

SO to all of you Moderators, general gurus and others out there who are willing to share your experience and knowledge, THANKS
Pages: [1] 2 3 ... 73