Go Down

Topic: Higher Precision scope (Mac based) (Read 7 times) previous topic - next topic

adam777

Hi,

first, I was very impressed by this scope - I don't have a Mac, but what I saw in the flash, it looks fantastic!

I have a problem. I wanted to create a similar front-end to yours, but on my Windows machine.

When I'm running this Arduino code on my Arduino Pro, I don't get more that 200 - 250 kbps between arduino (thru the FTDI chip) into my Java Application.

Maybe you have some more experiences, what's wrong with this code? (It's a subset of your lines):

void setup() {

       Serial.begin(1000000);
       UCSR0A |= 2;
       
       // send a message to let the computer know you are alive
       Serial.print("Hello World");
       
               while(true) {
                       
                       //Serial.write((high2 << 5) | (low2 >> 3) | 0x80);
                       UDR0 = 0xff;
               }
}

Is there anything special needed to set up on the port's properties or anything?

Thanks,
Adam

wyager

wait, how are you getting 2mbps serial? It seems to me the max arduino can handle is 1mbps (16000000/(16*1000000))-1=0. What is this UCSR0A register? Thanks!

selfonlypath

#32
Jun 12, 2010, 10:21 am Last Edit: Jun 12, 2010, 10:24 am by selfonlypath Reason: 1
I've a iMac G5 running with Tiger OS and implemented with success Alvaro open source: maximum I can get 115K with arduino Mega via Mac based java GUI. It is my undesrtanding Arduino does not have real USB but a RS232 with USB emulation via FTDI chip so bandwith bottleneck due to RS232 modem.

wyager

The bottleneck should be in the UART itself, it takes 16 clock cycles to send a bit through the UART, so the theoretical maximum is 1000000. I suppose you could get a little higher than that because the serial is re-synced every byte, but to get any higher I think you would have to do some clever bit-banging of the serial. Of course, this guy could be using some trick I've never heard of....

SuperCow

Setting the U2X0 bit high in the UCSR0A registers half's the divider so it goes from 16 to 8, so you can get 2Mbps

But the arduino serial library handles that already by default, so you could do Serial.begin(2000000) from the start. (I have never tested it)
The atmel datasheet even states 0,0% error rate on 2Mbps @ 16MHz so that's nice as well.

Go Up