Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,350 members, 7,822,649 topics. Date: Thursday, 09 May 2024 at 02:26 PM

Microcontrollers - Programming (2) - Nairaland

Nairaland Forum / Science/Technology / Programming / Microcontrollers (34337 Views)

Help Needed On My Project Work Using Microcontrollers / How To Write Assembly Language For Microcontrollers (2) (3) (4)

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) ... (14) (Reply) (Go Down)

Re: Microcontrollers by princejude(m): 12:09pm On Mar 09, 2013
Will be back, Let me do my office work
Re: Microcontrollers by princejude(m): 12:19pm On Mar 09, 2013
Mods this is not advert but it will help someone to see what he can do with embedded systems

http://www.facebook.com
Re: Microcontrollers by hopefullman: 2:58pm On Mar 09, 2013
princejude: Mods this is not advert but it will help someone to see what he can do with embedded systems

http://www.facebook.com/microscale?ref=ts&fref=ts
pls answer my qst.can i writ my cod wt mikroC and picC compiler?thank u
Re: Microcontrollers by princejude(m): 4:07pm On Mar 09, 2013
hopefullman:
pls answer my qst.can i writ my cod wt mikroC and picC compiler?thank u

You can write your code with any compiler
Re: Microcontrollers by hopefullman: 4:03am On Mar 10, 2013
princejude:

You can write your code with any compiler
sory 2ask again.does it mean dat mikroc and picc also has an ide?
Re: Microcontrollers by princejude(m): 9:03am On Mar 10, 2013
hopefullman:
does it mean dat mikroc and picc also has an ide?

They are different C compilers for PIC. The PICC I know is this CCS C compiler am using in the above exercise.
There are microC and mikroC PRO for PIC. They are all C compilers with some different syntax.
I don't like using microC because it is almost like assembly language, I use mikroC PRO for PIC a lot because
it has enough libraries. You can download the latest version of mikroC PRO for PIC here: http://www.mikroe.com/mikroc/pic/
MikroC PRO for PIC was developed by mikroelectronika. They also have:
MikroC PRO for 8051
MikroC PRO for AVR
MikroC PRO for ARM
MikroC PRO for dsPIC
MikroC PRO for PIC32
Re: Microcontrollers by princejude(m): 6:00am On Mar 11, 2013
Exercise2: 16x2LCD display

The code is below:


#include <16F887.h>
#device adc=8
#FUSES NOWDT, HS, NOPUT, MCLR, NOPROTECT, NOCPD, NOBROWNOUT, IESO, FCMEN, NOLVP, NODEBUG, NOWRT, BORV40
#use delay(clock=8000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=cool
#include <lcd.c>

void main()
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
//Setup_Oscillator parameter not selected from Intr Oscillator Config tab

// TODO: USER CODE!!
lcd_init(); // initialize lcd
printf(lcd_putc," Moderator \n frontpage ASAP "wink; // write to lcd

while(true) // loop forever
{
}

}


The Proteus simulator circuit is below:

1 Like

Re: Microcontrollers by hoodboi(m): 8:30am On Mar 11, 2013
hi princejude, thank you so much for ur efforts, it is highly appreciated. I want to ask, is there any book in pdf format you can upload to teach programming micro controllers. i downloaded a mplab compiler recently and i now have the proteus simulator. Also, pls among the exercises, can you include one to control the to and fro movement of a motor. thanx
Re: Microcontrollers by princejude(m): 10:07am On Mar 11, 2013
hoodboi: I want to ask, is there any book in pdf format you can upload to teach programming micro controllers.

There is a lot of free microcontroller ebooks (pdf) online. Just google it and be specific on the type of microcontroller and compiler you want to learn'

hoodboi: Also, pls among the exercises, can you include one to control the to and fro movement of a motor. thanx

What type of motor do you want to control.... AC motor, DC motor, Stepper motor or Servo motor ?
Re: Microcontrollers by hopefullman: 11:05am On Mar 12, 2013
My location is akure.i dnt no if i cn meet any microcontroler programer here 4trainin
Re: Microcontrollers by holax: 11:58pm On Mar 14, 2013
@hoodboi, PIC microcontollers are very easy to set up, the programming environment MPLAB can be downloaded free from microchip which fully supports assembly language also PIC programmer are very easy to construct but can be troublesome with some computers that is why I will recommend you to buy USB PICKIT2 programmer which works with all laptops and it cost NGN 8k.
Re: Microcontrollers by hopefullman: 8:05pm On Mar 15, 2013
holax: @hoodboi, PIC microcontollers are very easy to set up, the programming environment MPLAB can be downloaded free from microchip which fully supports assembly language also PIC programmer are very easy to construct but can be troublesome with some computers that is why I will recommend you to buy USB PICKIT2 programmer which works with all laptops and it cost NGN 8k.

is the usb pickit2 a universal programmer for pic?what does the usb means?does it means tham the programer {pic}wil be conectd to the usb port and programd 2ru d usb and nt d serial/paralel port.thank you
Re: Microcontrollers by holax: 1:56pm On Mar 17, 2013
Pickit2 is a usb PIC programmer meaning it works with usb port of a computer, very easy to use and can program all microchip PICs. @ hopefullman, check your mail.
Re: Microcontrollers by hopefullman: 10:57pm On Mar 18, 2013
@holax.2nks boss.i realy apreciate ur time&effort u spent 4me.may d lord reward u abundantly
Re: Microcontrollers by hoodboi(m): 6:18am On Mar 20, 2013
holax: Pickit2 is a usb PIC programmer meaning it works with usb port of a computer, very easy to use and can program all microchip PICs. @ hopefullman, check your mail.


holax u dey do ojoro oo..u guys r teachn two pple nw.wateva u sent hopefulman i need it too pls youngenterpreneur11@gmail.com
Re: Microcontrollers by hopefullman: 8:41pm On Mar 20, 2013
hoodboi:

holax u dey do ojoro oo..u guys r teachn two pple nw.wateva u sent hopefulman i need it too pls youngenterpreneur11@gmail.com
lol.he only snt me hs number and i cald hm.he xplain alot of tins 2me abt pic.he's a vry gud trustin man.he neva hid anytin 4me.i jst wish i cud met hm bt i live in akure.if u cn met hm personaly he wl surly pt u 2ru
Re: Microcontrollers by hopefullman: 8:48pm On Mar 20, 2013
@holax.i got 5.68volts 4rm my serial port.hw usable is it?2nk u
Re: Microcontrollers by hoodboi(m): 10:32pm On Mar 20, 2013
hopefullman:
lol.he only snt me hs number and i cald hm.he xplain alot of tins 2me abt pic.he's a vry gud trustin man.he neva hid anytin 4me.i jst wish i cud met hm bt i live in akure.if u cn met hm personaly he wl surly pt u 2ru

kk o pls cn u send me is number and were does he stay. I stay at offa currently and i am workin wiv an engr frm ekiti as well alex owoseni. He won a competition on a security door last year without using programming bt he as recognised d power in programming and we wnt to create a 2nd version. I also want to interface d microcontroller program wiv a database prolly sql server. Pls send number to youngenterpreneur11@gmail.com
Re: Microcontrollers by hopefullman: 9:02am On Mar 21, 2013
@hoodboi.he is in lagos.i tink it wld be wrong 4me 2snd u hs contact without hs permision.y nt send a mail 2him 2ru nairaland.2nk u
Re: Microcontrollers by holax: 11:45pm On Mar 21, 2013
Here is a simple JDM serial port PIC Programmer that worked for me www.m.instructables.com/id/Simple-JDM-PIC-Programmer/

and the software it worked with www.lancos.com/prog.html .
@hoodboi, i have replied your message.
Re: Microcontrollers by hopefullman: 11:31am On Mar 30, 2013
I compild ds code and mplab told me build suced bt didnt display d hex file.hw wl i get d hex file.thanks. LIST P=16F84
#include <p16f84.inc>
__config_RC_OSC &_WDT_OFF &_PWRTE_ON
org 0000h
movlw b'00000'
movwf TrisA
bcf Status,5
begin movlw b'11111'
movwf PortA
movlw b'00000'
movwf portA
goto begin
end
Re: Microcontrollers by princejude(m): 9:17pm On Mar 30, 2013
hopefullman: I compild ds code...
That is assembly language. Why not you start with basic or C language. C language will be easier to learn than assembly
Re: Microcontrollers by princejude(m): 9:36pm On Mar 30, 2013
hopefullman: I compild ds code and mplab told me build suced bt didnt display d hex file.hw wl i get d hex file.
The hex file will be inside your project folder. That is the folder where you saved the MPLAB project.
Re: Microcontrollers by princejude(m): 10:16pm On Mar 30, 2013
http://www.hobbyprojects.com/pic_tutorials/tutorial1.html
The above link will be a good start for PIC assembly programming
Re: Microcontrollers by hopefullman: 8:54pm On Mar 31, 2013
princejude:
That is assembly language. Why not you start with basic or C language. C language will be easier to learn than assembly
i cuddnt find pic c tutorials on d net.all i see is sum pic projects in c lang wich i dnt understand.i avnt even find BASIC lang tutorials.pls if u hav a link 2 pic c tutorials pls kindly share.2nk u
Re: Microcontrollers by hopefullman: 9:04pm On Mar 31, 2013
princejude: http://www.hobbyprojects.com/pic_tutorials/tutorial1.html
The above link will be a good start for PIC assembly programming
thank u.must i av 2learn asm b4 learnin c?i ws tld dt asm wl let me undstand d pic 4beta resourc alocatn.pls u are an xpert in ds fild pls shed mor lit on d 2/3 langs.i dnt wnt 2spend so much tym on a lang dt wunt realy benefit me much.2nks
Re: Microcontrollers by hopefullman: 9:13pm On Mar 31, 2013
princejude:
The hex file will be inside your project folder. That is the folder where you saved the MPLAB project.
2nks.i av sen it.it is 24kb in size.y is it dt large?cn it fit in2 d p16f84?y is it dt i cn only open d hex file it wt a c compiler since i chos mpasm toolsuit as my assembler in my mplab setings.thank u
Re: Microcontrollers by hoodboi(m): 2:20am On Apr 01, 2013
Wow U̶̲̥̅̊ guys have gone far oon nt been online for a while been busy. I haven't been able to find tutorials on c either. Also I installed mplab and wn I checked d start menu all I cud fynd is uninstall mplab, were cn I run it frm.
Re: Microcontrollers by princejude(m): 6:28am On Apr 01, 2013
hopefullman:
i cuddnt find pic c tutorials on d net.all i see is sum pic projects in c lang wich i dnt understand.i avnt even find BASIC lang tutorials.pls if u hav a link 2 pic c tutorials pls kindly share.2nk u
There are many C compilers (with enough online resources)for PIC.
1. CCS C www.ccsinfo.com/forum Register with this forum ask questions and also search for sample codes in there code library.
2. MikroC PRO for PIC www.mikroe.com They have some good online ebooks which you can read free from here http://www.mikroe.com/pic/books/ This is there ebook on C: http://www.mikroe.com/products/view/285/book-pic-microcontrollers-programming-in-c/ You can also download there compiler here: http://www.mikroe.com/pic/compilers/
3. Hi-Tech C
Re: Microcontrollers by princejude(m): 7:07am On Apr 01, 2013
Use Google to search for free ebooks on PIC C programming. You can search with the following key words:

"ccs c ebook", "PIC C programming ebooks", "pic c programming pdf"

If you can download the book in the link below,you are good to go(It is for CCS C ) http://www.4shared.com/office/GzmYwLCl/Embedded_C_Programming__Microc.html
Re: Microcontrollers by princejude(m): 7:37am On Apr 01, 2013
hopefullman:
thank u.must i av 2learn asm b4 learnin c?
No. You can learn C without asm.

hopefullman:
i ws tld dt asm wl let me undstand d pic 4beta resourc alocatn.

Asm will help you to be familiar with the PIC registers because you use the register names directly in asm though in my own opinion it was a bit difficult to remember all the mnemonics. I prefer C to Asm because C is more friendly (like human language)

hopefullman:
i dnt wnt 2spend so much tym on a lang dt wunt realy benefit me much.2nks
All programming languages are ok,and none is better than the other,what you achieved using C you can also achieve it using asm. The major issue is which of the language will be easier to learn.
Re: Microcontrollers by princejude(m): 7:53am On Apr 01, 2013

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) ... (14) (Reply)

What Is Computer Programming / First Thing First, Learn To Program! / How To Make A Simple Calculator In Notepad Using .bat Format

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 41
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.