Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

10yrs of IT experience & now want to play with µcontroll

Status
Not open for further replies.
Re: 10yrs of IT experience & now want to play with µcont

AG,

The PIC microcontrollers are a very viable choice and you might want to check out the Elmer 160 tutorial at;

https://www.amqrp.org/elmer160/

Good luck in your persuits... Regards, Mike
 

    aghazi

    Points: 2
    Helpful Answer Positive Rating
ElecThai & Mike, K8LH thanks for the response and pointing me to the right direction. As mentioned earlier, I already decided to go for PICs (going through PIC microcontrollers from mikroElektronika) but thanks to you guys, now I am confident about my choice.

narccizzo, thank you for the project. It will surely help me a lot.

I am also going through Electronics for Dummies. Is this approach good or am I wasting time and jump straight into PICs?


AG
 

Re: 10yrs of IT experience & now want to play with µcont

basics are always good.

keep in mind that you can't connect everything to just one output pin. most controllers can only drive about 10mA. so be carefull.

good luck..
 

basics never are a wasting of time but you can work in parallel you go directly with pics and we can help you with the doubts i think that its a good way.

1 you work
2 you doubt
3 you ask
4 we help you
and you work again.

so... what are you waiting for? :)
 

    aghazi

    Points: 2
    Helpful Answer Positive Rating
Re: 10yrs of IT experience & now want to play with µcont

Hi AG,

We all hope this turns into a wonderful and exciting new adventure for you...

Regards, Mike
 

    aghazi

    Points: 2
    Helpful Answer Positive Rating
Re: 10yrs of IT experience & now want to play with µcont

I'm a tad late to this thread but there are several points that I haven't seen made yet.

You've got lots of different recommendations for microprocessors. IMO, you should worry less about the processor and more about the development and debugging environment. A great dev environment on a crappy chip will be easier than a lousy environment on a great chip. Consider the amount of help you can get. An obscure chip will have little written about it, a popular chip has lots of experts out there and tons of sample code and other literature.

Things to consider:
- Your Budget
- IDE (integrated dev envt)
- Choice of Language
- Programming you code
- Debugging your code
- availibility of help, sample code, application notes, ...

So, taking a look at the development environments out there, I find MPLAB (PICs) to be the nicest. I like Atmel chips but find their IDE to be clumsy though it does have some nice aspects.

Now you should also think about language choice. I see 3 mainstream approaches: Assembler, C and Basic. I would suggest you look at using C as your programming language. Assembler is tricky to learn and, especially with the PIC, quite clumsy. While I have written a LOT of code in assembler, I find C faster and less error prone than assembler. I can't recommend Basic because it hides the underlying architecture but it is pretty easy to use and if you find programming daunting, I'd go that way. You should look at Basic Stamp, in that case. Almost all the compilers have a free-trial version. Definitely try before you buy. Note that a number of compilers come with a development environment. One that springs to mind is Mikroelectronika C for the PIC. The free one has a code limit of 2K but it's pretty inefficient. Still, for getting started, it's a good choice.

Another thing to consider is how you get your code into the chips (aka Programming). There are stand alone programmers and ones that integrate into the IDE. I've used both kinds and there really isn't that much benefit to integrated. Some microcontroller lines support "self programming" and thus people have written boot loaders that allow you to download code into the chip with out a special piece of hardware (i.e. a programmer). AVRs and PIC do this. The cost range on programmers is pretty broad from build your own for <$10 to multi hundred $.

Finally, debugging should be a consideration. If you don't have a hardware debugger, will you be confortable with debugging via a DMM, O'scope, LEDs and serial I/O print statements? Some hardware debuggers are very costly (In Circuit Emulators) and others are quite cheap. You can get an ICD2 clone (in-circuit debugger) for PIC for a little as $50 (or you can build one for <$20).

So all that said, I'd recommend C on the PIC or AVR. The PIC is probably a slightly better choice because the ICD2 programmer/debugger clone can be had quite cheap and there is a vast amount of literature out there. If you want to use assembler language, I'd go with the AVR.

Phil
 

    aghazi

    Points: 2
    Helpful Answer Positive Rating
This is a great forum !!!

I was looking at the firstpic.zip by narccizzo and found it V E R Y useful for a beginner. Helped me understood couple of things better than any tutorial! Now this Night Rider 12F683.zip from Mike, K8LH. Just splendid!

I am reading both Electronics for dummies and PIC guide from mikroElektronika. But right now I want to put my books aside and try this stuff from narccizzo and Mike, K8LH! So for these two schematics I need,


1- Parts mentioned (including microcontroller)
2- Bread board
3- Programmer
4- Debugger (optional in case)

And then join the components according to the corresponding schematic. Program the PIC and put it inside board and connect it to other components, supply the power and DONE. Kindly confirm this procedure.

This looks too easy! Thank you guys making it so simple for me. Couple of days ago, I could not even image doing so!

AG
 

Re: 10yrs of IT experience & now want to play with µcont

AG,

Phil has provided important details we left out (we didn't want to scare you away, grin)...

I haven't found the motivation to tackle C or BASIC yet so I'm still happily coding away using assembly language...

I built a serial ICD2 clone (about $10-$15 parts) and it works quite well...

**broken link removed**

I haven't used the ICD2 debugger yet... Instead, I use the PIC serial port and Hyperterminal running on the PC to debug sections of code during the development process...

That Night Rider LED demo is a minimal hardware example using a 'trick' multiplexing scheme and would probably be a very confusing coding example for beginners... Forgive me... Once you start learning hardware/software 'tricks', it's difficult designing without them (grin)...

BTW, here's the front panel for a post-card size single chip clock / calendar / alarm / timer demo project I'm currently workin' on (the knob at bottom left is a Rotary Encoder with detents and built-in push-button switch on the shaft)...

Good luck... Regards, Mike

**broken link removed**
 

K8LH can you please provide me circuit diagram of above product and other info. Are you HAM?
 

Re: 10yrs of IT experience & now want to play with µcont

Hi Code Warrior,

Yes, I'm a 'Ham' radio operator...

Here's a schematic for reference but it's not up-to-date... For example, the schematic shows common cathode displays and I'm currently using common anode displays... There is a seperate drawing for the somewhat exotic wiring scheme required for Charlieplexing (also sometimes referred to as N(N-1) multiplexing)...

The project is a work-in-progress but I would be happy to share the design and software when it's complete... My experiments so far have yielded accuracy to within approximately 1.0-second per month, not including crystal aging or temperature drift, when the oscillator was calibrated using a 0.5-ppm reference...

Regards, Mike

**broken link removed**
**broken link removed**
 

ok guys, i am ready to roll. Kindly point me towards a PIC programmer ideally with a USB connector.

Thanks

AG
 

Re: 10yrs of IT experience & now want to play with µcont

I don't know where you are located (I'm in the USA) but I like sparkfun.com. Here's their PIC programmer list. https://www.sparkfun.com/commerce/categories.php?cPath=1_6 The ICD2 clone at $100 is a decent deal for what you get but you didn't say your budget. If it were me, I'd go for the ICD2 because it's both a programmer and debugger. I believe sparkfun ships internationally.

By the way, you can get a USB to RS232 dongle and you might be able to save a little money.
 

Re: 10yrs of IT experience & now want to play with µcont

:idea:
I rather started by an older chip still best for new exprimenter

that is Atmel AT89C51 and the powerful tool basic BASCOM-51 free compiler
by www.mcseclec.com efective upto 2K rom coding.
and many example program to support.
it always enjoyable starting free.
programmer idea to build your own.

also check my web
www.geocities.com/syedpervez/8051.html
for some intresting projects AT89S51+BASCOM-51
total solution for beginers.and forword step by step LCD interfacing, serial communication with pc, LED blinking, 7- sement display drive and many many more all supported by BASCOM-51
 

Hi philba,

Just checked the URL you provided. How do i program PIC16F84A using "MPLAB Compatible ICD2 with USB and RS232"? Through ICSP?

I am goanna buy one of these from sparkfun.com. Kindly let me know which one I should buy irrespective of price.

(Want only USB)

1- MPLAB Compatible ICD2 with USB and RS232
2- MPLAB Compatible ZIF Programmer - USB Powered

I am from Pakistan and yes, they do ship internationally.

I was frantically searching for some programmer on net but could not find any. Went to local market few days ago and found some serial programmers. They cost around $110. Just when I was going to buy one, someone pointed me to another shop where a guy was selling local made parallel port programmers. Price was $22 and I bought one. I don’t know from where he got the original schematic but he told me to select ProPic 2 in ic-prog. And now for last couple of days trying to program my PIC but the damn thing is giving me error “verify failed at 0000h. Tried everything, every tick found on forums and discussion but no vain. Even tried on different machines with different OS (98, XP) but getting the same error.

Now I want to buy something reliable and with USB port so that I can program it using my notebook. No serial or parallel. Already have enough of these!


AG
 

Re: 10yrs of IT experience & now want to play with µcont

MPLAB compatible means that you use the Microchip IDE to directly program the PIC. This is the most reliable possible way to go.

Here's how programming works:
- you have a pic and it has 3 programming signal lines (mclr, pclk and pdat or similar names) that are used to program it.
- the programmer is responsible for manipulating the 3 programming lines
- programming software is responsible for telling the programmer HOW to manipulate the 3 programmming lines.

Since MPLAB is from Microchip, it will know how to program all but the very newest chips.

The programmer with the zif is not an in circuit system programmer (ICSP). I would definitely get one that can do ICSP - taking the chip out of the circuit each time to make a change really slows you down. Plus you have to get a different socket for each different chip pin out. surface mount chips take expensive adaptors and you can't take them out of the circuit once soldered in. So go for the ICD2 - it supports ICSP (and debug). The USB ICD2 is the best solution.

But, I wouldn't give up quite so fast on your $22 programmer. make sure the voltage into the regulator is high enough - it probably needs 16-17VDC input. verify at 0 simply means it wasn't able to program and the most common source of that error is too low programming voltage (Vpp). You should see 12.5 to 13.5V on mclr when programming. The output of the regulator should be 13V or so. Anything below 12 is too low.

Good luck.

Phil
 

okay, that $22 programmer is working now. Got it fixed from the guy I purchased.

Trying to implement First Led Project from narccizzo. Programmed my PIC using his code but when i put it into circuit, LED is not working. Can anyone tell me how much power should be coming out from the pins where LED is attached?

AG
 

Re: 10yrs of IT experience & now want to play with µcont

Hi AG,

Please tell us what PIC chips you have there that IC-PROG supports and we'll all try to help you get that first "hello world" LED program working...

Regards, Mike
 

Hi Mike,

I am using 16F84A with my programmer.

Regards,
AG
 

Re: 10yrs of IT experience & now want to play with µcont

Hi AG,

I just looked at that First PIC Project file and gosh it's pretty old and crude... I wonder if you're trying that very first circuit and program which uses the RC oscillator and a single LED on the RB0 pin? If so, you might try changing the code to look something like the example below (untested-- I don't have any 16F84A's)...

Just a reminder -- Have you checked out the Elmer 160 Tutorial I mentioned in an earlier post?

Code:
	list p=16F84A, b=8, c= 102, n=71, t=on, st=off, f=inhx32
;******************************************************************
;*                                                                *
;*  Filename: 16F84A Test.asm                                     *
;*    Author:                                                     *
;*      Date: 01-Feb-06  (last revision 01-Feb-06)                *
;*                                                                *
;*                                                                *
;*                                                                *
;*     MPLab: 7.30    (tabs=8)                                    *
;*     MPAsm: 5.01                                                *
;*                                                                *
;******************************************************************

        #include        <p16F84A.inc>
        errorlevel      -302    ; suppress bank change warnings

;
;  setup configuration fuses: Code Protection Off
;                           : Watch Dog Timer On
;                           : External RC Oscillator
;
        __config  _CP_OFF & _WDT_ON & _RC_OSC 

Main    clrf    STATUS          ; force bank 0                    |B0
        bsf     STATUS,RP0      ; bank 1                          |B1
        movlw   b'00000000'     ;                                 |B1
        movwf   TRISB           ; set Port B all outputs          |B1
        clrf    OPTION_REG      ;                                 |B1
        bcf     STATUS,RP0      ; bank 0                          |B0
LOOP    sleep                   ; sleep, WDT will wake us up      |B0
        incf    PORTB,f         ;                                 |B0
        goto    LOOP            ;                                 |B0

        end
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top