RS232 Interupt or buffer


Closed Thread
Results 1 to 4 of 4
  1. #1
    seascan's Avatar
    seascan Guest

    Question RS232 Interupt or buffer

    I was wondering if anyone could point me to a tutorial or can explain to me how to interupt my code when RS232 from a PC comes into my designated pin on an 18F452. Alternatively, is it easier to buffer the RS232 data so I can poll that pin when I can get around to it? How would you set something like this up?

    Currently I use the SERIN2 function, however I am worried about missing data from the PC when I am doing other things (like reading sensors, etc.)

    Thank you in advance.
    Terry Lease

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    If you need to receive serial data in the background, you'll definitely want to use the hardware USART.

    MeLabs has an example for the 18F452 that buffers inbound characters using the hardware USART here: http://www.microengineeringlabs.com/...8F/serA452.bas
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    seascan's Avatar
    seascan Guest


    Did you find this post helpful? Yes | No

    Default

    Bruce,

    Thank you for the quick response. I think it will take me a while to digest that tutorial (I have no asm experience). Have you (or anyone else) come across any "Idiot's Guide to the USART"? I'm looking for the basics about what a USART is... and then how to make use of it.

    Thanks again.

    Terry

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Terry,

    The best book I have ever seen for learning about PIC serial communications in general & the hardware USART - is Serial Communications by Roger L. Stevens from Square-1. It's not for the 18F series, but it is an excellent book for anyone using 14-bit parts.

    We carry this book, and you can also find it at Melabs, Amazon.com or at the Square-1 website at http://www.sq-1.com

    There's also a decent book specifically for the 18F452 by John B. Peatman titled "Embedded Design with the PIC18F452 Microcontroller", and chapter 18 addresses the USART.

    I also recommend reading the PIC18C Reference Manual from Microchip. It's nowhere near the "idiots guide", but definitely a recommended read if you're working with the 18F series.

    The hardware USART really isn't all that hard to learn. Just tinker with a few experiments & code examples, read the ref manual & datasheet, and you'll get the hang of it...;o}
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. PIC16F88 HSERIN to LCD Problem
    By robbrownuk in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 6th June 2009, 22:32
  2. PC to EUART on pic 16F688
    By docaberle in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 25th October 2008, 06:33
  3. Student Project
    By aggie in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 8th July 2006, 08:56
  4. USB Interface using PIC
    By Tissy in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 22nd May 2006, 16:04
  5. Infrared Communications over RS232 UART or with B0 interupt
    By modifyit in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th December 2005, 19:17

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts