Page 2 of 2

Re: 18F47K42 UART interrupt keep on triggering

PostPosted: Sat Dec 26, 2020 12:56 pm
by ric
As you have found, you have a bit to invert the TX pin, but not the RX pin.
Most PIC16F USART peripherals are like that.
Some PIC18F parts have a very similar USART, using bit 4 of BAUDCON to invert TX, and bit 5 to invert RX.
The bits are named CKTXP and DTRXP in those devices.

Re: 18F47K42 UART interrupt keep on triggering

PostPosted: Sat Dec 26, 2020 1:14 pm
by 32768hertz
ok, thank you, now I know what to do

Re: 18F47K42 UART interrupt keep on triggering

PostPosted: Wed Dec 30, 2020 3:12 am
by AussieSusan
Well the data sheet for the SCKP bit says:
"bit 4 SCKP: Clock/Transmit Polarity Select bit"
My question is though: if the receiver is expecting a high idle, then how is it correctly framing the received bit-stream?
As a wild thought, try sending some other value to see if you can simply invert each received byte (XOR with 0xFF).
Susan

Re: 18F47K42 UART interrupt keep on triggering

PostPosted: Wed Dec 30, 2020 6:26 am
by 32768hertz
my initial hope was that I miss reading about a register in the datasheet, hiding in plain sight. Now the problem is fixed with a 74LS04... something like this http://assembly.go.ro/img/digitalclock.pdf (at this moment of the posting, the schematic is underconstruction :? )

the receiver is expecting a high idle, then how is it correctly framing the received bit-stream?

probably because for a brief moment, at start, the line goes high then low, and thinks that drop is the start.
XOR it will make it 0b100000000 (I think).

Re: 18F47K42 UART interrupt keep on triggering

PostPosted: Wed Dec 30, 2020 7:43 am
by ric
Can you still buy a 74LS04?
I haven't used any 74LS logic for 30 years, 74HC and 74HCT is usually better.

Re: 18F47K42 UART interrupt keep on triggering

PostPosted: Wed Dec 30, 2020 9:02 am
by 32768hertz
LS is my default thought in my brain when I think about any 74 logic. I think they still make them, an example where I buy from https://www.tme.eu/ro/en/katalog/?searc ... order=desc
Looking again at what I have on my board right now, is HTC

Re: 18F47K42 UART interrupt keep on triggering

PostPosted: Sat Jan 02, 2021 3:11 am
by AussieSusan
I remember when there were NO letters after the '74'!!!!
RTL even......
Susan (showing her age!)