  | 
	  | 
		 
	 
	
		| View previous topic :: View next topic   | 
	 
	
	
		| Author | 
		Message | 
	 
	
		
			soulweed
 
 
  Joined: 20 Oct 2006 Posts: 23
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				| What PART Number for PDIP 40 PIN | 
			 
			
				 Posted: Mon Mar 05, 2007 6:45 pm     | 
				     | 
			 
			
				
  | 
			 
			
				| PIC18*  40 PIN PDIP two UART  ,please me | 
			 
		  | 
	 
	
		  | 
	 
	
		
			PCM programmer
 
 
  Joined: 06 Sep 2003 Posts: 21708
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Mon Mar 05, 2007 7:33 pm     | 
				     | 
			 
			
				
  | 
			 
			
				1. Go to the parametric search page on the Microchip site for the PIC18:
 
http://www.microchip.com/ParamChartSearch/params.aspx?branchID=1004&mid=10&lang=en&pageId=74
 
 
2. Go about halfway down the page.   Select these boxes:
 
 	  | Quote: | 	 		  | x 2 AUSART    x  2 EUSART | 	  
 
 
3. Then go the bottom of the page and click the "Search" button.
 
 
4. When it finishes searching, click the "Detail" button.
 
 
5.  Now you have a list of PICs.   Scroll over to the right side
 
    of the page.   You can see the column for "Pin Count".
 
 
That will give you the answer. | 
			 
		  | 
	 
	
		  | 
	 
	
		
			future
 
 
  Joined: 14 May 2004 Posts: 330
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Tue Mar 06, 2007 7:10 pm     | 
				     | 
			 
			
				
  | 
			 
			
				I remember these...
 
 
18F452
 
18F458
 
18F4520
 
18F4525
 
18F4620
 
 
The flash size increases downwards. | 
			 
		  | 
	 
	
		  | 
	 
	
		
			PCM programmer
 
 
  Joined: 06 Sep 2003 Posts: 21708
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Tue Mar 06, 2007 7:56 pm     | 
				     | 
			 
			
				
  | 
			 
			
				He wants two UARTs:
 
 	  | Quote: | 	 		  | PIC18* 40 PIN PDIP two UART ,please me | 	 
  | 
			 
		  | 
	 
	
		  | 
	 
	
		
			soulweed
 
 
  Joined: 20 Oct 2006 Posts: 23
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Wed Mar 07, 2007 5:23 am     | 
				     | 
			 
			
				
  | 
			 
			
				I saw in microchip website ,any part Number is PDIP has two UART .I am so sorry.
 
 
however I fighting for my senior project
 
 
so i need to know about I get INT of my software UART because 
 
I'm try to  use  MAX3100 ,it doesn't  work.i don't know WHY ?
 
 
I think problem may be occurs  HARDWARE  more than Sofware because
 
 
when I coding I try to SIMMULATE in software and see Timing Diagram,
 
it correct.Then I think it ERROR By hardware.
 
 
 
 	  | Code: | 	 		  
 
 
 
#include <18f452.h> 
 
 
#fuses XT,NOWDT,NOPROTECT,NOLVP 
 
#use delay(clock=4000000) 
 
#use rs232(baud=19200,xmit=PIN_C6,rcv=PIN_C7)  
 
 
#define MAX3100_CS     PIN_C0 
 
#define MAX3100_IRQ    PIN_B0 
 
#define MAX3100_CLK    PIN_C3 
 
#define MAX3100_SDI    PIN_C2 
 
#define MAX3100_SDO    PIN_C4 
 
 
static unsigned char recv1; 
 
static unsigned char recv2; 
 
static unsigned char recv3; 
 
static unsigned char recv4; 
 
static unsigned char recv5; 
 
static unsigned char recv6; 
 
static unsigned char flagSPI; 
 
 
/*   ##############   Main   ##################   */ 
 
unsigned char read_spi(unsigned char data); 
 
void readMAX3100(unsigned char command,unsigned char data); 
 
void spiputc(unsigned char data); 
 
 
#INT_EXT 
 
void interrupt_spi(void) 
 
{ 
 
        output_low(MAX3100_CS); 
 
        
 
        recv3 = read_spi(0x00); 
 
        recv4 = read_spi(0x00); 
 
        
 
       delay_us(1);  
 
        output_high(MAX3100_CS); 
 
      output_low(MAX3100_CLK); 
 
      output_low(MAX3100_SDI); 
 
    //    output_low(MAX3100_IRQ); 
 
      printf(spiputc,"%2X",recv4); 
 
   //   printf("%2X\n\r",recv4); 
 
      flagSPI = 0; 
 
} 
 
 
unsigned char read_spi(unsigned char data){ 
 
   unsigned char x; 
 
   unsigned char temp; 
 
   temp = 0; 
 
   for(x=0;x<8;++x) 
 
     { 
 
      if(data & 0x80){ 
 
        output_high(MAX3100_SDI); 
 
     } 
 
      else{ 
 
        output_low(MAX3100_SDI); 
 
     } 
 
        output_low(MAX3100_CLK); 
 
        delay_us(1); 
 
        temp = ((temp <<1) | input(MAX3100_SDO)); 
 
        output_high(MAX3100_CLK); 
 
        delay_us(1); 
 
 
        data = data << 1;        
 
 
     } 
 
   output_low(MAX3100_SDI); 
 
   return(temp); 
 
} 
 
 
 
void spiputc(unsigned char data) 
 
{ 
 
   unsigned int temp; 
 
 
   readMAX3100(0x00,0x00); 
 
    while((recv1!=0x40) & (recv1!=0xC0)) 
 
   { 
 
      readMAX3100(0x00,0x00); 
 
   } 
 
 
   readMAX3100(0x80,data); 
 
 
   readMAX3100(0x00,0x00); 
 
   while((recv1==0x00)) 
 
   { 
 
      readMAX3100(0x00,0x00); 
 
   } 
 
} 
 
 
 
void readMAX3100(unsigned char command,unsigned char data) 
 
{ 
 
        output_high(MAX3100_CS); 
 
      output_low(MAX3100_CLK); 
 
      output_low(MAX3100_SDI); 
 
       delay_us(1);  
 
        output_low(MAX3100_CS); 
 
        
 
        recv1 = read_spi(command); 
 
        recv2 = read_spi(data); 
 
        
 
       delay_us(1);  
 
        output_high(MAX3100_CS); 
 
      output_low(MAX3100_CLK); 
 
      output_low(MAX3100_SDI); 
 
} 
 
 
void main(void) 
 
{ 
 
 
 
 unsigned  char  command,SPIcommand,temp1,temp2; 
 
 unsigned int max3100Read;  
 
 
   output_high(MAX3100_CS); 
 
   output_low(MAX3100_CLK); 
 
   output_low(MAX3100_SDI); 
 
 
    ext_int_edge( 0, H_TO_L); 
 
     enable_interrupts(INT_EXT); 
 
     enable_interrupts(GLOBAL); 
 
 
      readMAX3100(0xC4,0x0A); //Write Config Command and set baud to 9600
 
     
 
for(;;){
 
      
 
      readMAX3100(0x00,0x00); 
 
        while((recv1==0x00)) 
 
      { 
 
         readMAX3100(0x00,0x00); 
 
      } 
 
      delay_ms(500); 
 
    flagSPI = 0; 
 
 
   printf(spiputc," TEST USART-SPI Max3100   \n\r"); 
 
  
 
      if(flagSPI==1) 
 
      { 
 
         flagSPI = 0; 
 
      } 
 
          
 
   } 
 
  
 
 } 
 
 
/*   ##############   END   ##################   */
 
 
 | 	 
  | 
			 
		  | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
	 
	    
	   | 
	
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
  
		 |