Framing error if I disable transmitter after shift register is empty?


+ Reply to Thread
Results 1 to 40 of 46

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653

    Default Re: SOLVED - Framing error if I disable transmitter after shift register is empty?

    you have now declared the thread solved when it is not!
    the problem is only temporally masked and will rear its ugly head when you enable another transmitter
    Warning I'm not a teacher

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170

    Default Re: SOLVED - Framing error if I disable transmitter after shift register is empty?

    Quote Originally Posted by richard View Post
    you have now declared the thread solved when it is not!
    the problem is only temporally masked and will rear its ugly head when you enable another transmitter
    Yeah, I thought the problem went away. I'll edit them back.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139

    Default Re: Framing error if I disable transmitter after shift register is empty?

    Since the output on that specific chip will remain as driven output, and if you insist on using this, a crapy solution maybe to add a diode at the output before the pin is connected to the bus.

    The cathode to the PIC usart output and anode to the bus.

    Like an OR connection of all the PICs that will be in parallel. Then a pull up will hold line to HIGH state.

    This is subject to capacitances over the bus and the pull-up resistor may not be able to charge that capacitances fast enough but you can test it and see if your are OK with the speed you may obtain.

    The chip that you found to be faulty, may have been hit by ESD charge. Are you familiar with ESD protection? Are you taking measures when you handle ESD sensitive components?

    Ioannis
    Last edited by Ioannis; - 24th September 2024 at 12:32.

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170

    Default Re: Framing error if I disable transmitter after shift register is empty?

    Quote Originally Posted by Ioannis View Post
    Since the output on that specific chip will remain as driven output, and if you insist on using this, a crapy solution maybe to add a diode at the output before the pin is connected to the bus. ...
    I "like" the 16F1937, but I have no allegiance towards it (I only have 15 on hand, I'll keep them for "something else"). I'm starting the slow/annoying process of choosing another PIC, with added requirement for ODCON register.


    Quote Originally Posted by Ioannis View Post
    ... The chip that you found to be faulty, may have been hit by ESD charge. Are you familiar with ESD protection? Are you taking measures when you handle ESD sensitive components?

    Ioannis
    I don't have carpet, and that's the extent of my ESD protections. I think I somehow messed it up when I first powered it up on the breadboard. It's a real possibility that I applied power to the wrong pins.
    Last edited by Demon; - 24th September 2024 at 18:11.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139

    Default Re: Framing error if I disable transmitter after shift register is empty?

    Quote Originally Posted by Demon View Post
    I don't have carpet, and that's the extent of my ESD protections.
    Well the carpet is one thing. Even if you just walked the room and returned back to you chair (even worse if it has suspension), then you may well have charged enough to destroy the chips.

    You have to remember to ground yourself just before you touch components or even better have a wrist band to permantly ground your body (through a high value resistor of course).

    ESD can destroy just a tiny part of the chip, enough to drive you crazy!

    Ioannis

  6. #6
    Join Date
    Aug 2011
    Posts
    455

    Default Re: Framing error if I disable transmitter after shift register is empty?

    Am I supposed to set TRIS as well?
    The USART section in the datasheet for your device will tell you if you should set/clear the TRIS bits for the TX/RX pins.
    If the chip supports open-drain mode then you just need to setup the TX pin to enable it at startup (ODCONC.6 = 1).
    There's no need to set and clear it, and you won't need to enable/disable TXEN anymore either.

    Add a pullup to the TX line (you say you already have one), and you can connect all the TX lines from the different pics together now.

    If your pic has PPS you'll probably need to set that up too to assign the pin to the UART TXD function.
    PPS output functions aren't typically enabled by default.

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170

    Default Re: Framing error if I disable transmitter after shift register is empty?

    Quote Originally Posted by tumbleweed View Post
    The USART section in the datasheet for your device will tell you if you should set/clear the TRIS bits for the TX/RX pins....
    I've misunderstood/misinterpreted the data sheet before. Seriously, I read the EUSART section and my eyes gloss over when they start making distinctions between half-duplex, full-duplex, synchronous, asynchronous...)


    Quote Originally Posted by tumbleweed View Post
    ..If the chip supports open-drain mode then you just need to setup the TX pin to enable it at startup (ODCONC.6 = 1).
    There's no need to set and clear it, and you won't need to enable/disable TXEN anymore either...
    Something like..?

    TRISC.7=1
    ODCONC.6 = 1

    Loop:
    TX, RX, rinse repeat

    I would have thought you need to reset ODCONC.6 to "standard push/pull"...? (Possible example of not always understanding what the datasheet "means").


    Quote Originally Posted by tumbleweed View Post
    ...If your pic has PPS you'll probably need to set that up too to assign the pin to the UART TXD function.
    PPS output functions aren't typically enabled by default.
    Yes, I figured that much. There's just so many peripherals available (coming from a guy that started with a 16F628).


    EDIT: I just rechecked the EUSART section (starts at page 543), and they never mention ODCON (last occurence is at page 233).

    The datasheet says very little about ODCON:

    Name:  ODCON.png
Views: 2896
Size:  23.1 KB
    Last edited by Demon; - 25th September 2024 at 21:28.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. Trying to emulate shift register
    By RuudNL in forum General
    Replies: 0
    Last Post: - 17th March 2013, 19:57
  2. pic+shift register+lcd
    By eworld in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd October 2012, 05:11
  3. Long shift register
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 18th April 2009, 19:14
  4. Framing Error /w USART
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th February 2007, 01:34
  5. Replies: 15
    Last Post: - 30th January 2005, 03:58

Members who have read this thread : 10

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