18F47K42 UART interrupt keep on triggering

Re: 18F47K42 UART interrupt keep on triggering

Postby ric » Sat Dec 26, 2020 12:56 pm

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.
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 590
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

Re: 18F47K42 UART interrupt keep on triggering

Postby 32768hertz » Sat Dec 26, 2020 1:14 pm

ok, thank you, now I know what to do
32768hertz
 
Posts: 8
Joined: Fri Jan 03, 2020 5:39 pm

Re: 18F47K42 UART interrupt keep on triggering

Postby AussieSusan » Wed Dec 30, 2020 3:12 am

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
AussieSusan
Verified identity
 
Posts: 144
Joined: Mon Jun 16, 2014 4:45 am
PIC experience: Experienced Hobbyist

Re: 18F47K42 UART interrupt keep on triggering

Postby 32768hertz » Wed Dec 30, 2020 6:26 am

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).
32768hertz
 
Posts: 8
Joined: Fri Jan 03, 2020 5:39 pm

Re: 18F47K42 UART interrupt keep on triggering

Postby ric » Wed Dec 30, 2020 7:43 am

Can you still buy a 74LS04?
I haven't used any 74LS logic for 30 years, 74HC and 74HCT is usually better.
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 590
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

Re: 18F47K42 UART interrupt keep on triggering

Postby 32768hertz » Wed Dec 30, 2020 9:02 am

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
32768hertz
 
Posts: 8
Joined: Fri Jan 03, 2020 5:39 pm

Re: 18F47K42 UART interrupt keep on triggering

Postby AussieSusan » Sat Jan 02, 2021 3:11 am

I remember when there were NO letters after the '74'!!!!
RTL even......
Susan (showing her age!)
AussieSusan
Verified identity
 
Posts: 144
Joined: Mon Jun 16, 2014 4:45 am
PIC experience: Experienced Hobbyist

Previous

Return to SCI/USART/EUSART

Who is online

Users browsing this forum: No registered users and 1 guest