ds30 Loader free edition forums
Serial communications speed problem [solved] - Printable Version

+- ds30 Loader free edition forums (https://picbootloader.com/forum)
+-- Forum: Support (https://picbootloader.com/forum/forumdisplay.php?fid=3)
+--- Forum: 16-bit firmwares (https://picbootloader.com/forum/forumdisplay.php?fid=6)
+--- Thread: Serial communications speed problem [solved] (/showthread.php?tid=129)



Serial communications speed problem [solved] - rogerb - 2011-05-25

I have two small questions as a new user:

Where can I find the latest source code for the GUI please
and
Using a dsPIC30F6014A with an FTDI USB/RS232 module I can download my application via the bootloader - took a lot of tweaks as a new user but well done the ds30 author so far!

However after the download my application uses the same port and so tries to reset the serial port to 256000 for further communications as part of its initialisation. As you can guess this no longer works as it seems that the serial port is left in an indeterminate state regarding the baud rate and I'm unable to reset it to a new speed. At least thats how I see it but maybe there is a tweak or other setting to be done that may help here.

All help and suggestions appreciated.

Roger B


RE: Serial communications speed problem - Mikael Gustavsson - 2011-05-25

Do you initialized ALL bits in all UART registers? Have you read errata?
Have you tried to disable the UART before reconfiguring it?


RE: Serial communications speed problem - rogerb - 2011-05-26

Thank you for your prompt reply.

I have used the following code but with no success unfortunately, I'm using mikroelektronika's "mikro C Pro for dsPIC" with a BIGdsPIC6 development board.

Code:
// *****************************************************************************
// Initialize Uart1 communication for USB
// *****************************************************************************
UART1.UxMODE.UARTEN = 0;         // disable UART1 ready to change settings
UART1.UxMODE.ABAUD  = 0;         // disable auto baud ready to change settings
delay_ms(10);                    // wait 10 millisconds
Uart1_Init_Advanced(256000,1,1); // USB FTDI connection 256000 baud,0 parity,1 stopbit
// *****************************************************************************

According to the datasheet this should clear almost everything.

I've tried to communicate using all different terminal settings but after using the bootloader to download the application I cannot achieve any response at all. Is there a way to find how the bootloader has left the seial port settings? I would have set the bootloader to 256000 baud but a warning appeared telling me that the baud rate error was too high!

Oh . . I cannot find an errata sheet in the version that I downloaded or the GUI source. Have I the right version - 1.4.1.0 in the about box

Also when using the bootloader GUI I have to set it to 115200 and also set the autobaud detect flag on or nothing happens.

All help appreciated

Roger B


RE: Serial communications speed problem - Mikael Gustavsson - 2011-05-26

Do you use interupts?
What does Uart1_Init_Advanced do? Does it init the U1STA register?

I meant the PIC errata.


RE: Serial communications speed problem - rogerb - 2011-05-27

Thanks for your reply.

The init is part of a supplied library so I have no access but I have now tried to reset the all registers before calling the uart init with no success.
Read the PIC errata but no differences that I can see that will help me.

All interrupts are off to enable smooth data transfer.

Any other thoughts, is modifying the bootloader with the correct baud rate an option before it boots the program?



RE: Serial communications speed problem - Mikael Gustavsson - 2011-05-29

My guess is that you have some problem with the oscillator setup. Please review the
oscillator settings while your application is running.

Does the serial communication in your application work when the boot loader isn't used?


RE: Serial communications speed problem - rogerb - 2011-05-31

Thank you for your reply and yes the application works ok without the bootloader - the port runs at 256000,8,n,1 using an FTDI MM232 module. The applications clock speed is 80mhz: 10mhz crystal (XT) * PLL 8.

The bootloader application I've set to a 10mhz clock speed as there is an error in the baud rate generated if I set the clock speed to 80mhz.

Is this where I'm going wrong?

Roger B




RE: Serial communications speed problem - Mikael Gustavsson - 2011-05-31

I suggest you use the same clock configuration for booth boot loader and application.


RE: Serial communications speed problem - rogerb - 2011-06-01

Thanks for all your help Mikael .

Well . . as a newcomer to all of this I thought I had set up both clocks in sync but when checking carefully and comparing each configuration setting I found that the oscillator was set to FRC_PLL8 and should have been XT_PLL8, its easy to be word blind during stressfull periods!

Corrected that and I now have my data communications re-established! A weight off my mind as its also corrected other minor issues!

Last thing to ask is about the source code. Does this just apply to the PIC bootloader code or am I able to see the GUI code?

Thanks again

Roger B


RE: Serial communications speed problem - Mikael Gustavsson - 2011-06-01

Great! Hope you will be satisfied with the boot loader.
The GUI code is not available. If you're interested in customization,
feel free to contact me from ds30loader.com

Mikael