Interrupt on incoming RS232 on 18F6622

Forum for problems or queries regarding Flowcode Comms Components. Eg LIN, I2C, SPI, RS232, CAN, IrDA etc

Moderators: Benj, Mods

Post Reply
WalkOver
Posts: 65
Joined: Fri Nov 23, 2007 11:24 pm

Interrupt on incoming RS232 on 18F6622

Post by WalkOver »

Hello everybody !

I try to receive RS232 Strings on a 18F6622. It works well when my program just recept data. But if I add others functions as sending RS232 or PWM etc....It doesn't work. So i try the matrixmultimedia team interrupt code for RS232 incoming but it doesn't work. What I have to do for interrupt for a 18F6622 ?

Thank your for your help !

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Interrupt on incoming RS232 on 18F6622

Post by Benj »

Hello

Strange that sending RS232 data doesnt work. Have you tried doing a very basic program that simply sends out data.

This code should work with the custom interrupt enable icon and the 18F6622 chips.

Enable Code

Code: Select all

pie1.RC1IE = 1;
intcon.PEIE = 1;
Disable Code

Code: Select all

pie1.RC1IE = 0;
Handler Code

Code: Select all

if (pir1 & (1 << RC1IF))
{
	FCM_%n();
	clear_bit(pir1, RC1IF);
}
Let me know how you get on.

WalkOver
Posts: 65
Joined: Fri Nov 23, 2007 11:24 pm

Re: Interrupt on incoming RS232 on 18F6622

Post by WalkOver »

Thank you Benj,

I tried with a simple program without interruption and nothing else --> it works well.
I can control with a LED if the PIC detect the start octet ( 0xFE ). If I put this program on the custom interrupt enable icon with your code, it doesn't work :-( The LED stays off.
I want to test with interruption because with other function ( ADC, LCD, RS232 Tx ) but without interruption --> it doesn't work.

I forgot something ?

Thanks again !
Attachments
interruption RS232.fcf
(7 KiB) Downloaded 369 times

WalkOver
Posts: 65
Joined: Fri Nov 23, 2007 11:24 pm

Re: Interrupt on incoming RS232 on 18F6622

Post by WalkOver »

Hello,

Let me clarify that I don't use the RS232 in the rules. Only one pin is connected between two cards. How to make this work?

CARD NΒ°1 CARD NΒ°2 CARD NΒ°3
TX------------------------RX TX---------------------------RX

Post Reply