Show Posts
Pages: [1] 2 3 ... 579
1  Using Arduino / Microcontrollers / Re: FT232 vs 16u2 on: April 16, 2014, 10:35:33 pm
Long  answer: Because it looks like a serial port to the PC application I can only assume they did what most people do, equate "serial" with "RS232", either because they didn't know any better (unlikely) or maybe as a marketing ploy because they knew most people make that connection.

I can't really think that either of those options is likely, after all anyone designing a board with these chips would know the difference and certainly those designing the chip would know.

So that brings me back to a marketing reason.

Short answer: No idea smiley


______
Rob
2  Products / Arduino Due / Re: Small-footprint Due on: April 16, 2014, 07:42:01 pm
The SAM has a SHDN pin that is supposed to be used to shut down external regulators, that may imply that this should be done to get the best low power operation, but I think it's just to kill external circuitry, the CPU itself has this well handled.

One would assume as you say that the current used on the VDD pins is next to nothing, in fact if you look at Fig 46-4 they have all the VDD pins shorted to GND for testing the VDDBU current, so it's fair to say there is nothing but some leakage current on those pins under a normal shutdown situation.

______
Rob
3  Using Arduino / Microcontrollers / Re: FT232 vs 16u2 on: April 15, 2014, 07:00:39 am
I still use the FT232Rx, I don't have to program it (and allow for an ISP header) and it "just works". I've been tempted to try the newer smaller versions but it if ain't broke...

______
Rob
4  Community / Bar Sport / Re: Adafruit's new website on: April 15, 2014, 06:55:48 am
Seems fine to me (speed wise) over my mobile phone connection. No comment yet on navigation.

______
Rob
5  Using Arduino / Programming Questions / Re: How to use unsigned char arrays with external SRAM? on: April 15, 2014, 06:48:24 am
Jeez I'm confused and I know nothing about TinyBasic, but if you have two arrays of data, one in the AVR RAM and the other in external RAM write a loop that scans the AVR array and compares it with the external array, one byte at a time, similar to what you did in the first post.

You cannot use the = operator (well you could if you overload it but that's out of your league I think).

Quote
only if TinyBASIC would still work by using this method which I am not sure about)
What does TB have to do with this? Is this a C question or a TB question? Does the code have to be written in TB?

Quote
need a method to make an internal array equal the external SRAM array without bringing the data in
Now I'm even more confused, do you want to move the AVR data to the external RAM (or VV)?

______
Rob
6  Products / Arduino Due / Re: Anyone using CMSIS? How to get started? on: April 14, 2014, 06:44:45 pm
I've done quite a lot of programming on LPCs (great chips and environment BTW) and I confess that I'm still not 100% sure how useful CMSIS is. Yes it's supposed to be an abstraction layer for the ARM, but how many people actually work with the ARM core? Answer, almost none.

Here is a snippet from my main() func

Code:
// Enable AHB clock for GPIO ports
LPC_SYSCON->SYSAHBCLKCTRL |= _BV(AHB_GPIO1) | _BV(AHB_GPIO0);

The definitions here are from an H file in the CMSIS folder, but this is very LPC specific, no way that code will run on a SAM or ST. So there is a small abstraction level there but not much and certainly not portable.

Here is some more setup code

Code:
LPC_SYSCON->SYSOSCCTRL = 0;
LPC_SYSCON->PDRUNCFG &= ~(1 << 5);
LPC_SYSCON->SYSOSCCTRL = 1;

This is obviously dealing with the ARM core which will be the same on all M0 chips, but the left values at least have an LPC_ prefix so once again this code won't work on another family, even is if all boils down to the same address, offsets and code.

And this is working directly with the M0 core, almost nobody does that except maybe a little setup code, most code is either generic C/C++ that will run anywhere or deals with the chip's peripherals which are totally different on all families.

So for the average user I see almost no benefit to CMSIS, they need a real HAL framework like the Arduino.

Quote
NXP gets points for removing restrictions on the free version of their LPCXpresso IDE, namely C++ support is now included, and code size limitations eased or removed.
Yes, I ported most of the Arduino core to LPC122x, but that was before they opened up the compiler and I had to do it all in C so things like Serial.begin() had to be SerialBegin() etc. I got it to the stage where you could run a simple Arduino sketch with very few changes to the code.

Now that C++ is free I've started porting the code to C++. I haven't got far with the conversion though because I have too many other things to do.

______
Rob
7  Using Arduino / Project Guidance / Re: multiple devices on one serial port? on: April 14, 2014, 10:04:03 am
Quote
the devices are all the same and send their data once every second  at 9600baud. i have no influence on these devices except for powering them on and off.
Then you are out of luck, there are many ways to do this with a single serial port but they all require you to write a protocol that runs on all connected devices, as you have no control over most of them there's little you can do except have a heap of serial connections or control the power to each device and cycle through them.

As for using software serial, I don't think it works well (at all?) with 10 inputs.

______
Rob
8  Development / Other Hardware Development / Re: Arduino shield pins and ICSP header mismatched height on: April 14, 2014, 09:24:40 am
I often wondered how well that SPI header worked as it's pins are a different length to those on the shield pass-through headers.

______
Rob
9  Using Arduino / Networking, Protocols, and Devices / Re: Communicate between microcontrollers: Automatic address and request-less send? on: April 14, 2014, 08:20:09 am
Quote
So that leaves serial, CAN or RS485...but daisy-chaning makes it a bit unreliable. Especially if I want to use a ATTiny without a crystal the chance an error occurs along the path is high...So that leaves CAN or RS485.
CAN and RS485 are serial, they are just transceivers for the data to/from the UART (unless you use a CAN controller), so if you aren't happy with using "serial" then using RS485 won't make any difference from a timing point of view, it will help with long cables though.

Quote
Haven’t looked if there are Arduino libraries available for it,
As I say, RS485 is just a hardware buffer, it has nothing to do with the the protocol, so the standard serial function is all you need. CAN is (or can be) the same.

How about all nodes control an open-collector "pressed" signal, when a button is pressed you test this signal, if it's not asserted you pull it low and that locks out all the other nodes. You then transmit the node address etc. There is still a tiny race condition but in this application that can be ignored I think.

This would need an extra wire though.

______
Rob
10  Products / Arduino Due / Re: Small-footprint Due on: April 14, 2014, 07:01:48 am
Any chance of a schematic, it's hard to tell much from the PCB, for example why do you have 5v pins?

______
Rob
11  Using Arduino / Project Guidance / Re: output voltage of Atmega328 on: April 14, 2014, 04:07:42 am
Quote
Are the operating voltage and the output voltage of Atmega328 same?
Yes, there maybe a gnat's fart difference but for normal use consider them to be the same.

______
Rob
12  Development / Other Hardware Development / Re: List of tools for surface mount work on: April 14, 2014, 12:26:20 am
Quote
all I have to do is to add solder paste to the pads, place MCU, attach proper nozzle, and heat up, right?
Correct, plus maybe use solder wick to remove any bridges on fine-pitch chips.

I've not done the soldering iron drag trick, dunno if that's easier or not, but certainly using hot air is pretty easy although you have to be careful not to blow parts across the board smiley

______
Rob
13  Using Arduino / Project Guidance / Re: "External" memory for program memory? on: April 14, 2014, 12:16:36 am
I can't find the definition for the cor_canalX objects but if you had them in an array the desenhar_barras_periodo() function could be reduced to something like this

Code:
void desenhar_barras_periodo () {
int x = (setor_selecionado * 38)+5;
int y = (setor_selecionado * 38)+39

for (int i = 1; i < 5; i++) {
if (bitRead(cor_selecionada,i) == true) {
myGLCD.setColor(cor_canals[i][0], cor_canals[i][1],cor_canals[i][2]);
myGLCD.drawRect(x, 80, y, 195);
desenhar_barras(cor_canals[i][0], cor_canals[i][1], cor_canals[i][2], x, 80, y, 195);
}
}
}

______
Rob
14  Using Arduino / Networking, Protocols, and Devices / Re: Communicate between microcontrollers: Automatic address and request-less send? on: April 13, 2014, 07:13:59 pm
Quote
Another option I thought of is to use the serial communication to communicate with each other. The RX is connected to the TX of the other controller and so on.
That would probably be my approach, I assume you are happy to use serial rather than I2C.

The only down side is determining the order in which buttons are pressed, for example if a button on node 2 is pressed just before one on node 22 the master will still see the press from 22 first.

Is this a problem with your application?  If it's a game where the first button pressed wins then maybe.

As for the addresses, you can have a simple self-discovery algorithm that sends 0 to the first node, it records that as it's address, increments the number and passes it along. When the number returns all nodes have a unique address and you also know how many there are.

Also what is the distance between these boxes, I2C is not normally good for long runs.

______
Rob
15  Using Arduino / Programming Questions / Re: Help with modulo. 25%10 always rounds off to 6. on: April 13, 2014, 06:53:37 pm
No that's ok, you can call functions from anywhere, loop() is already called from main() so every time you do (for example) a Serial.print() inside loop() you are already calling a function from inside a function, and for all you know Serial.print() calls 10 other functions all of which call other functions again.

Subject to the stack overflowing there is no limit.

It seems that erdiegange's code works for everyone else, so the only unknown is the updateDisplay() function.

______
Rob
Pages: [1] 2 3 ... 579