 |
 |
| View previous topic :: View next topic |
| Author |
Message |
Ttelmah Guest
|
|
Posted: Thu Aug 24, 2006 2:08 am |
|
|
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
|
|
Posted: Fri Aug 25, 2006 10:14 am |
|
|
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
|
| Got it working perfectly |
Posted: Mon Aug 28, 2006 6:55 pm |
|
|
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 |
|
 |
|
|
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
|