Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,050 members, 7,810,924 topics. Date: Saturday, 27 April 2024 at 06:28 PM

Microcontrollers - Programming (5) - Nairaland

Nairaland Forum / Science/Technology / Programming / Microcontrollers (34270 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): 4:55pm On May 16, 2013
cogitoErgo:
Ha, which one be Proteus? I saw everytng except dat Proteus! some of d examples will nid aditional pats and I also want to build external power source fo the the breadboard which will b adapted fo final package later.
microscale said the #15000/15500 starter pack has lcd graphics display(not 16x2) but i did not see it in my package! i taught maybe its bcause i paid 15000naira!

Proteus is a simulator that can be used to simulate your code without any hardware or kit(ok maybe it was not suppose to be included in your pack because you can use your kit to test your codes).

The 128x64 Graphic LCD was not included (optional)because of its cost(around N4000).So if your really want to use it, you can buy one and fix it on its connector in your development kit. Sorry we are just trying to reduce the price of the kits so that it can be affordable for students. Note the N15000 you paid was for both the PIC development kit and the ISCP programmer.
Re: Microcontrollers by Nobody: 8:32pm On May 16, 2013
@princejude, assuming i want multiple analog inputs, can i do this?

setup_adc_ports(sAN0, sAN1)

or
setup_adc_ports(sAN0_sAN1)

and corresponding channels

set_adc_channels(0, 1)

or
set_adc_channels(0_1)
Re: Microcontrollers by princejude(m): 9:51pm On May 16, 2013
cogitoErgo: @princejude, assuming i want multiple analog inputs, can i do this?

setup_adc_ports(sAN0, sAN1)

or
setup_adc_ports(sAN0_sAN1)

No it won't work like that, do is this way:

setup_adc_ports(sAN0|sAN1);


and corresponding channels

set_adc_channels(0, 1)

or
set_adc_channels(0_1)

No, you set each channel individually as shown below:

set_adc_channel(0); 

or
set_adc_channel(1); 


Have you download the CCS manual I posted the link earlier. If yes read the ADC section.

Alternatively, you can also do the adc setups from the pic wizard.
Re: Microcontrollers by Nobody: 6:14am On May 17, 2013
princejude:

No it won't work like that, do is this way:

setup_adc_ports(sAN0|sAN1);




No, you set each channel individually as shown below:

set_adc_channel(0); 

or
set_adc_channel(1); 


Have you download the CCS manual I posted the link earlier. If yes read the ADC section.

Alternatively, you can also do the adc setups from the pic wizard.



Thanks a lot. Yea, I have the CCS manual, I will check it again. Thanks
There is this pin connector, like the one used to connect the 16x2 LCD to the dev. board, I want to buy it (the pin plug and its socket) but I dont know its name. Please what is it called? so I will kno what to ask for.
Re: Microcontrollers by Nobody: 11:51am On May 17, 2013
@princejude, I tnk I got the name: single-row female 1" pin and single-row male 1" pin grin
Re: Microcontrollers by princejude(m): 1:11pm On May 17, 2013
cogitoErgo:
Thanks a lot. Yea, I have the CCS manual, I will check it again. Thanks
There is this pin connector, like the one used to connect the 16x2 LCD to the dev. board, I want to buy it (the pin plug and its socket) but I dont know its name. Please what is it called? so I will kno what to ask for.

It is called SIL Header (ie. Single-In-Line Header Connector)

The one with pins is the male while
The one with holes is female
Re: Microcontrollers by Nobody: 12:30pm On May 19, 2013
Hello Chief (princejude!), please I have this problem:
The development board I have(from microscale) can only work with 18, 28 and 40 pin PICs, but I noticed that the programmer (PICkit2) can program a wide range of PICs from 8pdil to 40pdil.
Now assuming I want to program a PIC12F683 (it is 8pdil) with what I have, for clap switch project, how do I go about it?
Thanks in anticipation of your reply!
Re: Microcontrollers by princejude(m): 1:41pm On May 19, 2013
From the CD, open the PICKIT2 USER MANUAL, turn to page 27 to see the circuit below:



Wire the circuit in your bread board connect your programmer and you are good to go.






[s]Or you can buy their new dev. kit. It has the 8-PIN chip socket[/s]
Re: Microcontrollers by princejude(m): 1:53pm On May 19, 2013
cogitoErgo:
The development board I have(from microscale) can only work with 18, 28 and 40 pin PICs

How did you get their kit ?
Did you go to their office or you buy it online (and they send it to you).
If it was online,how many days did it take you to get the kit after payment?
And where is your location (State).
Re: Microcontrollers by Nobody: 3:24pm On May 19, 2013
princejude:

How did you get their kit ?
Did you go to their office or you buy it online (and they send it to you).
If it was online,how many days did it take you to get the kit after payment?
And where is your location (State).
I sent somebody who is staying in Kaduna to pick it up for me at their office in Kaduna.
Re: Microcontrollers by Nobody: 4:41pm On May 19, 2013
@princejude, thanks, I saw d circuit and its damned simple! I rather go for dat dan buy another dev kit, I just wsh microscale will have some of the 8dip PICs
Re: Microcontrollers by hopefullman: 9:02pm On Jun 05, 2013
@princejude What's d diff btwn pickit2 & pickit3.thank u
Re: Microcontrollers by princejude(m): 2:24am On Jun 06, 2013
hopefullman: @princejude What's d diff btwn pickit2 & pickit3.thank u
Pickit3 is the elder brother to Pickit2. It is the latest programmer from microchip. The major difference is that PICkit3 can program most of the current PICs and dsPICs while PICkit2 may not program all the current PICs and dsPICs.
Re: Microcontrollers by hopefullman: 9:20pm On Jun 06, 2013
princejude:
Pickit3 is the elder brother to Pickit2. It is the latest programmer from microchip. The major difference is that PICkit3 can program most of the current PICs and dsPICs while PICkit2 may not program all the current PICs and dsPICs.
thanks.then i wl go 4pickit 3(7k).i wl get in touch wit u soon on hw 2get it.pls kep up d gud work.we wl apreciat if u cn do som asm tutorials on ds thread so dt sum asm lovers cn also get goin.thank u
Re: Microcontrollers by GoodBoi1(m): 12:28pm On Jun 07, 2013
I am currently learning C++ and am interested in microcontrollers and embedded system, I want to know if C++ is sufficient for microcontroller programming, as in without c
Re: Microcontrollers by princejude(m): 4:15pm On Jun 07, 2013
Good Boi: I am currently learning C++ and am interested in microcontrollers and embedded system, I want to know if C++ is sufficient for microcontroller programming, as in without c

If you have any C++ compiler that can convert your C++ code to HEX file then you can use it for microcontrollers.

I have not seen such compiler. Note that C++ and C are very similar, so if you know how to code with C++ you can easily switch to embedded C. Download the ebooks I have uploaded in this thread and study them and you will see their similarities. Also search for other microcontroller based ebooks that will help you to learn C.
Re: Microcontrollers by owsega: 11:22pm On Jun 09, 2013
Good Boi: I am currently learning C++ and am interested in microcontrollers and embedded system, I want to know if C++ is sufficient for microcontroller programming, as in without c

I don't think c++ can be used to program mcu yet. It's object oriented and mcu use sequential code for now, more or less because all your C (ccs or mikroC) codes are first converted to asm before hex.
Re: Microcontrollers by Nobody: 8:07am On Jun 10, 2013
Good Boi: I am currently learning C++ and am interested in microcontrollers and embedded system, I want to know if C++ is sufficient for microcontroller programming, as in without c
Since u are familiar with C++, I dnt u will have prblm with undstandng C at all! Where prblm will come is in undstanding d compiler used, if u undstand CCS C compiller and then come across a program writen for MikroC u may just have some learning to do again ( but u will always understand d main program)
Re: Microcontrollers by JavaPrince1(m): 9:03pm On Jun 15, 2013
But my mentor has told me that java can also be used in the programming of microcontrolers. I read some articles online sha about the critisisms of java for microns. I really want to study electronic engineering but currently have some background knoledge in Java and never have had anything to do with other programming language. Please professionals in the house what do you have to say? I really love this thread.
Re: Microcontrollers by princejude(m): 4:00am On Jun 16, 2013
Java_Prince: But my mentor has told me that java can also be used in the programming of microcontrolers.

You can use java or c# in microcontroller projects to design GUI(graphical user interface) if your project need to be controlled from a PC . Note that the java or c# is only used on the PC based GUI which will be interfaced to the microcontroller through serial comunication. The microcontroller must have its code written in another language such as c or asm
Re: Microcontrollers by JavaPrince1(m): 7:49am On Jun 16, 2013
princejude: Note that the java or c# is only used on the PC based GUI which will be interfaced to the microcontroller through serial comunication. The microcontroller must have its code written in another language such as c or asm
Are you trying to say that only projects that has to programmed in java is such that must be controlled with GUI and the GU is and must be in the controlling PC with a standard OS connected to micron using a serial communication?
Re: Microcontrollers by princejude(m): 8:12pm On Jun 16, 2013
Java_Prince: Are you trying to say that only projects that has to programmed in java is such that must be controlled with GUI ...?

Yes we did one using c#. I don't know if there is any other way to use java with mcu. May be u can ask mr. google

1 Like

Re: Microcontrollers by JavaPrince1(m): 10:07pm On Jun 16, 2013
Mahn I will have to think over it. I really would love to be bulding robotic machines with my object oriented mindset. Dont really know what could be my main chalenge when trying to switch to a procedural system of coding. I love the fact that everything in java is a class of objects with a series of subroutines. I wish I can finance some projects so that I can try to see what these programming tools can offer. Please I will be glad if anyone can put me through with these theories of none object oriented programming achitecture.
Re: Microcontrollers by hopefullman: 9:17am On Jun 17, 2013
@prince jude.pls hw can i get the pickit3 programer?my location is akure?dnt mail me 2ru nl cos dmail is dormant.my working mail is truetalk360@yahoo.com.thank u
Re: Microcontrollers by princejude(m): 10:46am On Jun 17, 2013
hopefullman: @prince jude.pls hw can i get the pickit3 programer?my location is akure?dnt mail me 2ru nl cos dmail is dormant.my working mail is truetalk360@yahoo.com.thank u

I have sent you a mail. Once we confirm your payment you will get your parcel in the next 24 to 48 hrs
Re: Microcontrollers by princejude(m): 11:09am On Jun 17, 2013
Java_Prince: Mahn I will have to think over it. I really would love to be bulding robotic machines with my object oriented mindset. [font=Lucida Sans Unicode][/font]

May be you can try using Arduino with AVR microcontroller http://arduino.cc/en/Tutorial/HomePage. It looks like object oriented I have not use it before and you have to check where and how to get the Arduino development kit. If you want to switch to the normal embedded c,you can start from downloading the ebooks I have uploaded in this thread.
Re: Microcontrollers by bosunsky: 2:35pm On Jun 20, 2013
Where in ibadan can i get all the tools needed to start dis microcontroller program, av been waiting for this all long!!!!!!
Re: Microcontrollers by princejude(m): 2:50pm On Jun 20, 2013
bosunsky: Where in ibadan can i get all the tools needed to start dis microcontroller program, av been waiting for this all long!!!!!!

Send the list of the tools you need to microscale embedded(or you can post the list on this thread) and pay into their account( add N2000 for shipment), then they will send your tools in less than 48 hours after they have confirm your payment.
Re: Microcontrollers by bosunsky: 4:22pm On Jun 20, 2013
princejude:

Send the list of the tools you need to microscale embedded(or you can post the list on this thread) and pay into their account( add N2000 for shipment), then they will send your tools in less than 48 hours after they have confirm your payment.
pls, can u send me the list of all the basic tools i need, that can get me started, i'm very sorry i ask cos av not been following this thread b4.
pls send the list and phone no. to my mail :: abodunrin5@gmail.com...... i will be happy to see ur response thanks sir!!!!!!!!!smiley
Re: Microcontrollers by princejude(m): 5:33pm On Jun 20, 2013
bosunsky:
pls, can u send me the list of all the basic tools i need, that can get me started, i'm very sorry i ask cos av not been following this thread b4.
pls send the list and phone no. to my mail :: abodunrin5@gmail.com...... i will be happy to see ur response thanks sir!!!!!!!!!smiley

It all depends on the type of microcontroller you want to learn with such as PIC, 8051 or AVR.
You will need the development kit and the programmer



For PIC microcontroller you will use any of this options:

Option one:
PIC development kit with built-in programmer and PIC16f887
including all the software and sample codes = N15,000 + N2000 shipment

Option two:
PIC development kit with PIC16f887
including all the software and sample codes = N10,000
PICKit2 programmer (cloned) = N5,500 + shipment = N2,000

Option three:
PIC development kit with PIC16f887
including all the software and sample codes = N10,000
PICkit3 Programmer = N7,000 + Shipment = N2000

For 8051 you will need :
8051 development kit with built-in programmer and AT89c51 or STC89c51 chip
including all the software and sample codes = N15,000 + shipment = N2000

For AVR you will need :
AVR development kit with ATmega16
including all the software and sample codes = N10,000
AVR ICSP Programmer = N7000 + shipment = N2000

Re: Microcontrollers by Nobody: 7:37pm On Jun 20, 2013
Help from all the gurus!
I have being studying assembly language from the link given here and Im really enjoying it.
I tried to compile a simple program for PIC16F84, part of which is as below:

bsf 03h, 5
movlw 00h
movwf 85h
bcf 03h, 5

but on compilation, MPLAB says the register in operand of line 3 is not in bank0! of course, it is not, but I thought line one (bsf 03h, 5) suppose to have set things to bank1! so why am i still getng this type of warning?
Re: Microcontrollers by princejude(m): 10:06pm On Jun 20, 2013
@ CogitoErgo

That is not a complete code. Post your complete code so that we may help you to debug it and I also want to tell you that I don't use asm frequently. The last project I did with asm is up to a year now. Why do you prefer asm? You can try this nice electronics site http://www.talkingelectronics.com/te_interactive_index.html They used asm in their PIC sections. Just scroll down the site to the PIC sections...

(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. 48
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.