MCB2370 Board with NXP LPC2378 Microcontroller
http://www.blogger.com/blogger.g?blogID=402974890211669806#editor/target=post;postID=6100766125864642998 1 /Plan
- Study about microprocessor architecture on ARM7TDMI
Time-line : 12/02 - > 26/02
- Study about MCU AT91SAM7S256 of Atmel( core using ARM7TDMI)
Time-line : pending
- Write demo programming : + leds blink.
+ Buttons controller .
+serial port , SD-card , interrupt....
Time-line : pending
- Study about Real time OS
Time-line : pending
- Write demo programming using Real time OS :muti-task
(button, LCD, Serial, SD card)
Serial port, SD card, Interrupt..
Time-line : 15/06- Finish.
- Mouse connect PC via usb port
- .........................................................................................
- .........................................................................................
2 /implementation
http://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/s2007/ayl26_ym82/ayl26_ym82/index.htm
http://www.dientumaytinh.com/search/label/h%C6%B0%E1%BB%9Bng%20d%E1%BA%ABn%20l%E1%BA%ADp%20tr%C3%ACnh%20ARM-LPC2378
=====================================================================
#include <LPC23xx.H>
#include "file_config.h"
//---------------LEDG---------------
void LED_Init(void);
void LED_On (unsigned int num) ;
void LED_Off (unsigned int num) ;
void LED_Out(unsigned int value) ;
//------------------------------------
void delay();
//------------------------------------------
void main(void )
{
LED_Init();
init_EINT0();
while(1)
{
unsigned char dem = 255;
unsigned i ;
for( i=0;i<dem;i++)
{
LED_Out(i);
delay();
}
}
}
//-------------------------------------
void LED_Init(void) {
PINSEL10 = 0;
FIO2DIR = 0x000000FF;
FIO2MASK = 0x00000000;
}
//-------------------------------------
void LED_On (unsigned int num) {
FIO2SET = (1 << num);
}
//--------------------------------------
void LED_Off (unsigned int num) {
FIO2CLR = (1 << num);
}
//----------------------------------------
void LED_Out(unsigned int value) {
FIO2CLR = 0xFF;
FIO2SET = (value & 0xFF);
}
//----------------------------------------
void delay()
{
unsigned char time = 255;
while(time--)
{
unsigned char j = 125;
while(j--);
}
}
//---------------------------------------
#include <LPC23xx.h>
void Led_Init()
{
PINSEL4 = PINSEL4&&0xFFFF0000;
PINMODE4 = 0;
PINSEL10=0;
FIO2DIR0=0xFF;
FIO2MASK0=0;
}
void Led_on(unsigned int n)
{
FIO2SET0 = 1<<n;
}
void Led_off(unsigned int n)
{
FIO2CLR = 1<<n;
}
void Led_out(unsigned int n)
{
FIO2CLR0 = 0;
FIO2SET0 = (n&0xFF);
}
int main()
{
int i,j;
Led_Init();
i=0;
while(1)
{
if(i<8)
{
for(j=0;j<10000;j++);
Led_on(i);
i++;
for(j=0;j<10000;j++);
}
else
{
for(j=0;j<8;j++)
Led_off(j);
i=0;
}
}
}
//===================================================
http://www.dientumaytinh.com/search/label/h%C6%B0%E1%BB%9Bng%20d%E1%BA%ABn%20l%E1%BA%ADp%20tr%C3%ACnh%20ARM-LPC2378
=====================================================================
#include <LPC23xx.H>
#include "file_config.h"
//---------------LEDG---------------
void LED_Init(void);
void LED_On (unsigned int num) ;
void LED_Off (unsigned int num) ;
void LED_Out(unsigned int value) ;
//------------------------------------
void delay();
//------------------------------------------
void main(void )
{
LED_Init();
init_EINT0();
while(1)
{
unsigned char dem = 255;
unsigned i ;
for( i=0;i<dem;i++)
{
LED_Out(i);
delay();
}
}
}
//-------------------------------------
void LED_Init(void) {
PINSEL10 = 0;
FIO2DIR = 0x000000FF;
FIO2MASK = 0x00000000;
}
//-------------------------------------
void LED_On (unsigned int num) {
FIO2SET = (1 << num);
}
//--------------------------------------
void LED_Off (unsigned int num) {
FIO2CLR = (1 << num);
}
//----------------------------------------
void LED_Out(unsigned int value) {
FIO2CLR = 0xFF;
FIO2SET = (value & 0xFF);
}
//----------------------------------------
void delay()
{
unsigned char time = 255;
while(time--)
{
unsigned char j = 125;
while(j--);
}
}
//---------------------------------------
#include <LPC23xx.h>
void Led_Init()
{
PINSEL4 = PINSEL4&&0xFFFF0000;
PINMODE4 = 0;
PINSEL10=0;
FIO2DIR0=0xFF;
FIO2MASK0=0;
}
void Led_on(unsigned int n)
{
FIO2SET0 = 1<<n;
}
void Led_off(unsigned int n)
{
FIO2CLR = 1<<n;
}
void Led_out(unsigned int n)
{
FIO2CLR0 = 0;
FIO2SET0 = (n&0xFF);
}
int main()
{
int i,j;
Led_Init();
i=0;
while(1)
{
if(i<8)
{
for(j=0;j<10000;j++);
Led_on(i);
i++;
for(j=0;j<10000;j++);
}
else
{
for(j=0;j<8;j++)
Led_off(j);
i=0;
}
}
}
//===================================================
No comments:
Post a Comment