element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Reading UART Rx Buffer (MKR WiFi 1010 / MKR 1000)
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 16 replies
  • Subscribers 391 subscribers
  • Views 2817 views
  • Users 0 members are here
  • rx
  • uart
  • arduino
Related

Reading UART Rx Buffer (MKR WiFi 1010 / MKR 1000)

kas.lewis
kas.lewis over 5 years ago

Hello All,

 

I'm looking to create my own UART interrupt. For those who need to know why it's because I need to stop the timer as soon as a value comes in. While I know I will get a lot of reasons and explanations why this is not necessary I'm a lot more interested in how to go about doing this.

 

I have to commented out

 

void SERCOM5_Handler()

{

  Serial1.IrqHandler();

}

 

in the variant.cpp file which works to remove the Arduino code from doing what it wants. The issue I'm having now is finding the function Serial.read(). I'm trying to read the uart rx buffer but with Atmel's documentation what it is this is not as easy as it should be.

 

 

I have tried

 

void SERCOM5_Handler()

{

  char temp = SERCOM5->USART.DATA.reg;

  if (temp == 'h' || temp == 'H'){

    digitalWrite(LED_BUILTIN, HIGH);

  }

  if (temp == 'l' || temp == 'L'){

    digitalWrite(LED_BUILTIN, LOW);

  }

}

 

 

without much success. Therefore any help in reading the UART rx register would be very much appreciated.

 

Kas

  • Sign in to reply
  • Cancel

Top Replies

  • BigG
    BigG over 5 years ago +1
    I can see where you are coming from. Usually you could use the "serialEvent()" function but I see that this is not possible with Arduino SAMD Boards. Unortunately, I have no idea why but will be following…
  • michaelkellett
    michaelkellett over 5 years ago +1
    Is (temp == 'h'||temp == 'H') the same as ((temp == 'h')||(temp == 'H')) ? (brackets are free and make code easier to follow, (actually == has precedence over || in C )) How are you debugging this - can…
  • kas.lewis
    kas.lewis over 5 years ago in reply to michaelkellett +1
    Hello michaelkellett I didn't know you can put breakpoints in the Arduino IDE. Truth is there is lots about Arduino I don't know as I usually do bare metal with direct control of al registers and I also…
Parents
  • BigG
    BigG over 5 years ago

    I can see where you are coming from. Usually you could use the "serialEvent()" function but I see that this is not possible with Arduino SAMD Boards. Unortunately, I have no idea why but will be following this one.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • BigG
    BigG over 5 years ago

    I can see where you are coming from. Usually you could use the "serialEvent()" function but I see that this is not possible with Arduino SAMD Boards. Unortunately, I have no idea why but will be following this one.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube