Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Networking, Protocols, and Devices / Re: Multi-Arduino Serial Communication with MAX232 on: February 13, 2014, 12:25:52 am
It's mostly smd... I will solder an ugly mess up for testing. The boards have other things going on as well so they are almost 5x5 inches.. not cheap to keep ordering prototypes lol

It looks like I will have to do a substantial rework of the main board. I really didn't want to add extra components to it because as I said some will be running without the BT sub-board. I was really hoping to not have the extra failure points. But as it looks pwr gnd tx rx are not going to be enough board interconnects.

Thanks for your advice. If you have any ideas on a good solution for the rework I would be glad to hear them smiley I doubt the BT module will have TX enable output... I will read some more datasheets.
2  Using Arduino / Networking, Protocols, and Devices / Re: Multi-Arduino Serial Communication with MAX232 on: February 12, 2014, 09:37:48 pm
I think I have made some progress...

Bad thing is I will have to have the original boards remade or maybe able to add the components to the current boards.

The top uC has CTS for RS232 that can be reconfigured to be TX Enable for RS485 or RS422. I will use that line for a switch or gate to isolate the TX when its not transmitting.(black square) And when the bottom board isn't connected everything should still act normally...

I will program a pin on the right 328p to act the same way as above for a TX Enable...(black square)

The problem I now face is the MAX232's ROUT and bottom uC TX will be on the same line when the top uC and bottom are talking....(red boxes) Is there a chance that the ROUT wont interfere with the line?????
3  Using Arduino / Networking, Protocols, and Devices / Re: Multi-Arduino Serial Communication with MAX232 on: February 12, 2014, 07:04:56 pm
more......

The only time the Bluetooth needs to communicate with RS232 is to get AT commands for settings.

Otherwise RS232 needs to communicate with the top uC, for sending data or AT commands.

Top uC needs to send data via RS232 or Bluetooth if RS232 is not connected.

Bluetooth needs to be able to send the top uC AT commands and maybe data when not connected to RS232.

More or less im trying to have RS232 and bluetooth as forms of communication for the top Uc... The problem is RS232 could send a AT command to top uC changing the baud. So now there needs to be a way to change the BT to match...........

Programming the AT commands:
I wrote the windows app for sending the AT commands via RS232 so I can add the commands to change BT settings at the same time.
I also wrote the Android app for sending AT commands via BT. Can make changes there also.

I cant change the firmware on the top uC or the BT module.....

Thanks again for the help

4  Using Arduino / Networking, Protocols, and Devices / Re: Multi-Arduino Serial Communication with MAX232 on: February 12, 2014, 06:54:47 pm
This image looks messy but I hope it helps communicate my goal.

The GREEN arrows are UART paths that need to communicate.

The RED arrows show paths that don't need communication.

So output from RS232 doesn't need to get to the bottom uC.

Maybe I should look at taking the right 328p out of the picture again, but then I don't have programmable logic to control the gates... The second picture shows the talk paths without the 328p, I will check the datasheets and see if they have a "Enable" output pin for UART transmit..??..
5  Using Arduino / Networking, Protocols, and Devices / Re: Multi-Arduino Serial Communication with MAX232 on: February 12, 2014, 06:11:37 pm
Makes sense..

If I were to have the original boards remade with two extra pins(tx, rx) in the header/board interconnect. Would the attached make sense for my objectives?

The bottom uC is actually a bluetooth module, on the new sub-board. The original board should run with or without the sub-board but I need to be able to change the params on the bluetooth module via UART.(this info may help understand what I'm trying to accomplish)

I may be better off just buying a BT that is capable of "overair" AT commands.....
6  Using Arduino / Networking, Protocols, and Devices / Re: Multi-Arduino Serial Communication with MAX232 on: February 12, 2014, 05:30:24 pm
The Serial.end();/pinmode would be an option. I will be writing the code on the right 328p for the sole purpose of being able to change operating params on the bottom uC. Thanks for the idea.

I see how the gates would work also, I have found a couple sch with that set-up. The problem I have now is that I already have the completed original boards so I cant add components... So when the right 328p is transmitting to the MAX232 I have no way to isolate the TX line of the top uC. I have read that adding a 4k7 pull-up resistor to the line might help with the issue??

Thanks Again

 
7  Using Arduino / Networking, Protocols, and Devices / Re: Multi-Arduino Serial Communication with MAX232 on: February 12, 2014, 09:41:20 am
I though of another way to do this. Please see the attached sch.

I should also mention I have already had the boards manufactured that hold the top uC and the MAX232. The bottom and right uC's will be on a board yet to be manufactured, connected to the original board with a jumper, with these pins. PWR-TX-RX-GND.

This solution uses serialsoft, and the MAX399 to isolate the communication when UC2(bottom) is talking to UC3(right).
8  Using Arduino / Networking, Protocols, and Devices / Multi-Arduino Serial Communication with MAX232 on: February 11, 2014, 11:58:11 pm
This may have been discussed before, but I couldn't find anything by searching google, I may not have been using the right keywords.

Please give your thoughts on the attached communication situations:

Questions on my mind:
-How will the MAX232 act when it gets TX signal on the ROUT pin?
-How will the uC's act when TX signal from one uC is on the TX pin of the other uC?

Goals:
-Normally the top and bottom uC's should communicate, the top and RS232 should be able to communicate.
-The operating params able to be changed on the top uC via RS232.
-The operating params able to be changed on the bottom uC via RS232.
My third sch should solve this... As long as the questions above aren't an issue??

Both uC's use a completely different protocol(of waits and characters) to enter command mode.

I should note I can NOT change the firmware on the top or bottom uC, I CAN on the right and the RS232.

Idea in third sch:

When the correct command mode sequence is recognized by the right uC it can control the multiplexer to reprogram operating params on the bottom uC that were given to it by RS232. All other times it will work as stated in the goals.

Should mention the multiplexer chip will really be SN74LV4052A. I only used the one shown for an easy way to communicate my goal... Or a MAX399 but they are pricey.

Thanks
9  Using Arduino / Microcontrollers / Multi-Arduino Serial Communication with MAX232 on: February 11, 2014, 06:50:13 pm
I moved it to the correct topic... It wont let me delete this post...

Moved to Networking
10  Using Arduino / Programming Questions / Auto Detect Baud Rate on: March 28, 2012, 10:48:36 pm
I have been searching for a solution to auto detect a baud rate of a serial connection with a gps reciever. Lefty has an old post showing interest in this concept, but I had no luck finding a finished solution. Any thoughts??
11  Using Arduino / General Electronics / Re: Best 5volt power supply for atmega328...??? on: March 02, 2012, 11:51:49 am
I used this dc-dc with external fuse, diodes and cap. Works great my in my circuit requiring 800ma max.

http://parts.digikey.com/1/parts/1867503-conv-dc-dc-7-5w-36vin-5vout-oki-78sr-5-1-5-w36-c.html
12  Using Arduino / Programming Questions / Re: Serial.write and Serial.read Xbee also port manipulation on: February 16, 2012, 02:36:52 pm
I finally understand how that will work with a "rollover"! I looked back at some old projects and Ive used it before but never understood why it works.

Unsigned will rollover backwards instead of negatively. So lets say the rollover is 600 just to make it easy...

unsigned int last = 595;
unsigned int current = 25;
current - last = 30        not -570!!

so 5 past before rollover(at 600) and 25 since rollover = 30 total.  Because of the way unsigned works. 25-595 gets to zero at 570 so then count backwards from rollover(600) or (600-570) and get 30.

Hope that mess above can help others understand how they work.


This is the code I used.
Code:
if(millis() - previousMillis ) >= interval)                     // If time to send
{
   bitWrite(bytetosend, 0, digitalRead(11));              // Read pin 11 and set 0 bit of byte to send.   
   Serial.write(bytetosend);                                     // Send byte
   previousMillis = millis();                                       // Set sent time
}
13  Using Arduino / Programming Questions / Re: Serial.write and Serial.read Xbee also port manipulation on: February 16, 2012, 10:41:18 am
The sendMillis is based on this link in the arduino playground. http://www.arduino.cc/playground/Code/TimingRollover Did I understand it wrong? I probably should have post my entire code.?.? 

The delay was based on a lot of forum post, without it people had some problems with serial.available function. If its not needed I will gladly take it out.

My code is still formatted the way you asked, for the post i "grouped" the code that we have discussed already to kind of "ignore" it. I will leave it alone in any new post.

Thanks Again.
14  Using Arduino / Programming Questions / Re: Serial.write and Serial.read Xbee also port manipulation on: February 15, 2012, 08:46:47 pm
I'm questioning if the below code is the way to do this. I need to now send data both ways. So both are sending data every 50ms and checking for data every 1ms (as long as it didn't have to send in the loop before). That way they should never fall behind. Since the data being received, doesn't effect what is being sent, it doesn't need to be synced. Look correct?


INPUTS
Code:
void loop ()
{
  if (Serial.available())
  {
    byte incomingByte = Serial.read(); // Read byte
    digitalWrite(11, bitRead(incomingByte, 0)); // Turn on/off pin 11 via 0 bit of the sent byte
  }
 
  if( (long)( millis() - sendMillis ) >= 0) // If next send time, check pins and send
  {
    for (int Bit = 0; Bit < 8; Bit++) {bitWrite(bytetosend, Bit, digitalRead(Bit+2));} // Read pins 2-10 and set all 8 bits of byte to send.   
    Serial.write(bytetosend); // Send byte
    sendMillis += 50;  // Set next send time
  }
delay(1); // NOT SURE TO USE THIS LINE OR NOT
}

OUTPUTS
Code:
void loop ()
{
 
  if (Serial.available())
  {
    byte incomingByte = Serial.read();
    for (int Bit = 0; Bit < 8; Bit++){digitalWrite(Bit+2, bitRead(incomingByte, Bit));}
  }
   
  if( (long)( millis() - sendMillis ) >= 0) // If next send time, check pins and send
  {
    bitWrite(bytetosend, 0, digitalRead(11)); // Read pin 11 and set 0 bit of byte to send.   
    Serial.write(bytetosend); // Send byte
    sendMillis += 50;  // Set next send time
  }
delay(1); // NOT SURE
}
15  Using Arduino / Programming Questions / Re: map 4 pins so each one has a position in a string received via serial port? on: February 14, 2012, 11:42:58 pm
I did something very similar in this thread today, I didn't use an array but took a different approach. It might help..

http://arduino.cc/forum/index.php/topic,91942.0.html
Pages: [1] 2 3 ... 6