CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

PIC16F88 receive interrupts apparently not properly initiali

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Gerhard
Guest







PIC16F88 receive interrupts apparently not properly initiali
PostPosted: Tue Nov 25, 2003 12:18 am     Reply with quote

I have recently received some 16F88s with the intention to port an existing working sensor application from a PIC16F876 to the 16F88 hoping only minor IO changes would be required. The same program runs successfully on a 16F876/877, and PIC18F452 without any major changes other then chip specific mods.

My application utilizes a command interpreter which uses interrupt driven capture of incoming characters via a RS485 link at 9600 Baud.

It turned out, the receive interrupt would no longer function. The RCSTA register would always initialize to zero, although on the other PICS it would be initialized to 0x90. While the RCSTA register was left in this state, RS485 transmissions would work fine. However it was not possible to receive any characters until I manually set RCSTA to 0x90. At this point interrupts were detectable, however sending characters was no longer possible. Since I was using RS485 mode, I could detect the TX active pin, but never any data being sent back.

Anyways, I would be curious if somebody also encountered a similar problem. It may be too early to blame the compiler. Perhaps, I failed to initialize the chip in some special way, although the other chips mentioned run just fine with the serial communications setup used.

EEPROM read and write functions worked fine.
The timer2 interupt used for application timing purpose worked also as expected.

Recompiling the same program with only the IO changes required by the other chips, would again result in a perfectly well functioning program.

I would appreciate any comments.
Thank you.
Gerhard
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Tue Nov 25, 2003 1:03 pm     Reply with quote

You know how long it takes to write a byte to EEPROM is ~5mS so if you are attempting to write a byte while sending a packet or recieving a packet you will have errors.
Guest








PostPosted: Tue Nov 25, 2003 1:50 pm     Reply with quote

Neutone wrote:
You know how long it takes to write a byte to EEPROM is ~5mS so if you are attempting to write a byte while sending a packet or recieving a packet you will have errors.


Hi,
you are right, but I wasn't using it during communications. The EEPROM data initialization is executed before the interrupts are enabled. Only when communciations work, I have access to changing EEPROM content.

Thanks and Best Regards,
Gerhard
Bruno
Guest







PostPosted: Wed Dec 17, 2003 3:08 am     Reply with quote

I use a 16F87 and have the same problem. int_rda is not working, "normal SW" serial IO on the same pins works fine. I think there are Crying or Very sad some settings in the 16F87/88 Device Table wrong.

Cheers
Bruno
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 17, 2003 1:14 pm     Reply with quote

What is your version of the compiler ?

See the following post. This person had a problem with the
16F87. In their version of the compiler, the hardware USART
was not enabled. They emailed CCS and got a new version.
(Also, sometimes CCS will just email the person a new
version of the DEVICES.DAT file, and also the PCM.DLL file).
http://www.ccsinfo.com/forum/viewtopic.php?t=17431

If CCS doesn't ever respond, it's still possible to make
a "work-around" for the problem. You can do it this way:
1. Don't use a #use RS232 statement.
2. At the start of the program, put in some lines of C code
to initialize the hardware USART. Study the data sheet
for information on how to do this. Also, compile some
sample code for the 16F877, with a hardware USART,
and study the .LST file to see how CCS initializes it.
(ie., compile code for a different PIC, for which you
know the hardware USART code is actually generated).
Then just write some C code to do the same thing.
3. Create your own versions of putc() and getc(), by
following the same method described above.
4. Then use the special CCS extension mode of printf,
to re-direct printf output to your version of putc().
Example:
printf(my_putc, "Hello World \n\r");

This would require more work to implement, but if CCS does
not respond to your request to fix the Device.dat file, then
at least you have a way to finish your project.
Jim Hearne
Guest







PostPosted: Mon Dec 22, 2003 7:03 am     Reply with quote

Not a great deal of help but i'm using INT_RDA on a 16F88 with no problems.
Using it with completly int driven 232 TX and RX at 9600 baud.

PCW ver 3.180

Jim
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group