Show Posts
Pages: 1 ... 53 54 [55] 56 57
811  Using Arduino / Project Guidance / How does the Arduino Uno use its USaRT? on: February 06, 2011, 05:55:05 pm
Hi All...

I see that the Arduino Uno with the 328p CPU has one USaRT built on to the 328p chip. I also see that if I use NewSoftSerial and specify pins 1 and 2, I can use it to talk out the USB port.

Is the USB port wired to the USaRT in the 328p? Or is it available for communication with another device?
812  Using Arduino / Programming Questions / Re: Convert C++ to Arduino Programming on: February 06, 2011, 05:47:19 pm
well, where do we start? An Arduino has no console unless you provide one. What kind of input/output or human-computer interface you need depends upon what you want your device to do. You can hook your Arduino up yo your PC using the USB cable, then use a terminal emulator program to talk to it. You then can use some code to read from and write to that serial port.

In Arduino, the setup() function is called when the device powers up and then the loop() function is called. I don't know if the C++ stream IO library is implemented or if there is anything similar. You could do that I guess.

Code:
#include <NewSoftSerial.h>

// The arguments are the RX and TX pins, respectivrly
//NewSoftSerial mySerial(2, 3);

// Pins 0 and 1 are the system port that uses the USB header (RX, TX)
NewSoftSerial mySerial(0, 1);

void setup() 
{
  // set the data rate for the NewSoftSerial port
  mySerial.begin(19200);
  mySerial.println("Hello, world?");
}

void loop()                     // run over and over again
{
  // Echo received keystrokes back out
 
  if (mySerial.available()) {
      mySerial.print((char)mySerial.read());
  }
}
813  Using Arduino / Programming Questions / Re: Don't understand NewSoftSerial example... on: February 05, 2011, 04:56:52 am
Got it. If I instansiate NewSoftSerial with pins 0 and 1 it uses the system port. Maybe I'll add those values as defaults on the constructor, or else add a default constructor to my copy of the library.

Thanks everyone!
814  Using Arduino / Programming Questions / Re: Don't understand NewSoftSerial example... on: February 05, 2011, 04:39:19 am
Okay so looking through the code, I see that there is only one constructor and it wants pin numbers for the IO. So does that mean I need to know which pins are connected to the UART, or does it mean I can only use this library for serial IO on the digital input/output pins?

Thanks...

815  Using Arduino / Programming Questions / Re: Don't understand NewSoftSerial example... on: February 05, 2011, 04:30:12 am
Oh okay, thanks. Is there a way to use NewSoftSerial with the standard serial port?

I looked for docs on it, no joy...
816  Using Arduino / Programming Questions / Don't understand NewSoftSerial example... on: February 05, 2011, 04:03:24 am
Hi All...

I'm trying to understand the NewSoftSerial example...

Code:
#include <NewSoftSerial.h>

NewSoftSerial mySerial(2, 3);

void setup() 
{
  Serial.begin(57600);
  Serial.println("Goodnight moon!");

  // set the data rate for the NewSoftSerial port
  mySerial.begin(4800);
  mySerial.println("Hello, world?");
}

void loop()                     // run over and over again
{

  if (mySerial.available()) {
      Serial.print((char)mySerial.read());
  }
  if (Serial.available()) {
      mySerial.print((char)Serial.read());
  }
}

I see tha it instansiates an instance of NewSoftSerial. Okay, simple enough.

Why in the setup function is he using the standard Serial library to set the port speed and output some text?

Then, why does he use NewSoftSerial to change the baud rate?

When i compile and run this example on my Uno, I open a terminal program, set it to the correct com port, then set the speed to 57600 and I see the Goodnight Moon text. But then I don't see Hello World. If I set my baud rate to 4800 I only see a little junk.

Can some kind soul please explain what this app is supposed to do?

Thanks...

817  Using Arduino / Project Guidance / Re: Power outage alert system on: February 04, 2011, 04:59:25 pm
I agree... An inexpensive UPS will keep the cable modem (or whatever) up, keep the air pump running, and connect to a PC that can send a text to your phone. If you don't want the PC, then you could build a little board that would talk to the UPS and then send an email to your phone when the power goes out.

But for this to work you need to keep the Internet up and that probably means a UPS.
818  Using Arduino / Storage / Re: Big EEPROM shield? on: February 04, 2011, 04:55:22 pm
Yeah I had to order a board to solder the chip to. It has pins I can stick in the bread board. I was not thrilled, since its more work and more risk to damage the chip.

Along those lines, could I use a toaster over as a wave solderer? Whats the best way to solder these chips to these prototype boards?
819  Using Arduino / Project Guidance / Re: Serial comm without a UART? on: February 04, 2011, 02:18:46 pm
Ah, the world of ever changeing requirements :-( If the baud rate were to go up from 4800 to 19200, would the NewSoftSerial lib still be able to keep up?

Thanks...
820  Using Arduino / Storage / Re: Big EEPROM shield? on: February 04, 2011, 02:16:22 pm
Er, maybe not about it being obsolete, but if that was not the one then a similar one was. There are many to choose from though. I ordered plenty of extra chips, I'm good at frying things. I'll post my success (or lack thereof) with these guys.

Thanks again!
821  Using Arduino / Storage / Re: Big EEPROM shield? on: February 04, 2011, 02:14:31 pm
The Atmel chip originally suggested is now obsolete, and there is a replacement. There is also a 4MByte version, which I ordered to play with. Not bad for $3.87 qty 1. Hopefully I can use the same library, or with just a little modification.

The other chip is 8MByte! Different maker, so probably I'll need to do more codeing but 8MByte would make sure I never run low, and make the end users happier as they can record their samples more frequently. This one is $5.64 qty 1. Getting pricy but I don't sweat the small stuff ;-)

Thanks guys!  
822  Using Arduino / Storage / Re: Big EEPROM shield? on: February 04, 2011, 02:05:31 pm
Awesome! Thanks! At $1.82 quantity 25 from Digikey, its very affordable. I think I'll order a few extra so I can have spares on hand in case of frying :-(

We have a local Arduino vendor in Providence. I actually lost my Arduino that I bought a few months ago. Boy is that frustrating! So I'll go buy a new one along with a breadboard and see if I can make this work.

UPDATE:

I ordered these:

W25Q64BVSFIG-ND
8MB
http://search.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&site=us&keywords=W25Q64BVSFIG-ND

AT45DB321D-SU-ND
4MByte (32 Mbit)
http://search.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&site=us&keywords=AT45DB321D-SU-ND&x=22&y=21

823  Using Arduino / Storage / Re: Big EEPROM shield? on: February 04, 2011, 02:34:39 am
Well as someone pointed out, if I want about 2 megabytes of space I am better off with flash. A 2 MByte flash chip is about $1.60 quantity 1, and about $0.75 quantity 100. Its just for data logging. I'll write a windows app that can fetch the data off the Arduino.

I did look at the Mega2560. It has a lot of stuff I don't need and does not have any mass storage, although the hardware UART serial ports are nice. But it's $65 bucks! For $80 I can get an entire ARM board, complete with USB host ports, UART based serial, all running linux. I'm hoping to keep the per unit cost, including electronics, case, manual and packaging below about $60.00. 
824  Using Arduino / Storage / Re: Big EEPROM shield? on: February 04, 2011, 01:50:34 am
Also, that tutorial was a great help. But, it did not discuss how to do page addressing. How do I tell the storage chip which page I want to write to or read from?

Thanks again, this is a great help!
825  Using Arduino / Storage / Re: Big EEPROM shield? on: February 04, 2011, 01:49:30 am
Thanks guys, I just found this tutorial:

http://www.arduino.cc/en/Tutorial/SPIEEPROM

That answered many questions I had. So I guess some chips on a SPI are addressable while others are not.

As to which Arduino, I don't know yet. Something like this:

http://www.nkcelectronics.com/freeduino-serial-v20-board-kit-arduino-diecimila-compatib20.html

That one has the ATmega328P CPU and is powered by 12VDC. The thing I want to build will run where there are 12VDC readily available from a battery. I need a real RS232 port. Ideally it would be nice to have both an RS232 port and a USB port to talk to a PC but I have not yet found an Arduino that can do that.

Its also cheap, which is a huge plus. I need to produce these in quantities between 100 and 500 units over the next several years and no one will pay much for one.

Pages: 1 ... 53 54 [55] 56 57