Show Posts
Pages: 1 ... 5 6 [7] 8 9 ... 19
91  Using Arduino / Programming Questions / Re: initializer-string for array of chars it too long on: October 03, 2013, 12:14:27 pm
this
char mac[13] = "/dev/tty.MindWaveMobile-DevA";
does not look right.
try
char mac[] = "/dev/tty.MindWaveMobile-DevA";
92  Using Arduino / General Electronics / Re: A case study on why EVERYone should have a logic analyzer on: October 03, 2013, 11:59:53 am
Good story and nice board/project too!

Coincidentally, I was looking at this a bit earlier and scratching my head:
http://smartmaker.com/index.php/tools/oscilloscopes-logic-analyzers/24mhz-8-channel-logic-analyzer-saleae-logic-compatible.html

these types are widely available for way way less than the price from that link. I use one and works well. Great for occasional use.
93  Using Arduino / General Electronics / Re: Using i2c and analog pins at the same time. on: October 03, 2013, 03:34:47 am
That's great.
Can you point us to the pins of the pro mini which are to be used for A6 and A7 ?


Pro mini sold on eBay comes with A6 and A7 connection. You need  an ftdi or ICSP programmer to upload your sketch to the promini.
94  Using Arduino / General Electronics / Re: Using i2c and analog pins at the same time. on: October 02, 2013, 04:53:37 pm
if you really need two more analog pins, use a pro-mini, it has A6 and A7.
95  Using Arduino / Storage / [Solved] Re: sdfat + ethernet + spi issue (ethernet dropping connection) on: September 22, 2013, 05:54:44 pm
This turned out to be an EMI problem caused by the relays switching. The ethernet does not drop out of the network anymore after I added an MOV across each outlet. This is just a hardware issue and what I initially thought was a software issue was purely coincidental on the code that was executing after a relay switch.

mods can close this thread.
thanks.
96  Community / Bar Sport / Re: I just got the fastest delivery from China :) on: September 19, 2013, 11:22:51 am
I have ordered a lot of items from china.  it takes only 2 days, maybe 3 for the item to actually travel and reach San Francisco. From there, it can languish for up to a week waiting for customs and I presume homeland security folks (thanks to 9/11) to inspect, then another day to get to my local post office. Strangely enough, you can see from the tracking that on 9/11 (of all days), it passed through San Francisco inspection in one day.

People bash slow delivery from China, but in reality (at least in my experience), the delay is on the U.S. side.
97  Using Arduino / Sensors / Re: is there anyway to make smaller antenna for FPV system ? on: September 13, 2013, 04:41:28 pm
these from hobbyking, but for 2.4 and 5.8ghz



I don't know if you can make any smaller antenna for 900mhz system
98  Community / Bar Sport / Re: I just got the fastest delivery from China :) on: September 12, 2013, 07:40:05 pm
This is the auction I won. people were avoiding this because its a funduino and its not R3. lol



this is the actual item I got









and yes, it works!
99  Community / Bar Sport / Re: I just got the fastest delivery from China :) on: September 12, 2013, 05:27:17 pm
seller ebay name is hkshanhai_shop

granted I am located by left coast port of entry. I usually receive packages between 8-10 days.
ymmv
100  Community / Bar Sport / I just got the fastest delivery from China :) on: September 12, 2013, 01:21:51 pm
shipped on 9/9, delivered 9/12. This is for a mega2560 board for $11.50 with free shipping.

101  Using Arduino / Storage / Re: sdfat + ethernet + spi issue (ethernet dropping connection) on: September 11, 2013, 05:02:50 pm
yes, I did suggest it may be a software/hardware issue.

the relays are powered by 12v, arduino is isolated from the relay. relay control input use opto isolator.
I don't think it is an issue of under powered power supply (though I'm not ruling that out yet), but may be a spike or surge as you suggested. I can try delaying the sd write, say 2 seconds after the relay switches.

Tim, I like your logic, just because you do not see a problem, you conclude there is no problem. lol. 
As fat16lib said, the overhead is minimal to add the SPI initialization code. It will take 2-3 clock cycles to do it (refer to AVR datasheet, SBR and CBR instructions take 1 clock cycle each).  Don't get too hung up on code performance where it does not matter. smiley

As to my source code, it is a very large project so I do not want to waste anyone's time perusing it.  I will eventually put it in github as an open source project.
102  Using Arduino / Storage / Re: sdfat + ethernet + spi issue (ethernet dropping connection) on: September 11, 2013, 01:41:16 pm
I'll try that.

Note that there is no Ethernet activity (other than testing) at all during this time.
Say for example overnight last night, from 12midnight to 6 am, there is no network activity (web request) to the arduino, there were about 100 relay switch changes, and the corresponding sd writes. After each write I do a  client.connect to port 80 of the router. I got 13 failures out of 100 (I call ethernet.begin if connect failed). I know if I do not add the client.connect (so absolutely no network activity), and I just monitor the attached devices on my router, after several outlet relay switch activity,  I will see the arduino drop out of the list, after which I am unable to connect to it anymore.
103  Using Arduino / Storage / Re: sdfat + ethernet + spi issue (ethernet dropping connection) on: September 11, 2013, 11:19:55 am
Quote
I think sdfat code can be a good SPI bus citizen if it stores the SPCR bits 0 and 1 and SPSR bit 0 on chipSelectLow() and restores it in Sd2Card::chipSelectHigh().

I considered restoring SPI settings in SdFat but this is not the correct solution.   I soon encountered a user with an LCD, ADC and SD on the SPI bus.  It is not uncommon for three or more devices to be on the SPI bus.  The only correct solution is for each library to set its SPI settings.


Ok. Thanks for that info. I understand what you are saying. I tried looking for an SPI protocol document but did not find one, but wikipedia did mention

To begin a communication, the bus master first configures the clock, using a frequency less than or equal to the maximum frequency the slave device supports. Such frequencies are commonly in the range of 10 kHz–100 MHz.

I suppose that could be interpreted as on SPI initialization and not before each transmission (just like how it is done in Ethernet library). It mentioned there is a lack of SPI protocol standard. I looked at a couple SPI chip datasheet and I did not find any mention of initializing SPI bus before each transmission as a protocol requirement.

Anyway, I took your suggestion and added initialization code to the ethernet library. I am still testing it.
in setSS(), I added one of these (tried several clock setting)
//full speed
SPCR &= 0xFC;SPSR |= 0x01;
//half speed, since Ethernet library uses this speed, I think this should be part of the code
SPCR &= 0xFC;SPSR &=0xFE;
//qtr  speed
SPCR = ((SPCR&0xFC) | 0x01);SPSR |= 0x01;
I still see the problem, so now I am thinking if it is a hardware (or hardware/software) issue.

What the program does is, I have an 8 channel relay that switches on and off, and I log the switching event to SD card. It appears like after the SD card write, the network connection drops (no problem on the SD card write). I can comment out the SD card write and the network does not drop. It does not happen all the time, maybe 10% of the time. For now, right after the SD card write, I make a network connection test, and if it fails, I call Ethernet.begin which brings up the ethernet again. I prefer to find the cause of this problem and fix it rather than use a workaround.
104  Using Arduino / Storage / Re: sdfat + ethernet + spi issue (ethernet dropping connection) on: September 10, 2013, 04:23:21 pm
^^^^ lol


I checked the W5100 datasheet, and it can handle 70ns SCK speed (about 14.28mhz), so it should work at spi_full_speed just fine, in theory.
105  Using Arduino / Storage / Re: sdfat + ethernet + spi issue (ethernet dropping connection) on: September 10, 2013, 04:06:49 pm
I just went through the spi, ethernet and sdfat libraries and atmega datasheet.

the default is as you stated (by virtue of SPCR and SPSR registers being initially 0), so ethernet runs at spi_half_speed (by sdfat terminology).

So it seems that if I use spi_half_speed on sdfat, then everything should be fine, but it is not the case. I will try one more step lower, since ethernet does not bother setting the SCK frequency, I'll see if it still works at the lower clock speed.

regarding the registers being read only or read write. according to the datasheet, SPCR is read/write, and SPSR bit SPI2X is read/write. I think sdfat code can be a good SPI bus citizen if it stores the SPCR bits 0 and 1 and SPSR bit 0 on chipSelectLow() and restores it in Sd2Card::chipSelectHigh().  That will be no different than saying SPI library must initialize SPI bus before each access, we are just moving that "initialize" up to sdfat code.

this is all about low level code working together correctly and has nothing to do with application level code.
Pages: 1 ... 5 6 [7] 8 9 ... 19