Hello,
I’m using the compiler version 7.5.0 and now 7.6.0 , 18F47K42 processor and I have some problems that I can't solve.
1. I use UART1 and UART2 , here is the problem (only sending data):
UART1_Remappable_Write('1'); -> data is sent to UART 1
UART2_Remappable_Write('2'); -> data is sent to UART 1
UART1_Remappable_Write_Text('UART1'); -> data is sent to UART 2
UART2_Remappable_Write_Text('UART2'); -> data is sent to UART 2
2. UART 1 and 2 can probably set only 9600 bps, another set speed will cause data transfer to fail (UART)
3. program works at 16MHz, at 32MHz program works but character display stops displaying characters, I use LCD library.
Function GetVersion returns string: 7.3.0 RC
Thank you for any advice
Michal
Problem with UART and CPU frequency on PIC18F47K42
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: Problem with UART and CPU frequency on PIC18F47K42
Hello,
Can you zip and send me your project for review?
Kind regards,
Jovana
Can you zip and send me your project for review?
Kind regards,
Jovana
Re: Problem with UART and CPU frequency on PIC18F47K42
Hello Jovana,
I attach the whole project.
Kind regards
Michal
I attach the whole project.
Kind regards
Michal
- Attachments
-
- MeteoRX_18F47K42 V5.zip
- (808.48 KiB) Downloaded 88 times
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: Problem with UART and CPU frequency on PIC18F47K42
Hi,
Look at the example which I'm sending you in the attachment.
You need to use the UART_Set_Active function before using the UARTx_Write_Text function.
Could you be more specific regarding the fail values? Which values you need to get, but which you get? Can you send me a screenshot?
Regarding the frequency, I tested our examples from the compiler and it works fine with 32MHz. Can you also try to run this example?
You only need to set a pinout for your LCD.
Kind regards,
Jovana
Look at the example which I'm sending you in the attachment.
You need to use the UART_Set_Active function before using the UARTx_Write_Text function.
Could you be more specific regarding the fail values? Which values you need to get, but which you get? Can you send me a screenshot?
Regarding the frequency, I tested our examples from the compiler and it works fine with 32MHz. Can you also try to run this example?
You only need to set a pinout for your LCD.
Kind regards,
Jovana
Re: Problem with UART and CPU frequency on PIC18F47K42
Hello Jovana,
the problem with UART is already resolved, adding function UART_Set_Active to my project, everything works,
communication speed can be freely set, tested up to 115kbps.
Program test_LCD works without problems on 32MHz and 64MHz, the problem was in the variable declaration
in my project I had:
Var LCD_RS : sbit at RD2_bit; ...
after repair to:
Var LCD_RS : sbit at LATD2_bit; ....
now works lcd even in my project.
Thank you very much
Kind regards
Michal
the problem with UART is already resolved, adding function UART_Set_Active to my project, everything works,
communication speed can be freely set, tested up to 115kbps.
Program test_LCD works without problems on 32MHz and 64MHz, the problem was in the variable declaration
in my project I had:
Var LCD_RS : sbit at RD2_bit; ...
after repair to:
Var LCD_RS : sbit at LATD2_bit; ....
now works lcd even in my project.
Thank you very much
Kind regards
Michal