Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 2nd August 2009, 06:05 PM   #196
Default

going to try it soon!
__________________
Rεσllγ !!! Mγ Σ×ρer!ence is Directly Propotional τΘ the NΦ of Electronic Items I have Me§§eD µρ ...
tariq7868 is offline  
Old 2nd August 2009, 08:14 PM   #197
Default

here is my complete code but its for the LPC2148 and im using the Olimex board. Code is written using Crossworks for ARM.

This code will show a start screen with my info then after 2 seconds show another screen for collecting SONY (SIRC) infrared data and displaying it to user. Also makes a special tone for each code recieved from 0-9 and POWER. For power it will tone a going up hill type tone and when pressed again it will sound like somethings falling lol

I was bored it sounds real nice tho. My cam wont pick it up well tho. Too noisy i guess.

Ill have to post a C file or another post cuz it wont fit in this one

Quote:
1. The text that you have entered is too long (28434 characters). Please shorten it to 20000 characters long.
2. This forum requires that you wait 30 seconds between posts. Please try again in 11 seconds.
Here is the file then.... its originally a CPP file but had to rename to C so i can upload without ZIPping it.
Attached Files
File Type: c main.c (28.5 KB, 19 views)

Last edited by AtomSoft; 2nd August 2009 at 08:16 PM.
AtomSoft is offline  
Old 3rd August 2009, 12:11 AM   #198
Default

Now with a UART1 interface at 115200 8-n-1 :

Called it Olimex.c now since its for that board...
Attached Files
File Type: c olimex.c (29.5 KB, 9 views)
AtomSoft is offline  
Old 3rd August 2009, 03:52 AM   #199
Default

Thank you for making the video available Jason.
Mr RB is offline  
Old 3rd August 2009, 11:45 PM   #200
Default

hey np at all
AtomSoft is offline  
Old 4th August 2009, 01:44 AM   #201
Default

hey guys im trying something here... do you think this is helpful at all?

http://atomsofttech.info/cross/1/

Last edited by AtomSoft; 4th August 2009 at 01:44 AM.
AtomSoft is offline  
Old 4th August 2009, 02:13 AM   #202
Default

The thing that can bite you on this is that the web pages or IDE you use in the demo may change. Often sooner then you would image.

3v0
__________________
Please post questions to the forums. PM's are for personal communication.

BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)
3v0 is offline  
Old 4th August 2009, 02:36 AM   #203
Default

heh that makes sense i guess ill skip that or write a hand tutorial and then hopefully they wont change it much
AtomSoft is offline  
Old 4th August 2009, 03:04 AM   #204
Default

Ok im no guru but im sure this will help alot of people....
I have to show how the delay is counted for. This is a 12 mhz clock solution right now
Code:
/*-- 
Company:.... AtomSoft 
Author:..... Jason Lopez 
  --*/
/*--  Please download --- UM10139: Volume 1: LPC214x User Manual  --*/
/*--  As i will refer to it for more info here...  --*/

#include <LPC214x.h>

/*--  We use defines to make the code easy to see and change in the future  --*/
/*--  Here i am defining 1 LED as a number. The number is the bit/pin that   --*/
/*--  the LED is connect to on the IC.   --*/
#define LED1  10      /*--  Replace LED1 with 10  --*/

/*--  This will Return (0/1) the value of the bit number specified in the variable  --*/
/*--  This is done by getting the current value of the VAR and AND'ing it with  --*/
/*--  the value of 1 shifted to the left by the bit number. 

    EX: GETBIT(someVar,1) 
    Where someVar is originally 0x03 aka 0b00000011

    Would Produce:  0x01  
 --*/
#define GETBIT(var,bit) (((var)>>(bit))&1)      

/*--  This will SET (1) the value of the specified bit in the variable  --*/
/*--  This is done by getting the current value of the VAR and OR'ing it with  --*/
/*--  the value of 1 shifted to the left by the bit number.

    EX: SETBIT(someVar,2) 
    Where someVar is originally 0x03 aka 0b00000011

    Would Produce:  0x07 aka 0b00000111 
 --*/
#define SETBIT(var,bit) ((var)|=(1<<(bit)))		

/*--  This will Clear (0) the value of the specified bit in the variable  --*/
/*--  This is done by getting the current value of the VAR and AND'ing it with  --*/
/*--  the "opposite" (~) value of 1 shifted to the left by the bit number. 

    EX: CLRBIT(someVar,2) 
    Where someVar is originally 0x07 aka 0b00000111

    Would Produce: 0x03 aka 0b00000011 
 --*/
#define CLRBIT(var,bit) ((var)&=(~(1<<(bit))))		

/*--  Prototypes  --*/
void Initialize(void);
int main(void);

/*--  Initialize is used to set the speed of the CPU and any other init. settings --*/
/*--  This can be named anything but Initialize is a standard  --*/
void Initialize(void)  {

    PLL0CON=0x0;      /*--  Disable the PLL  --*/
    PLL0FEED=0xAA;    /*--  These 2 lines are the feed lines  --*/
    PLL0FEED=0x55;    /*--  These are a REQUIRED part of the PLL SETUP  --*/
 
    VPBDIV=0x00;      /*--   Setting peripheral Clock (pclk) to System Clock (cclk)  --*/
}

/*--  Main is the program start. This is where you start it all  --*/
int main(void){
    int x;            /*--  Local Variable. Using this one for local loops  --*/

    Initialize();     /*--  Call our Initialize Function/Prototype  --*/

    /*--  PINSELx is used to setup the pins usage.  --*/
    /*--  In the manual starting on page: 76  --*/
    /*--  You will see for each pin in the PINSELx register there are 2 bits to set its purpose  --*/
    /*--  For example on page 76 you will see that pin ( P0.1 ) can be used for 4 different things  --*/
    /*   
      00 = GPIO Port........ is general Input or Ouput Pin...On most if not all this is always 00
      01 = RxD (UART0)...... is UART0 Recieve Data Pin
      10 = PWM3............. is Pulse Width Modulation Pin #3
      11 = EINT0............ is External Interrupt Pin #0
    */    
    /*--  Knowing this you can easily set the bits in the register  --*/
    /*--  Since all we need for this lesson is to blink a LED then GPIO for all  --*/

    PINSEL0=0x00000000;     /*--  Set all pins as GPIO pins  --*/

    /*--  IODIRx is used to setup the pins direction. Input/Output  --*/
    /*--  Page 83 refers to this as:  --*/
    /* 
    8.4.1 GPIO port Direction register (IODIR, Port 0: IO0DIR - 0xE002 8008 and
          Port 1: IO1DIR - 0xE002 8018; FIODIR, Port 0: FIO0DIR - 0x3FFF C000
          and Port 1:FIO1DIR - 0x3FFF C020)
    */  
    /*--  One of the cool things is that the header LPC214x.h lets you use IOxDIR or IODIRx   --*/
    /*--  Where x is the port aka 0 or 1  --*/
    /*--  You can see how confusing it would be to use IO0DIR instead of IODIR0 hence the below code  --*/
    
    /*--  Note that when you set a 1 to any bit in this variable it sets the coresponding pin to output  --*/
    /*--  and when you set it to a 0 you can guess what will happen... its a input.  --*/

    IODIR0=0xFFFFFFFF;    /*--  Set all pins as output pins  --*/

/*--  Almost all programs have this while(1) loop. This is a endless loop.  --*/
    while(1){
      SETBIT(IOPIN0,LED1);    /*--  This will set the pin/bit LED1 (10) on IOPIN0 hence sending a 1 (HIGH)   --*/
      for(x=0;x<100000;x++);  /*--  This is a loop for xxxx ticks. Its a rough count  --*/

      CLRBIT(IOPIN0,LED1);    /*--  This will clear the pin/bit LED1 (10) on IOPIN0 hence sending a 0 (LOW)   --*/
      for(x=0;x<100000;x++);  /*--  This is a loop for xxxx ticks. Its a rough count  --*/
    }

}
Attached Files
File Type: c blinkMain.c (4.6 KB, 8 views)

Last edited by AtomSoft; 4th August 2009 at 08:33 AM.
AtomSoft is offline  
Old 4th August 2009, 03:36 AM   #205
Default

Quote:
Originally Posted by AtomSoft View Post
hey guys im trying something here... do you think this is helpful at all?

Created by Camtasia Studio 6
You're a major version behind in CrossWorks. Install 2.01. The package manager has been retooled.

I can't say that installing the processor support was all that difficult to figure out myself. The video tutorial is a good idea, but I'm not sure the subject matter is needed.
__________________
Mark Higgins
DirtyLude is offline  
Old 4th August 2009, 08:28 AM   #206
Default

Ok cool. I wasnt sure about it at first. Its that when i first started i didnt know i had to install these packages and took me a day or so to figure out why i didnt have have anything in my New ProJect window

Ill make a small PDF on it with the newer version.
AtomSoft is offline  
Old 4th August 2009, 09:07 AM   #207
Default

Here is the new code with my final understanding of loops...
Code:
 /*--
Company:.... AtomSoft 
Author:..... Jason Lopez 
 --*/ 
 /*-- Please download --- UM10139: Volume 1: LPC214x User Manual --*/ 
 /*-- As i will refer to it for more info here... --*/ 

#include <LPC214x.h>

 /*-- We use defines to make the code easy to see and change in the future --*/ 
 /*-- Here i am defining 1 LED as a number. The number is the bit/pin that  --*/ 
 /*-- the LED is connect to on the IC.  --*/ 
#define LED1  10       /*-- Replace LED1 with 10 --*/ 

 /*-- This will Return (0/1) the value of the bit number specified in the variable --*/ 
 /*-- This is done by getting the current value of the VAR and AND'ing it with --*/ 
 /*-- the value of 1 shifted to the left by the bit number. 

    EX: GETBIT(someVar,1) 
    Where someVar is originally 0x03 aka 0b00000011

    Would Produce:  0x01  
--*/ 
#define GETBIT(var,bit) (((var)>>(bit))&1)      

 /*-- This will SET (1) the value of the specified bit in the variable --*/ 
 /*-- This is done by getting the current value of the VAR and OR'ing it with --*/ 
 /*-- the value of 1 shifted to the left by the bit number.

    EX: SETBIT(someVar,2) 
    Where someVar is originally 0x03 aka 0b00000011

    Would Produce:  0x07 aka 0b00000111 
--*/ 
#define SETBIT(var,bit) ((var)|=(1<<(bit)))		

 /*-- This will Clear (0) the value of the specified bit in the variable --*/ 
 /*-- This is done by getting the current value of the VAR and AND'ing it with --*/ 
 /*-- the "opposite" (~) value of 1 shifted to the left by the bit number. 

    EX: CLRBIT(someVar,2) 
    Where someVar is originally 0x07 aka 0b00000111

    Would Produce: 0x03 aka 0b00000011 
--*/ 
#define CLRBIT(var,bit) ((var)&=(~(1<<(bit))))		

 /*-- Prototypes --*/ 
void Initialize(void);
int main(void);

 /*-- Initialize is used to set the speed of the CPU and any other init. settings--*/ 
 /*-- This can be named anything but Initialize is a standard --*/ 
void Initialize(void)  {

    PLL0CON=0x0;       /*-- Disable the PLL --*/ 
    PLL0FEED=0xAA;     /*-- These 2 lines are the feed lines --*/ 
    PLL0FEED=0x55;     /*-- These are a REQUIRED part of the PLL SETUP --*/ 
 
    VPBDIV=0x00;       /*--  Setting peripheral Clock (pclk) to System Clock (cclk) --*/ 
}

 /*-- Main is the program start. This is where you start it all --*/ 
int main(void){
    int x;             /*-- Local Variable. Using this one for local loops --*/ 

    Initialize();      /*-- Call our Initialize Function/Prototype --*/ 

     /*-- PINSELx is used to setup the pins usage. --*/ 
     /*-- In the manual starting on page: 76 --*/ 
     /*-- You will see for each pin in the PINSELx register there are 2 bits to set its purpose --*/ 
     /*-- For example on page 76 you will see that pin ( P0.1 ) can be used for 4 different things --*/ 
     /*
      00 = GPIO Port........ is general Input or Ouput Pin...On most if not all this is always 00
      01 = RxD (UART0)...... is UART0 Recieve Data Pin
      10 = PWM3............. is Pulse Width Modulation Pin #3
      11 = EINT0............ is External Interrupt Pin #0
    */ 
     /*-- Knowing this you can easily set the bits in the register --*/ 
     /*-- Since all we need for this lesson is to blink a LED then GPIO for all --*/ 

    PINSEL0=0x00000000;      /*-- Set all pins as GPIO pins --*/ 

     /*-- IODIRx is used to setup the pins direction. Input/Output --*/ 
     /*-- Page 83 refers to this as: --*/ 
     /*
    8.4.1 GPIO port Direction register (IODIR, Port 0: IO0DIR - 0xE002 8008 and
          Port 1: IO1DIR - 0xE002 8018; FIODIR, Port 0: FIO0DIR - 0x3FFF C000
          and Port 1:FIO1DIR - 0x3FFF C020)
    */ 
     /*-- One of the cool things is that the header LPC214x.h lets you use IOxDIR or IODIRx  --*/ 
     /*-- Where x is the port aka 0 or 1 --*/ 
     /*-- You can see how confusing it would be to use IO0DIR instead of IODIR0 hence the below code --*/ 
    
     /*-- Note that when you set a 1 to any bit in this variable it sets the coresponding pin to output --*/ 
     /*-- and when you set it to a 0 you can guess what will happen... its a input. --*/ 

    IODIR0=0xFFFFFFFF;     /*-- Set all pins as output pins --*/ 

     /*-- Almost all programs have this while(1) loop. This is a endless loop. --*/ 
    while(1){
      SETBIT(IOPIN0,LED1);     /*-- This will set the pin/bit LED1 (10) on IOPIN0 hence sending a 1 (HIGH)  --*/ 

       /*-- A for loop like: for(x=0;x<1;x++); with 1 takes approx 12 cycles to complete.............. --*/ 
       /*-- A loop with 2 takes 25 Cycles know this we can calculate how long it will take for 500ms.. --*/ 
       /*-- Since we are at 12 MHz thats 12,000,000 Cycles for 1 second. So it would take............. --*/ 
       /*-- 6,000,000 cycles for 500mSaka 1/2 second delay and since the loop takes 12-13 cycles for 1 --*/ 
       /*-- 6,000,000 / 12 = 500000..... So we will use 500000 for our loop........................... --*/ 

       /*-- If you should need exact timing i suggest you create a delay function and make sure........--*/ 
       /*-- that it is delaying 6,000,000 cycles. This will do about 4,500,009 cycles due to the.......--*/ 
       /*-- compiler optimizing the code it will run the empty loop quicker                    ........--*/ 
       /*-- You have to manually ajust the number. I found that 666666 would gibe me 6,000,003 cycles..--*/ 

      for(x=0;x<666666;x++);   /*-- This is a loop for 666666 cycles aka instructions. 500mS --*/ 

      CLRBIT(IOPIN0,LED1);     /*-- This will clear the pin/bit LED1 (10) on IOPIN0 hence sending a 0 (LOW)  --*/ 
      for(x=0;x<666666;x++);   /*-- This is a loop for 666666 cycles aka instructions. 500mS --*/ 
    }

}
http://atomsofttech.info/index.php?o...:arm&Itemid=55

Last edited by AtomSoft; 4th August 2009 at 10:09 AM.
AtomSoft is offline  
Old 21st August 2009, 03:37 PM   #208
Default

Here is my full source for the PIC version includes a altered linker file for 18f2525 and complete project ...
Attached Files
File Type: zip 7110.zip (68.3 KB, 22 views)
AtomSoft is offline  
Old 30th September 2009, 10:12 PM   #209
Default

I am in the process of working on getting Matt's connector setup working. I have the board and the clamp drilled. It looks like it will align and hold down as it should. To finish it I just need to align the toner mask and etch.

It has been a while since we talked about this display. Any new developments. Has anyone had connection problems as the copper ages ? I wonder if one sprayed it with clear acrylic if the pins would poke through and make connection ? Has anyone put one in a case ?

Matt's connection solution
__________________
Please post questions to the forums. PM's are for personal communication.

BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)
3v0 is offline  
Old 30th September 2009, 10:27 PM   #210
Default

not yet on my side. Soon!! tho. Im making a order from dipMicro on friday for the toner paper and laminator. Ill make some PCBS and let them age and see how it goes.

I have some blue acrylic ill test
AtomSoft is offline  
Reply

Tags
96x64, controller, graphic, lcd, nokia7110, sed1565, w or

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Graphic LCD baberjaved Micro Controllers 2 13th November 2007 05:01 PM
Graphic LCD flemmard Micro Controllers 1 13th September 2007 03:32 AM
interfacing of PIC16F877A with graphic LCD controller T6963c rosamma Micro Controllers 1 24th March 2007 12:29 PM
graphic LCD PIC MCU tom_electronic Micro Controllers 4 28th February 2006 12:29 PM
graphic lcd help jijita General Electronics Chat 1 18th August 2004 07:32 AM



All times are GMT. The time now is 05:31 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker