Hi,
I’m having problems with framing errors when the temperature is in the range of +/- 160 degree F, otherwise it communicate with no problem.
The code has been use on a PIC24HJ64GP210A 64 pins for about 8 years, with no issues, I needed to add more PWMs and Inputs, so I moved to the same chip, but with 100 pins configuration.
I’m using UART1 for communication over rs485, the RX is interrupt driven, not the TX which I use the outChar1 (). The communication its setup to a bout rate of 38400 and 8-bit no parity with one stop bit.
I also revisit the Oscillator configuration and redesigned the external crystal oscillator resonant circuit to ensure proper clock measuring.
The way that is designed is to have 8 PWM and 32 inputs, separated on two messages, on the first message, the controller send the first 4 PWM and the first 16 inputs readings, on the second message send the next 4 PWM and the next 16 inputs readings.
Is in the second message where the framing errors appear, losing communication with the master controller. As I mention before the framing errors start happening when temperatures are in the range of 160 degree F. With temperatures less than 160 degree F there is no communication errors. The chip is rated to 185 degree F.
I’ve tested with a PIC24HJ64GP510A extended temperature rated for 257 degree F, and I still have the framing errors at the 160 degree range, that lead me to review the configuration setting .
I need you help to figure this out; if you please give me some sense of direction I’ll be grateful.
Thank you
--
You received this message because you are subscribed to the Google Groups "PIC24 Assembly-to-C Book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pic24-assembly-to-c-book+unsub...@googlegroups.com.
To post to this group, send email to pic24-assembly-to-c-book@googlegroups.com.
Visit this group at https://groups.google.com/group/pic24-assembly-to-c-book.
For more options, visit https://groups.google.com/d/optout.
Hi Bryan,
Thanks for you respond.
The clock is setup with an external crystal oscillator of 8MHz as follow:
void configClockPRIPLL_8MHzCrystal_40MHzFCY(void)
{
switchClock(GET_OSC_SEL_BITS(FNOSC_FRC));
_PLLPRE = 0; // Prescale = PLLPRE + 2
_PLLDIV = 38; // Multiply = PLLDIV + 2
_PLLPOST = 0; // Postscale = 2 * (PLLPOST + 1)
switchClock(GET_OSC_SEL_BITS(FNOSC_PRIPLL));
}
And yes, the BRGH = 1. The UART is set like this:
CONFIG_BAUDRATE_UART1(38400);
CONFIG_PDSEL_UART1(UXMODE_PDSEL_8DATA_NOPARITY);
CONFIG_STOPBITS_UART1(1);
As mention before, the RX is Interrupt driven but not the TX.
I also have a 500 microseconds delay, to give the transceiver time to settle.
I don’t have a frequency analyzer on hand at this moment.
Sergio,Hmmm, that's definitely a hard problem. What's clock frequency does your PIC run at? How did you configure the serial port? In your UART configuration, do you use BRGH=1 or 0? When 1, I've seen fairly poor behavior -- 0 is much better. If you put your TX output on a logic analyzer, what is the measured baud rate? I wonder if your PIC's serial clock is off by a bit.Bryan
On Wed, Nov 15, 2017 at 2:55 PM, Sergio Galmez <ke...@hotmail.com> wrote:
Hi,
I’m having problems with framing errors when the temperature is in the range of +/- 160 degree F, otherwise it communicate with no problem.
The code has been use on a PIC24HJ64GP210A 64 pins for about 8 years, with no issues, I needed to add more PWMs and Inputs, so I moved to the same chip, but with 100 pins configuration.
I’m using UART1 for communication over rs485, the RX is interrupt driven, not the TX which I use the outChar1 (). The communication its setup to a bout rate of 38400 and 8-bit no parity with one stop bit.
I also revisit the Oscillator configuration and redesigned the external crystal oscillator resonant circuit to ensure proper clock measuring.
The way that is designed is to have 8 PWM and 32 inputs, separated on two messages, on the first message, the controller send the first 4 PWM and the first 16 inputs readings, on the second message send the next 4 PWM and the next 16 inputs readings.
Is in the second message where the framing errors appear, losing communication with the master controller. As I mention before the framing errors start happening when temperatures are in the range of 160 degree F. With temperatures less than 160 degree F there is no communication errors. The chip is rated to 185 degree F.
I’ve tested with a PIC24HJ64GP510A extended temperature rated for 257 degree F, and I still have the framing errors at the 160 degree range, that lead me to review the configuration setting .
I need you help to figure this out; if you please give me some sense of direction I’ll be grateful.
Thank you
--
You received this message because you are subscribed to the Google Groups "PIC24 Assembly-to-C Book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pic24-assembly-to-c-book+unsub...@googlegroups.com.
To post to this group, send email to pic24-assem...@googlegroups.com.
Visit this group at https://groups.google.com/group/pic24-assembly-to-c-book.
For more options, visit https://groups.google.com/d/optout.
Hi Bryan,
Thanks for you respond.
The clock is setup with an external crystal oscillator of 8MHz as follow:
void configClockPRIPLL_8MHzCrystal_40MHzFCY(void)
{
switchClock(GET_OSC_SEL_BITS(FNOSC_FRC));
_PLLPRE = 0; // Prescale = PLLPRE + 2
_PLLDIV = 38; // Multiply = PLLDIV + 2
_PLLPOST = 0; // Postscale = 2 * (PLLPOST + 1)
switchClock(GET_OSC_SEL_BITS(FNOSC_PRIPLL));
}
And yes, the BRGH = 1. The UART is set like this:
CONFIG_BAUDRATE_UART1(38400);
CONFIG_PDSEL_UART1(UXMODE_PDSEL_8DATA_NOPARITY);
CONFIG_STOPBITS_UART1(1);
As mention before, the RX is Interrupt driven but not the TX.
I also have a 500 microseconds delay, to give the transceiver time to settle.
I don’t have a frequency analyzer on hand at this moment.
Sergio
On Thursday, November 16, 2017 at 10:32:50 AM UTC-5, Bryan A. Jones wrote:
Sergio,
Hmmm, that's definitely a hard problem. What's clock frequency does your PIC run at? How did you configure the serial port? In your UART configuration, do you use BRGH=1 or 0? When 1, I've seen fairly poor behavior -- 0 is much better. If you put your TX output on a logic analyzer, what is the measured baud rate? I wonder if your PIC's serial clock is off by a bit.
Bryan
On Wed, Nov 15, 2017 at 2:55 PM, Sergio Galmez <ke...@hotmail.com> wrote:
Hi,
I’m having problems with framing errors when the temperature is in the range of +/- 160 degree F, otherwise it communicate with no problem.
The code has been use on a PIC24HJ64GP210A 64 pins for about 8 years, with no issues, I needed to add more PWMs and Inputs, so I moved to the same chip, but with 100 pins configuration.
I’m using UART1 for communication over rs485, the RX is interrupt driven, not the TX which I use the outChar1 (). The communication its setup to a bout rate of 38400 and 8-bit no parity with one stop bit.
I also revisit the Oscillator configuration and redesigned the external crystal oscillator resonant circuit to ensure proper clock measuring.
The way that is designed is to have 8 PWM and 32 inputs, separated on two messages, on the first message, the controller send the first 4 PWM and the first 16 inputs readings, on the second message send the next 4 PWM and the next 16 inputs readings.
Is in the second message where the framing errors appear, losing communication with the master controller. As I mention before the framing errors start happening when temperatures are in the range of 160 degree F. With temperatures less than 160 degree F there is no communication errors. The chip is rated to 185 degree F.
I’ve tested with a PIC24HJ64GP510A extended temperature rated for 257 degree F, and I still have the framing errors at the 160 degree range, that lead me to review the configuration setting .
I need you help to figure this out; if you please give me some sense of direction I’ll be grateful.
Thank you
--
You received this message because you are subscribed to the Google Groups "PIC24 Assembly-to-C Book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pic24-assembly-to-c-book+unsubscr...@googlegroups.com.
To post to this group, send email to pic24-assem...@googlegroups.com.
I see the difference in the Calculations with BRGH = 0, based on the Baud Rate Calculation (DS39708 Pg. 12), now I have a Baud Rate of 38400.688, I think that is very accurate.
I tested and the problem persists. I’m guessing that is timing issue, but if the temperature still within range (less than 160 degree F), what can be changing the timing to create framing errors? Is there any way to see how the clock behavior is when these framing errors occurred? At this point I can only calculate the clock timers.
I attached the schematic in case I’m missing something.
Thank you
Sergio
To unsubscribe from this group and stop receiving emails from it, send an email to pic24-assembly-to-c-book+unsub...@googlegroups.com.
To post to this group, send email to pic24-assem...@googlegroups.com.
Visit this group at https://groups.google.com/group/pic24-assembly-to-c-book.
For more options, visit https://groups.google.com/d/optout.
--
Bryan A. Jones, Ph.D.
Associate Professor
Department of Electrical and Computer Engineering
231 Simrall / PO Box 9571
Mississippi State University
Mississippi State, MS 39762
http://www.ece.msstate.edu/~bjones
bjones AT ece DOT msstate DOT edu
voice 662-325-3149
fax 662-325-2298
Our Master, Jesus Christ, is on his way. He'll show up right on
time, his arrival guaranteed by the Blessed and Undisputed Ruler,
High King, High God.
- 1 Tim. 6:14b-15 (The Message)
--
You received this message because you are subscribed to the Google Groups "PIC24 Assembly-to-C Book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pic24-assembly-to-c-book+unsub...@googlegroups.com.
To post to this group, send email to pic24-assem...@googlegroups.com.
Visit this group at https://groups.google.com/group/pic24-assembly-to-c-book.
For more options, visit https://groups.google.com/d/optout.
I see the difference in the Calculations with BRGH = 0, based on the Baud Rate Calculation (DS39708 Pg. 12), now I have a Baud Rate of 38400.688, I think that is very accurate.
I tested and the problem persists. I’m guessing that is timing issue, but if the temperature still within range (less than 160 degree F), what can be changing the timing to create framing errors? Is there any way to see how the clock behavior is when these framing errors occurred? At this point I can only calculate the clock timers.
I attached the schematic in case I’m missing something.
Thank you
Sergio
To post to this group, send email to pic24-assembly-to-c-book@googlegroups.com.
Visit this group at https://groups.google.com/group/pic24-assembly-to-c-book.
For more options, visit https://groups.google.com/d/optout.
--Bryan A. Jones, Ph.D.
Associate Professor
Department of Electrical and Computer Engineering
231 Simrall / PO Box 9571
Mississippi State University
Mississippi State, MS 39762
http://www.ece.msstate.edu/~bjones
bjones AT ece DOT msstate DOT edu
voice 662-325-3149
fax 662-325-2298
Our Master, Jesus Christ, is on his way. He'll show up right on
time, his arrival guaranteed by the Blessed and Undisputed Ruler,
High King, High God.
- 1 Tim. 6:14b-15 (The Message)
Yes, I did check the Rx/Tx on the scope, the length of the message and the timing are correct
--
Sergio -- how you are checking the 485TX/485RX PCB signals on a scope when the temperature is above 160F? Do you have a temp chamber with the ability to bring signals from the PCB out for external monitoring?I agree with Bryan's suggestions -- I have experienced framing errors at normal temps for some higher baud rates when trying to use BRGH =1. I have never had problems with BRGH =0.And, I agree with Matt Stowell -- at this point, I think the problem may be with some component other than the PIC24. What about U5, the LTC485 RS485 transceiver? Are you using the extended range temperature version of this device? The normal range for this tops out at 70C (158 F).Bob Reese
On Fri, Nov 17, 2017 at 11:11 AM, Sergio Galmez <ke...@hotmail.com> wrote:
Yes, I did check the Rx/Tx on the scope, the length of the message and the timing are correct
--
You received this message because you are subscribed to the Google Groups "PIC24 Assembly-to-C Book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pic24-assembly-to-c-book+unsub...@googlegroups.com.
To post to this group, send email to pic24-assemb...@googlegroups.com.
Sorry for take me so long to get back to this issue, I was really busy with other projects.
I did resolve this problem when I was testing and following the advice received here. I wanted to get back to explain how i got this fixed, since I didn't want to leave an open topic.
At the end I fine that the path of the crystal oscillator where designed wrong, and only one of the oscillator terminals was connected, I fine this when I was reviewing the oscillator circuit, because the RC circuit didn't look right, we has preveusly change the design of the board and we incorporate a surface-mount Oscillator on the new design.I want to thanks every one of you for the advises that I receivedThanks again.
On Friday, November 17, 2017 at 4:51:43 PM UTC-5, Robert Reese wrote:
Sergio -- how you are checking the 485TX/485RX PCB signals on a scope when the temperature is above 160F? Do you have a temp chamber with the ability to bring signals from the PCB out for external monitoring?I agree with Bryan's suggestions -- I have experienced framing errors at normal temps for some higher baud rates when trying to use BRGH =1. I have never had problems with BRGH =0.And, I agree with Matt Stowell -- at this point, I think the problem may be with some component other than the PIC24. What about U5, the LTC485 RS485 transceiver? Are you using the extended range temperature version of this device? The normal range for this tops out at 70C (158 F).Bob Reese
On Fri, Nov 17, 2017 at 11:11 AM, Sergio Galmez <ke...@hotmail.com> wrote:
Yes, I did check the Rx/Tx on the scope, the length of the message and the timing are correct
--
You received this message because you are subscribed to the Google Groups "PIC24 Assembly-to-C Book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pic24-assembly-to-...@googlegroups.com.
To post to this group, send email to pic24-assemb...@googlegroups.com.
Visit this group at https://groups.google.com/group/pic24-assembly-to-c-book.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PIC24 Assembly-to-C Book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pic24-assembly-to-...@googlegroups.com.