Jump to content
43oh

Serial1 or SofwareSerial ?


Recommended Posts

this is not problem with use or not avalable() but with uart INT handler when You declare HardwareSerial mySerial(3);

For me: incoming interrupt for Serial3 is called correctly but core lib HardwareSerial.cpp don't know that your mySerial is Serial3.

I do not know how to solve this problem, how to assign mySerial to Serial3 but also would like to know the solution for WizFi library.




			
		
Link to post
Share on other sites

Reaper7 says it, but to extend the comment- declaring HardwareSerial only partially works and selectmodule(X) never worked for me. What has worked for me is the already defined

Serial1...; Serial2...; Serial3...; Serial4....;Serial5...; Serial6...;Serial7...  where "..." is ".available()",".read()"; ".print()" .(Serial4.available(), Serial5.read(), etc.)

 

Although Serial6 is defined, the hardware pins aren't easily accessed. (Blue wire and solder anyone?)

 

B

Link to post
Share on other sites

I also found Serial1 on PC_5 & PC_6. The oft referred (and beautiful) Pin diagram:  https://github.com/energia/Energia/wiki/Hardware shows RX(1) & TX(1) on both PC_5,PC_6 and on PB_0,PB_1 (pins 3,4).  The Launchpad User Manual also shows U1 on pins 3 & 4. 

I haven't been able to get any data out on these pins and I don't see any reference in HardwareSerial.cpp; is it possible to get Serial on PB_0,PB_1?

 

 

of course :)

This will be needed in the future for WizFi Boosterpack library (maybe this weekend...) :)

 

diff for latest GitHub HardwareSerial.cpp:

95c95
<     {GPIO_PA0_U0RX, GPIO_PA1_U0TX}, {GPIO_PC4_U1RX, GPIO_PC5_U1TX},
---
>     {GPIO_PA0_U0RX, GPIO_PA1_U0TX}, {GPIO_PB0_U1RX, GPIO_PB1_U1TX},
103c103
<     GPIO_PORTA_BASE, GPIO_PORTC_BASE, GPIO_PORTD_BASE, GPIO_PORTC_BASE,
---
>     GPIO_PORTA_BASE, GPIO_PORTB_BASE, GPIO_PORTD_BASE, GPIO_PORTC_BASE,
109c109
< // The list of i2c gpio configurations.
---
> // The list of UART gpio configurations.
114c114
<     GPIO_PIN_0 | GPIO_PIN_1, GPIO_PIN_4 | GPIO_PIN_5,
---
>     GPIO_PIN_0 | GPIO_PIN_1, GPIO_PIN_0 | GPIO_PIN_1,

attachicon.gifHardwareSerial.cpp.diff.7z

 

New github commit: Added alternate pin muxing for UART1 solves the problem with choice of port :)

Now we can choose witch port will be used: Serial1.setPins(UART1_PORTB) or Serial1.setPins(UART1_PORTC)

Link to post
Share on other sites
  • 2 months later...

Hi,

 

I would like to make my Stellaris talking to raspberry pi.

 

On Stellaris side I tried this code :

void setup() {
 unsigned char c = 0;

 Serial3.begin(9600);
 
 Serial3.println("Test starts ... ");
 while( c != 'U')
 {
  if (Serial3.available())
  {
   c = Serial3.read();
   delay(200);
   Serial3.print(c);
  }
 }
}
 
void loop()
{
}

I get this error message : 'Serial3' was not declared in this scope ..

 

Any help

 

Thank you

 

Regards

Link to post
Share on other sites
  • 3 weeks later...

Hello,

I tried the Serial3 with no sucess.

1st try with the default ide, and the error was no Serial3

2nd try with the updated HardwareSerial.cpp and HardwareSerial.h, but no success, nothing transmitted and received

3rd try with all hardware code code from github, but also no success, nothing transmitted and received.

I test only Serial3, (PC_6, PC_7) hand try also exchange the receive pin.

I used a Mac with energia-0101E0009-macosx.dmg and a serial usb dongle (I tested the serial usb and works fine)

Someone have a suggestion?

Thanks.

 

Alberto

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...