Show Posts
Pages: 1 2 3 [4] 5 6 ... 593
46  Using Arduino / Microcontrollers / Re: LPC810 mini ARM Prozessor in 8 pin dip package on: September 16, 2014, 05:46:24 am
Nice job from what I can see.

I'm a big fan of the LPCs and have also done an Arduino port (to the 1227). I too used C rather than C++ because at the time the C++ compiler cost $256. It's now free and I have a rewrite on my todo list.

______
Rob
47  Community / Bar Sport / Re: Strings or woodwinds? on: September 16, 2014, 05:09:02 am
It doesn't lead to misconceptions because it's common practice to refer to a null-terminated array of char as a string.

We refer to bytes and that's not an official type.

These (and probably other) terms are just shorthand or jargon.

Maybe it confuses beginners but so what, the whole damn language confuses most people smiley

______
Rob
48  Community / Bar Sport / Re: Who hasn't accidentally touched a mains voltage once or twice? on: September 15, 2014, 09:04:52 am
Many times, two bad ones though.

Underneath my house I grabbed the bare end of a wire I was running under the floor. I "knew" that the other end was not connected, wrong. To make matters worse I had bare feet on damp ground.

Luckily my arm muscles were stronger than my finger muscles and the wire was short, so my arm pulled my grip from the wire. I had burn holes all along one finger for ages.

Next time I was changing a light fitting, I used to often leave the wires hot for simple jobs because it's such a pain to reset all the digital clocks smiley Normally I used a screw driver with an insulated shaft but not this time, the shaft was hot and I touched it. My triceps contracted and I threw the screwdriver across the room, it embedded into the wall not far from my missus.

For years now I've been in the habit of brushing any mains wire with the back of my fingers before working with it, just in case.

______
Rob
49  Using Arduino / Project Guidance / Re: What circuitry would you recommend to run two DDS with one Arduino? on: September 14, 2014, 06:16:45 pm
I just had a look at the tutorial, it seems very clear but it's not about using SPI, it's about using shiftIn(). So select whatever pins you like for clock/latch/dataPin.

That said, after a quick look at the 4021 data sheet I think MISO would go to pin 3 (Q8), SCK would go to pin 10, and your CS (not SS) would go to pin 9.

______
Rob
50  Using Arduino / Programming Questions / Re: How does this code snippet work? on: September 13, 2014, 05:51:37 pm
Quote
The first Serial.print with the ternary condition is what I can't understand.
If the value being printed is < 10 print a '0' before printing the value.

Quote
Since the first operation prints a space every iteration regardless of data,
No it doesn't, see previous paragraph. Only ABCDEF hex values will print a space. Strike that, I just noticed the space in front of the 0.

On the surface that looks like a bug, I think it should print nothing if the value is > 9. But I don't know the context of this function.

EDIT: It seems that all bytes should have a space inserted, as this is an ID being printed maybe the author is relying on knowledge of the constituent byte values to insert spaces to make it more readable, IE he knows that every 4th value is > 10 and all the others are < 10. What are some typical values?

Bugger, I just noticed it's < 0x10 not < 10, don't pay me no mind smiley

______
Rob
51  Using Arduino / Project Guidance / Re: How does the mega2560 distinguish between a sketch upload and serial monitor on: September 13, 2014, 05:40:14 pm
Yep, if you don't reset the board it will never enter the bootloader with anything you do.

______
Rob
52  Using Arduino / Project Guidance / Re: What circuitry would you recommend to run two DDS with one Arduino? on: September 13, 2014, 11:07:20 am
Yep.

______
Rob
53  Using Arduino / Project Guidance / Re: What circuitry would you recommend to run two DDS with one Arduino? on: September 13, 2014, 09:27:18 am
Quote
Should I use MOSI and SCK for in shifts and use SS pins to choose between two or should I use any user-determined digital pins to read inputs of in-shifts?
You can use SPI or shiftIn/Out, it's up to you. SPI will be a lot faster.

Quote
My program will scan encoders for a period of time after change has been detected.
Sounds a bit suss to me, but if you're happy it will work...

______
Rob
54  Using Arduino / Project Guidance / Re: What circuitry would you recommend to run two DDS with one Arduino? on: September 12, 2014, 06:13:57 pm
Are these absolute or incremental encoders? Because I would think that trying to handle 4 incrementals via a shift reg would be an issue, and if you only read them when a button is pressed can you determine the direction they were turned?

Quote
How are those two modules synched in this circuit?
What keeps clocks from runningat slightly different speeds?
I gather you are referring to the fact that the CLK pins on both chips are note connected? They are driven by the Arduino so it's up to you the keep them the same. That said if you want them to be identical just join them together.

You connect most shift registers to either SPI or use any pins and shiftIn().

______
Rob
55  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: September 12, 2014, 05:53:20 pm
Quote
Last time I used a logic analyzer was back in the late 80'ies/beginning of 90'ies.
Me to, and then they were a big purchase even for a company. We live in fun times.

______
Rob

56  Development / Other Software Development / Re: programming the flash in runtime on: September 12, 2014, 06:59:49 am
Not really, the BL resides in a special flash area and only code running in that area can change the flash memory.

So I think your main code will have to field the "reflash" command and jump into the BL which will then take over. Off hand I don't know the address(es) of AVR bootloaders but it will be documented.

______
Rob
57  Using Arduino / General Electronics / Re: Header pin duplicator/replicator/expander/breakout? Not sure what to call it. on: September 12, 2014, 03:21:58 am
Solder some strip board to the pin side of the socket strip with long legs then a header 2-3 rows out.

______
Rob
58  Using Arduino / Programming Questions / Re: error: multiple definition of `func1()' on: September 12, 2014, 12:32:41 am
ok, live and learn eh?

______
Rob
59  Using Arduino / Programming Questions / Re: Reading digital pins on: September 11, 2014, 10:29:11 pm
You cannot do 16 at a time with any AVR, but you can do 8.

Most smaller Arduinos don't allow 8 either because various pins are used for other stuff, but the Mega does, so for example if you look at the Mega schematics you will see that PORTA is broken out to pins 22-29 so there are 8 pins you can set in one instruction, for example

PORTA = 0x55;

after setting the pins to outputs.

______
Rob

60  Using Arduino / Programming Questions / Re: error: 'Serial' was not declared in this scope on: September 11, 2014, 05:30:11 pm
What board are you using? Isn't it SerialUSB or something on one of them?

Belay that, you only get the error in file1 I gather.

______
Rob
Pages: 1 2 3 [4] 5 6 ... 593