LPC2138 arm enc28j60 microcontroller SMS

| August 2, 2019 Updated
LPC2138 arm enc28j60 microcontroller SMS

The highly underspent system is fashioned around an LPC2138 microcontroller, which features an ARM7 Architecture processor. Built with a bitty handful of components, TAM-TAM’s designing is cost-effective. The considered involvement of an extrinsic minute retention cardboard and well-chosen algorithms for nearly infinite hardware content of crystal-clear messages further to the success of the programme.

This quick overview allows us to build a laundry list of software features that are required to implement TAM-TAM:

 MMC/SD flash card interfacing
 PC-compatible File System
 Wave file play and record
 Tone detection and generation
 DTMF detection
 Caller ID demodulation
 TCP/IP stack
 Web server

arm7-sms-lpc213x-spi-enc28j60-Block


/*****************************************************************************
//
// File Name	  : 'main.c'
// Title		    : Main file for the TAM-TAM project
//                PROJECT AR1762
// Author		    : Bernard Debbasch - Copyright (C) 2005
// Created		  : 2005.08.17
// Revised		  : 2005.08.17
// Version		  : 1.0
// Target MCU	  : Philips LPC213x series
// Editor Tabs	: 2
//
*******************************************************************************/


#include                     /* LPC21xx definitions */
#include                      /* For system(). */
#include                       /* For printf(). */

#undef HTONS

#include "enc28j60.h"
#include "uip.h"
#include "uip_arp.h"
#include "config.h"
#include "dtmf.h"
#include "timer.h"
#include "HALayer.h"
#include "fatlib.h"
#include "spilpc.h"


extern void init_serial (void);            /* Initialize Serial Interface     */
extern void mmcTest(void);
extern void uip_main(void);
extern s08 readConfig(u08 *filename);
extern s08 tamtam( void );
extern s08 playWaveFile(u08 *filename);
extern void createHTMLmessagesFile(void);
extern void localPlayback(void);


extern char GreetingFileName[];

u16 smtpip[] = {0x0644, 0x0413};

int main(void)
{
/* Initialize the board	 */
	VPBDIV  = 0x00000002;						            /* pclk = sclk /2 30 MHz*/

  IOSET0  = MMCCS + ETHCS + ETHRESET;         /* Insure no glitches */
  IODIR0  = MMCCS + ETHCS + ETHRESET;         /* Set the output */

  IOSET1  = OFFHOOK + OUTENA;                 /* Insure no hoofhook glitch */
 	IODIR1  = 0x00FF0000;                       /* P1.16..23 defined as Outputs */
  IOCLR1  = OUTENA;                           /* Enable the outputs */

  PINSEL0 = 0x00051500;                       /* Enable RxD1 and TxD1 and SPI */
	PINSEL1 = 0x01080001;                       /* Enable EINT0 and DAC and ADC */

	AD0CR   = 0x00200402;                       /* Setup A/D: 10-bit AIN0 @ 3MHz */

  EXTMODE =  0x00000001;                      /* EINT0 is edge sensitive */
  EXTPOLAR = 0x00000000;                      /* EINT0 active on negative edge */

	init_serial();                              /* Initialize Serial Interface   */
  init_SPI();                                  /* Init the SPI interface */
  initFSK();                                  /* Init the demod tables */

	VICIntEnClr =  0x00004030;           		    /* Disable the IRQ's */
  init_interrupts();                          /* Init all the interrupts */
 	VICIntEnable = 0x00004030;                  /* Enable IRQ's */
	  
  if ( (memCardInit()) && (fat_initialize() == 1) )
  {
	  printf("Init OK\n");
	} else {
		printf("Failed init\n");
  }

  /* Initialize the device driver. */ 
  ethernetInit();

  /* Command interface to test and debug */
 	//mmcTest();
      
  /* End board init */

  /* Read the configuration file */
  readConfig("tam.txt");

  /* Initialize the uIP TCP/IP stack. */
  uip_init();
  uip_arp_init();
  
  /* Initialize the HTTP server. */
  httpd_init();
  
  /* Initialize the SMTP emailer */
  smtp_configure("TAMTAM", &smtpip[0]);
  
  /* Create the message.htm file. This also updates the LED.
  If a user has a message pending, the corresponding LED blinks */ 
  createHTMLmessagesFile();

  printf("Ready for some action\n");
   while(1)
   {

    /*-----------------------------------------------------------------------*/
    /* Run the answering machine */
    /*-----------------------------------------------------------------------*/
    if (tamtam() == -1) {
      /* Go on HOOK */
      IOSET1  = OFFHOOK;
    }
    /*-----------------------------------------------------------------------*/
    /* Do the IP main loop */
    uip_main();
    /*-----------------------------------------------------------------------*/
    /* Chek if we have the flash card was unplugged */
    if( (IOPIN0 & CARDDETECT) != 0) {
      /* Wait until we get a card */
      while ( (IOPIN0 & CARDDETECT) != 0);
      /* Re-init the file system */
      memCardInit();
      fat_initialize();
      readConfig("tam.txt");
      playWaveFile( GreetingFileName );
    }
    /*-----------------------------------------------------------------------*/
    /* Check if the user wants to play a local message */
    localPlayback();
    /*-----------------------------------------------------------------------*/

  }
}

FILE DOWNLOAD LINK LIST (in TXT format): LINKS-10440.zip

Published: 2010/05/23 Tags: ,



1 Comment “LPC2138 arm enc28j60 microcontroller SMS

  1. Electronics CircuitsElectronics Circuits

    LPC2138 arm microcontroller generates vga signals

    NoPC is an creation bleach for dynamical a VGA lizard without a PC. This single group is soigne yet retarded. A CPU muck is used to run a VGA protector, a keyboard, and a mouse, with ample module for storage, all without a PC. An LPC2138 microcontroller generates the VGA signals that thrust the protector as advisable as the graphics and fonts. The end finish is a low-cost method that mechanism source for displaying book

    REPLY

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Comment moderation is enabled. Your comment may take some time to appear.