Page 1 of 1

USART Problem - code works with 16F88 but not 18F4520

Posted: Sun Oct 11, 2009 6:19 pm
by ste5442
Hi All,

I have discovered an issue with Flowcode and the way it deals with the USART on the 18F4520.
If i compile working RS232 code for the 16F88 and talk to Hyperterminal (TX and RX) everything is fine but when the chip is changed to an 18F4520 (and the jumpers are set accordingly etc etc) the code no longer works?
I have verified that the hardware is setup correctly with the 18F4520 and that it is receiving the transmitted characters correctly from Hyperterminal.
If someone from Matrix MM can shed some light on this issue it would be appreciated :-)

I have also read on this forum about other problems with USART setup on other chips - is there a big overhaul underway to resolve the issues?

Thank you!

Re: USART Problem - code works with 16F88 but not 18F4520

Posted: Mon Oct 12, 2009 8:59 am
by Benj
Hello

On your 18F4520 device how are you checking that the characters have been received? Also are the characters being echoed back out to hyperterminal correctly as was the case with the 16F? What aspect of the program is not working correctly?

There are some chips that have advanced baud generation registers that Flowcode does not currently use but the current baud calculations should be more then fine running on these devices.

Re: USART Problem - code works with 16F88 but not 18F4520

Posted: Mon Oct 12, 2009 2:40 pm
by Benj
Hello

My guess is that this is a configuration problem, a baud or a clock speed problem.

Setting the chip configuration to something similar to the following should help to get you up and running. Please note that all settings that are not shown are set to disabled unless you specifically want to enable the write protection etc.
config.JPG
config.JPG (82.93 KiB) Viewed 3191 times
Also check that the clock speed is set correctly in the Project Options window to allow the baud rate to be calculated correctly. Once you have done this you may also have to go into the RS232 component properties and click OK to allow the new baud rate to be calculated correctly.

Let me know how you get on.