V3 Changing Baud Rates
Posted: Mon Oct 05, 2009 3:30 pm
Hello,
I have tried to set up the baud rate register/bits with the following in an attempt to over ride the RS232 componenet macro baud rate.
Ben had offered me this in a past post (18F4620, 20MHz, SYNC = 0, BRGH = 1, BRG16 = 1, SPBRG = 42, 115K2 Baud Rate).
clear_bit(txsta, SYNC);
set_bit(txsta, BRGH);
set_bit(baudcon, BRG16);
spbrg = 42;
When I place the above in a "C" block the program compiles fine to the 18F but never connects with my PC application. If I use the default settings using the RS232 component for 115k2 it works fine.
This tends to make me believe that I cannot over ride the component settings. Depending on the device that is connected to the RS232 port I need to be able to change the baud rate from inside my application.
Am I doing something wrong in how I am trying to override the RS232 component macro's baud rate?
Thank you,
Ron
I have tried to set up the baud rate register/bits with the following in an attempt to over ride the RS232 componenet macro baud rate.
Ben had offered me this in a past post (18F4620, 20MHz, SYNC = 0, BRGH = 1, BRG16 = 1, SPBRG = 42, 115K2 Baud Rate).
clear_bit(txsta, SYNC);
set_bit(txsta, BRGH);
set_bit(baudcon, BRG16);
spbrg = 42;
When I place the above in a "C" block the program compiles fine to the 18F but never connects with my PC application. If I use the default settings using the RS232 component for 115k2 it works fine.
This tends to make me believe that I cannot over ride the component settings. Depending on the device that is connected to the RS232 port I need to be able to change the baud rate from inside my application.
Am I doing something wrong in how I am trying to override the RS232 component macro's baud rate?
Thank you,
Ron