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 CCS Technical Support

integerating MAX3110 to work with PIC 18F8722
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah
Guest







PostPosted: Thu Aug 24, 2006 2:08 am     Reply with quote

Big difference, is how you handle the retrieval in the interrupt routine.
If you look at the original code, it keep retrieving bytes, till _all_are read. This is vital, since the chip will only enable the interrupt 'once', for a buffer that may interally contain up to eght characters, and the PIC interrupts are edge triggered, not level triggered.

Best Wishes
mkr



Joined: 08 Aug 2006
Posts: 49

View user's profile Send private message

PostPosted: Fri Aug 25, 2006 10:14 am     Reply with quote

What should I do to make the PIC edge triggered or level triggered. Which is the prefered method. How could I change the trigger method if possible.

This MAX3110 is taking most of my time debugging. I opened a simple project just servicing only the MAX3110. Please check out if the code is ok or should i make any changes
Code:

#include <rs232spi.h>
#include <max3110.c>

#int_EXT NOCLEAR
EXT_isr()
{

   do{

      CLEAR_INTERRUPT(INT_EXT);
//      EXT0IF=0;
      Rxdata = issp_txfr16(0L);
      justtestbuff[maxindata]=Rxdata;

   }while(EXT0IF);


}



void main()
{

   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_adc(ADC_OFF|ADC_TAD_MUL_0);
   setup_psp(PSP_DISABLED);
   setup_spi(FALSE);
   setup_wdt(WDT_OFF);
   setup_timer_0(RTCC_INTERNAL);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
   setup_timer_4(T4_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
   enable_interrupts(INT_EXT);
   enable_interrupts(GLOBAL);

   max_init();

   Maxconfig(MAX3110_BAUD);
   enable_interrupts(INT_EXT);        // MAX3110E - RS232 port

   Maxputc('0');
   Maxputc('1');
   Maxputc('a');

   for (;;) {

      max3110();

    }

}

void max3110(void){

   int8 i=0;

   if (MAX_has_data()) {      //Here data is available in the input buffer
      i=1;                    //got some data
   }

}

_________________
Thanks

mkr
mkr



Joined: 08 Aug 2006
Posts: 49

View user's profile Send private message

Got it working perfectly
PostPosted: Mon Aug 28, 2006 6:55 pm     Reply with quote

I am happy to say that the max3110e driver is working perfectly. There was a slight deviation from the original code(the original code is little complicated).

The code original code does not do any thing about interupt mask. It only deals with the interrupt flag. By implementing the interrupt mask, INTCON.4 it was a breeze to get the chip working.

Thanks for the input soo far. I had a ground up code to work on
_________________
Thanks

mkr
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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