Show Posts
|
|
Pages: [1] 2 3 ... 66
|
|
2
|
Using Arduino / Networking, Protocols, and Devices / Schematic Needed seeed ethernet v1.1
|
on: May 22, 2013, 09:41:28 am
|
I picked up a seeed stutio ethernet shield at radioshack for 19.99. http://www.seeedstudio.com/depot/ethernet-shield-p-518.html It works fine if I have it plugged in to an arduino but not if I connect it with jumpers. I'm connecting gnd, 5v, reset, and pins 10-13. I note that it has an ISP female header that plugs into the arduino male and i'm wondering if that is where it is getting its spi signals. The ISP header's sck, miso & mosi are connected to 13, 12, and 11 on the arduino but seem to be isolated from them on the seeed shield. I'm not sure why that's useful but then i'm not sure why it has an ISP connector! I may just try jumpering to the isp but i'd rather look at the schematic first.
|
|
|
|
|
4
|
Using Arduino / Programming Questions / Re: pointers - casting - what does this mean?
|
on: April 24, 2013, 04:14:01 pm
|
Is it somehow different from sum += *(unsigned int*)ptr; Which is plenty ugly enough already. Not much different. The intent is to ensure the byte ordering. With your expression, the byte ordering depends on the compiler / architecture. With the other expression, the byte order is always the same (presumably "network order"). The (unsigned long) cast is strange. Seems rather pointless given the facts that the value can never exceed 16 bits and it is followed by the (unsigned int) cast. Oh well. ah, I get it. excellent point.
|
|
|
|
|
5
|
Using Arduino / Programming Questions / pointers - casting - what does this mean?
|
on: April 24, 2013, 02:58:27 pm
|
I came across the following in the library for an ethernet module. It's to do with calculating a checksum. I THINK it means: take the two bytes at the adrress in ptr as a 16 bit unsigned int and add them to the 32 bit signed integer sum but all the casting leaves me a bit boggled. char * ptr; long sum; ... sum += (unsigned int) (((unsigned long)*ptr<<8)|*(ptr+1)); Is it somehow different from sum += *(unsigned int*)ptr; Which is plenty ugly enough already.
|
|
|
|
|
6
|
Development / Other Software Development / substituting another compiler for avr-g++
|
on: March 12, 2013, 08:51:37 am
|
I am really in the weeds here and any contribution would be gratefully accepted. I am attempting to use the IDE with another compiler(LCC re-targeted for a 1970's microprocessor). At the moment, I'm just replacing the avr-xxx modules in C:\...\arduino-1.0.3\hardware\tools\avr\bin with stubs that invoke my compiler. My puzzle is a discrepancy between the commands the compiler displays and the parameters my stub says it's getting. For example - the IDE displays C:\apps\arduino-1.0.3\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega644p -DF_CPU=1600000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=103 -IC:\apps\arduino-1.0.3\hardware\arduino\cores\arduino -IC:\apps\arduino-1.0.3\hardware\arduino\variants\standard C:\Users\bill\AppData\Local\Temp\build2832089004955701964.tmp\Blink.cpp -o C:\Users\bill\AppData\Local\Temp\build2832089004955701964.tmp\Blink.cpp.o
but my stub sees Command-line arguments: argv[0] C:\apps\arduino-1.0.3\hardware\tools\avr\bin\avr-g++, argv[1-13]=... argv[14] -IC:\apps\arduino-1.0.3\hardware\arduino\cores\arduino, argv[15] -IC:\apps\arduino-1.0.3\hardware\arduino\variants\standard, argv[16] Blink.cpp, argv[17] -o, argv[18] Blink.cpp.o,] i.e., the path information is missing from the input and output file names. could this be transmitted some different way like an environment variable? Seems unlikely but ...
|
|
|
|
|
10
|
Using Arduino / Networking, Protocols, and Devices / Bit Bang SPI question on the receiving part.
|
on: February 22, 2013, 05:27:31 pm
|
The code below works fine for a mode 0 device. The device wants an idle byte between sending a read command and reading the result. What puzzles me is that I have to start reading the result on miso BEFORE sending the 1st clock pulse for the third byte transmitted. If I were using hardware spi I would just send the three bytes and the result would be in spdr. i.e. the slave clocks out its 1st data bit on the falling edge of the 16th clock(the last clock of the 2nd byte). Does this make sense and I'm over-thinking it? Maybe the way to think about it is that the avr reads miso on the rising edge of the 17th clock (for hardware spi)? temp=cmd; for(i=0;i<8;i++){//first write the command digitalWrite(mosi,(temp&0x80)); //by setting mosi for each bit digitalWrite(sck,HIGH); //then pulsing the clock digitalWrite(sck,LOW); temp<<=1; } for(i=0;i<8;i++){ //now we send 8 clock pulses while the enc thinks digitalWrite(sck,HIGH); digitalWrite(sck,LOW); } result=0; for(i=0;i<8;i++){ //now we read the data back result=(result<<1)|digitalRead(miso); //by grabbing miso for each bit digitalWrite(sck,HIGH); //then pulsing the clock digitalWrite(sck,LOW); } return(result);
|
|
|
|
|
12
|
Community / Bar Sport / Re: Where to get a Due or Raspberry Pi for Xmas gift
|
on: November 30, 2012, 08:14:20 am
|
Unless there's a special reason that it HAS to be a Due, or (shudder), Pi....
I dunno, I was assuming the relative had asked for a Due or Pi. The relative in question is an experienced arduino user and a gadget freak. He doesn't need another processor, this is a "for fun" thing - the Pi and the Due are the "ooh shiny" of the moment.
|
|
|
|
|