Serial addressing


Closed Thread
Results 1 to 5 of 5
  1. #1
    electronicsuk's Avatar
    electronicsuk Guest

    Default Serial addressing

    Hi everyone. Looking at the documentation for PIC micros such as the 16F627 and 16F877, its possible to use a 9th bit for addressing purposes so that an interrupt will only be generated by the UART on address bytes. This is useful, but are there any PIC micros that has a specific register set aside for an address byte, and will compare this to the data on the serial line and only generate an interrupt when they match?

    Cheers,

    Matt

  2. #2
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    From everything I have read the 9th bit is the only option. If you don't do 9th bit then you have to do it in software.

  3. #3
    electronicsuk's Avatar
    electronicsuk Guest


    Did you find this post helpful? Yes | No

    Default

    Thats a shame, as it would mean a lot less work from a design point of view if microchip implemented a proper hardware address detect and compare. I'll just have to go with 9th bit, it still frees up more CPU time than having to validate every byte of data the UART receives. Cheers.

  4. #4
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    The problem is making the UART aware of the fact that a byte in the data packet is an address. With most protocols the address is not the first byte. It would be very complex to implement that.

    The "hard way" is not too bad. I'm doing a project now that responds to the node address and 00 as a multicase discovery address. Its not too bad.

  5. #5
    electronicsuk's Avatar
    electronicsuk Guest


    Did you find this post helpful? Yes | No

    Default

    I agree it would be more complicated to do address detect without the 9th bit, but it would be relatively easy to keep the 9th bit system but also to have the PIC compare the received address to one with a register, and ignore any addresses not designated for that particular micro.

    Alternatively design a protocol where the address bytes can never occur as a data byte, for example all decimal values above 100 can be used for addressing only. The trouble I had before with this system is that every time the UART received a byte of data, it would have to be read and checked to see if it was an address, even if it was only a data byte. There was absolutely no way of knowing without reading the data.

    On its own this wouldn't be a problem, but at the same time I'm keeping an eye on a zero crossing detector and driving 8 triac dimming outputs. When sending out large amounts of data the lamps being driven by the triacs would flicker slightly as the micro was having to take some time out from the dimming routine, go read the UART and make a comparison.

Similar Threads

  1. Replies: 33
    Last Post: - 19th March 2010, 03:02
  2. Dynamic USB Serial Number (PIC18F4550)
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th July 2009, 17:03
  3. PIC18F4680 to PC via MAX232 (RS232 serial) no output
    By opticsteam1 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th April 2008, 20:39
  4. interfacing to the pc serial port
    By kelangfei in forum General
    Replies: 4
    Last Post: - 7th October 2007, 22:35
  5. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 03:46

Members who have read this thread : 1

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