Is the 18f4685 connected to the TellyMate with the same hardware as the 16f887 was?
Sorry that I am not able to spot the problem right off.
Is the 18f4685 connected to the TellyMate with the same hardware as the 16f887 was?
Sorry that I am not able to spot the problem right off.
Dave
Always wear safety glasses while programming.
hey no need to apologize, but yes, the 18f4685 is attached to the same hardware as the 16f887. I chose the 18f4685 because it had an identical pinout to the 16f887 so all I would have to do is swap the chips on my breadboard. I would provide a schematic if I had one but I can't draw one up in multisim.
I think your problem may be caused by your oscillator frequency. When using the 16f887 what oscillator were you using? When using the usart frequency you should use a crystal oscillator for stable operation. Your oscillator configuration for the 18f chip appears to use internal irc oscillator which may not be good enough for reliable operation.
I have always used the 8 MHz internal oscillator. I've done serial communications with the 16f887, 16f688, and 16f630 all with internal oscillators (simply because I don't have any crystals around to use), but I do agree that it's some kind of timing error.
Poking around the datasheet a bit I notice that the setting for TRISC.6 is opposite for the 18F4685 compared to the 18F4550. I do not have an 18F4685 so I can not test.
I wonder if PBP is setting these correctly, not often but sometimes things are over looked, but this chip has been around for awhile....
Anyways, it can not hut to set this manually in your code.
From the datasheet, section 18:
The pins of the Enhanced USART are multiplexed
with PORTC. In order to configure RC6/TX/CK and
RC7/RX/DT as an EUSART:
• bit SPEN (RCSTA<7>) must be set (= 1)
• bit TRISC<7> must be set (= 1)
• bit TRISC<6> must be cleared (= 0) for
Asynchronous and Synchronous Master modes,
or set (= 1) for Synchronous Slave mode
Dave
Always wear safety glasses while programming.
Good eye. I'll try that and get back to you later.
I added this to my code but yet again nothing has happened. I also have tried it without TXSTA and BAUDCON.
Code:TXSTA = %10100000 RCSTA = %10110000 BAUDCON = %10000010 trisc.6 = 0 trisc.7 = 1
Bookmarks