Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 67
61  Using Arduino / General Electronics / Re: What's a good thickness of copper clad to use? on: March 12, 2012, 08:58:50 pm
I believe standard copper clad is .035 "

I imagine yours would etch more easily though.

If you have the space to make your traces wider maybe thinner is better!
62  Using Arduino / Programming Questions / Re: Single pin Port Manipulation on: February 25, 2012, 12:45:21 pm
So, I wrote a short blink sketch. I used #define to set the hex values, now using them in the program is easy.
This compiles to 846 bytes (IDE 0023) but using digitalWrite() to do the same thing compiles to 1034 bytes. After seeing this, it's hard to think of a good reason to use digitalWrite anymore smiley-lol
Code:
#define D13high  | 0x20;  //hex code to write Digital Pin 13 HIGH
#define D13low & 0xDF;  //hex code to write Digital Pin 13 LOW

void setup()
{
  pinMode(13, OUTPUT);
}
void loop()
{
  for(int i = 0; i < 10; i++)
  {
    PORTB = PORTB D13high;  //set Digital 13 HIGH
    delay(100);
    PORTB = PORTB D13low;   //set Digital 13 LOW
    delay(100);
  }
  while(1);
}
Until you want to change the pin you're using!
63  Using Arduino / Programming Questions / Re: Blink Without Delay Revisited on: February 25, 2012, 12:42:11 pm
I like your code - thanks for sharing.
64  Using Arduino / General Electronics / Re: generating a two stage signal. on: February 10, 2012, 01:22:50 pm
ok, way better idea.  The single digital pin will drive both outputs either high or low but, if I tri-state the pin, resistors will pull the outputs to the reset state.  much simpler and i can control the sequencing in software.
65  Using Arduino / Interfacing w/ Software on the Computer / Re: Connection using pyserial doesn't work properly on: February 10, 2012, 01:02:23 pm
I can't speak to the linux serial open differences but this http://arduino.cc/playground/Interfacing/Python does sPeak to them.

66  Using Arduino / Interfacing w/ Software on the Computer / Re: Connection using pyserial doesn't work properly on: February 10, 2012, 10:48:39 am
I wonder if you should try some sort of ack/nack/timeout protocol like when the arduino wakes up it sends a syn character and waits for an ack in return. If it doesn't get one after (say) 500 ms it tries again. Once it gets an acknowledgement hack you can go to whatever protocol you had planned. Your python script could reset the arduino when it starts and, if it doesn't see a syn within some time, reset it agaIn.

There's probably some mOre robust variant of this but you get the idea.
67  Using Arduino / General Electronics / Re: generating a two stage signal. on: February 09, 2012, 07:23:13 pm
@lefty, yeah, nothing left, I'm even using the xtal pins.  The avr just has a bit part in the circuit but its i/o pins are all spoken for.

@MarkT and tjb: I don't *think* it's a single 555 or monostable because I need one output to go high first when my input goes high and stay high longer when it goes low.

So far I'm looking at the following when the input on the left goes high, the lower right output (/clear) will be slower to go high because of charging its cap thru the 100k rx.  when my input drops, the top output will stay high longer because it has to discharge its cap through a 1M vs the 100k.  I think this would work but it's a lot of pieces.
68  Using Arduino / General Electronics / generating a two stage signal. on: February 09, 2012, 06:04:52 pm
I'm short an output pin to control an outside circuit and I need a simple way to control two outputs from 1 pin.

when my input signal goes low to high I want output A to go high, then 100-200 ns later, output B to go high.

when my signal goes high to low I want output B to go low then 100-200 ns later output A to go low.

The effect is that both A and B track my input but I always get A=high and B=low briefly between transitions.  (I'm driving control pins on another processor between two stable states 11 and 00 with a guaranteed 10 in the middle which is a reset).
69  Community / Exhibition / Gallery / Quad-core assymetrical multi-processor on: February 04, 2012, 04:06:05 pm


The RBBB on the bottom right is running a modified version of arduinoisp to load code into the CDP1802 "olduino" on the left.  The diecimilia top right is back-channel serial debugging info from the arduinoisp.  The breadboard processor in the middle is actually not connected to the others, it just happened to be on the breadboard and i didn't want to screw it up.  I just thought the whole thing was funny enough to share.
70  Using Arduino / Microcontrollers / Re: Arduino UNO 3 Digital I/O count on: February 04, 2012, 08:43:19 am
Have a look at PORTB and direct port manipulation. This may be exactly what you need.
71  Using Arduino / Networking, Protocols, and Devices / Re: NewSoftSerial - what the *heck* am I doing wrong? - it's the timing stupid. on: February 02, 2012, 05:02:55 pm
ok, hard to be sure because I had to rearrange and redo a bunch of wiring but I think the problem was cured by using a crystal controlled chip.

Thanks PaulS

Most importantly, by doing the rewiring I found the misconnection that was driving me to want the double serial connection in the first place!
72  Using Arduino / Networking, Protocols, and Devices / Re: NewSoftSerial - what the *heck* am I doing wrong? on: February 02, 2012, 03:59:56 pm
Quote
18 was floating by the way which I suppose might matter.
How could it be floating is SoftwareSerial was controlling it?

Quote
No! that's why sloppy timing is a suspect.
What frequency are you using? Are you specifying the correct rate in the boards.txt file?

the breadboard is running at 8mhz on the internal timer - it's selected as a lilypad 168 in tools/board.  I'm pretty sure that's right and i have tested its hardware serial - not lately I have to admit.

18 was floating in that it's not connected externally.

I'm now swapping in a crystal controlled board and i'll see what happens.
73  Using Arduino / Networking, Protocols, and Devices / Re: NewSoftSerial - what the *heck* am I doing wrong? on: February 02, 2012, 03:42:08 pm
Quote
Why are you not using digital pins?
19  was what I had left!  I can try one of the standard digital pins if you think it matters. 18 was floating by the way which I suppose might matter.

Quote
You want software serial to control the pins, right? Don't go mucking with the pin mode, then.
I've seen examples with and without the pinModes and I've tried it with and without - and with and without external pullups.

Quote
Is your breadboarded 168 using a 16MHz crystal/resonator?
No! that's why sloppy timing is a suspect.  I'm pulling the hardware apart now to add a crystal controlled board.  I'll just be kicking myself if the problem is still there.
74  Using Arduino / Networking, Protocols, and Devices / NewSoftSerial - what the *heck* am I doing wrong? on: February 02, 2012, 03:22:36 pm
This sketch just sends out some ascii one's as a test stream - it's running on a breadboarded 168
Code:
#include <NewSoftSerial.h>
#define rxPin 18
#define txPin 19
NewSoftSerial mySerial(rxPin, txPin);
void setup() {
  mySerial.begin(9600);
  mySerial.print("1111111111");
}
void loop(void) {
}

This code catches the software serial stream and passes it to the PC over the hardware uart & USB - it's on a diecimilia 328.
Code:
#include <NewSoftSerial.h>

#define rxPin 2
#define txPin 3

// set up a new serial port
NewSoftSerial mySerial(rxPin, txPin); //(rx,tx)

void setup()  {
  // define pin modes for tx, rx, led pins:
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  Serial.begin(9600); //start the hardware UART as well
  Serial.println("Software Serial to Hardware Serial Relay");
}
void loop() {
  // listen for new serial coming in:
  if (mySerial.available()){ //if there's new data in
      char someChar = mySerial.read();
      Serial.print(someChar); //send it to the PC
  }
}

By the time it gets to windows the characters are mangled insead of ascii "1"s I'm getting someling like hex C5 C5 8A 8A 8A 8A 8A 8A 8A 8A FE

The only thing I can think of is that the internal timing of the breadboard processor is too sloppy but before I start ripping the hardware up I thought I'd ask if anyone can see something else I've goobered.  I know I've used software serial before at higher data rates on a breadboard with no problem.
75  Using Arduino / Interfacing w/ Software on the Computer / Re: Terminal Program with hex display - Realterm on: January 31, 2012, 06:37:06 pm
outstanding - thanks!
Pages: 1 ... 3 4 [5] 6 7 ... 67