USART on 16F627


Closed Thread
Results 1 to 5 of 5

Thread: USART on 16F627

  1. #1
    electronicsuk's Avatar
    electronicsuk Guest

    Default USART on 16F627

    Hi all. I've just finished soldering up four PCB's for a serially controlled switch box. I'm using the UART for receiving data, but I don't need to transmit so decided to use portb.2 (TX on the 16F627) as an output pin to my triac isolators. However, whenever the serial port is enabled this pin is constantly set high. Is there any way on this PIC to turn on serial reception without enabling the transmit pin?

    There is absolutely no way I can resolder the PCB's, as the boards have now been cased up and the triacs (isolated tab of course!) riveted to the metal casing for use as a heatsink

    Thanks,

    Matthew
    Last edited by electronicsuk; - 30th November 2004 at 15:00.

  2. #2
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Unhappy

    Hi Matthew,

    I looked over the datasheet and can't see any way to take control over this pin if the USART is enabled. If you're planning on triggering the triac with low pulses you might get away with this pin afterall. If you transmit $ff that will simply be one low pulse, 1/baudrate long(1/9600=0.1ms). If this is not possible, you need to disable the USART and go softwareserial instead.

    /Ingvar

  3. #3
    electronicsuk's Avatar
    electronicsuk Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for the help. Unfortunately I can't go with software, this thing also does dimming and I need to use hardware serial so I can carry on with my dimming routine at the same time. I do have a spare i/o so unless anyone has any other suggestions, I will just have to solder a jump wire on the chip itself, seen as I can't get to the underside of the PCB any more. One thing that the chip does allow is for you to disable the TX pin by setting it as an input, but unfortunately I need it as a standard output.

    Matthew

  4. #4
    electronicsuk's Avatar
    electronicsuk Guest


    Did you find this post helpful? Yes | No

    Default

    Think I've sorted this one now, rather than sending the port low, I'm just having to set it as an input which does practically the same job. It's a bit kludgy but it seems to work. Let's just hope that the 627 doesn't mind having a pin changed between input and output around 100 times a second!

    Matthew

  5. #5
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Thumbs up

    Hi Matthew,

    Good to hear that you've come up with a possible solution.

    Just make sure that you don't need a pullup or pulldown, if you connect directly to a triac or optocoupler(led) there shouldn't be any need for it. If you connect to a FET or MOSFET (ic or discrete) you probably will need one.

    The Pic will not have any problems with toggling between input and output, it's basically the same as toggling the output buffer, i've done it many times to emulate an open collector output. No problems whatsoever, ever.

    I did find a statements in the datasheet that led my mind in the direction that it could be possible to set the pin to input. However, quite often i find that there are small errors in the datasheets, usually in the text. The blockdiagrams that shows the internal configuration of each pin are usually more accurate. Not in this case, it seems, according to that figure it should be impossible to do what you're doing. Keep this in mind if you plan to migrate to another pic(16F627A or 16F628), it's easy to assume that they should behave identical, but there is no guarantee.

    Good luck
    /Ingvar

Similar Threads

  1. byte Tx w/ USART 16f876a problem
    By GargamelDigi in forum mel PIC BASIC
    Replies: 2
    Last Post: - 15th July 2008, 05:50
  2. problem with USART
    By leemin in forum Serial
    Replies: 4
    Last Post: - 11th December 2006, 17:56
  3. I ammm Looosssst (USART Help)
    By shawn in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th May 2006, 05:05
  4. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07
  5. Replies: 5
    Last Post: - 1st December 2004, 12:49

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