Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help with microcontroller programming for a complete newbe

Status
Not open for further replies.

Old Guy

New Member
Hi to all,

Can anyone steer me in the right direction please. And sorry if this has already been threaded.

I want to learn how to program microcontrollers. I know what hex looks like and how it is made up, but I need to start at basics as a newbe to programming.

I guess the microcontroller will have its own on-board memory or will require an E2prom?

My goal is to decode the (serial) output from an RFID reader into a simpler output that can identify each RFID tag into a simple number form, maybe starting at number one and incrementing by one despite the Tag's own value. The RFID reader I have in mind has an RS232 output (although that isn’t crucial to the project), I thought RS232 would make things simpler for set-up as it could input a laptop or similar, but the laptop (if used) would not be the permanent decoder, just for testing and set-up.

I must add that this is for a home project and not for any form of RFID skimming.

Are there books or links to programming, that a complete numpty like me can understand? I have no idea (at present) how the programming instructions should be used or what they mean. Or what type of microcontroller to use.

The microcontroller memory must not be volatile because I want to be able to power it down for days at a time and just power it up to use it with the same RFID tags that were programmed in.

Many thanks.

Old Guy. (Vacuum valve era, now those were simple days, where's my ECC85...)
 
Last edited:
Hi Old Guy and welcome.

I suggest you start by reading this thread.

Have you done any programming? If so, what language/machine etc.

Mike.
 
Hi Mike,

I'm really embarrassed now because I saw that thread AFTER I posted. :-(

A long time back I used Sinclair BASIC (ZX81) and Mallard BASIC, but not very adventurously.

The thread looks like what I need to start with so I will get stuck-in there.

Thanks for your reply.
 
Hi,

As you will have seen from that Sticky Post you have a great choice of hardware and software.

Its difficult to recommend one or the other as everyone has there own views, perhaps try Assembler, Basic and C and see which one you can follow easiest.
You can get free versions of them all - do not buy anything, not necessary.

I use assembler and if that looks understandable to you then try Nigels tutorials, he is a member here so help is always at hand.
You can work though the tutorials from the basic flashing led and move on to his RS232 code which is exactly what you need.
It also has a lcd display section so you can visually monitor the codes etc.

There are other web projects using the Pic chip and a bit of simple hardware to act as the RFID reader itself, though would suggest you use and prove things ok with a ready made reader first.





(Vacuum valve era, now those were simple days, where's my ECC85...) - well going by the price of hifi valve amps are fetching these days you should get busy build and selling a few - very profitable as long as you can find someone to chrome finish the chassis and shrouds for you .
 
Last edited:
If basic is your choice then swordfish... but to better understand the PIC micro i suggest this page...
**broken link removed**

Its in that Newcomers Post...

I got into micro because of that site heh
 
If basic is your choice then swordfish... but to better understand the PIC micro i suggest this page...
**broken link removed**

Its in that Newcomers Post...

I got into micro because of that site heh

That's the exact site that got me into it. Although I will say there is an error in Tutorial 4 where it talks about the decfsz instruction -

DECFSZ COUNT,1



This instruction says ‘Decrement the register (in this case COUNT) by the number that follows the comma. If we reach zero, jump two places forward.’

Actually decfsz means "DECriment the value in File by 1, Skip if value in file = Zero". The number after the comma is the "designator" that tells the program where to place the result of the decriment, which can either be placed in W (0) or back in the source file (1). You can also use "W" or "F" in place of 0 or 1 respectively.

In this case it's saying to decriment the current value of the file register by 1, then place the result back into the file register itself.
 
Last edited:
Pommie, Mike, Wp100, Jon Chandler, AtomSoft, Jon Wilder

I am overwhelmed by your responses and generosity.

I have started the PIC tutorial and will go thro it meticulously until I understand PICs.

Thanks for all your help and suggestions, all of which I will try.

I will come back to this thread (if that's allowed) to update on how things are going.

Old Guy.
 
Last edited:
Hi,

You are welcome...

While reading can help, I always find doing a bit of simple coding is a better learning method.

Microchip have a free downloadable program called MPLAB IDE that also includes Assembler and C compliers so you can try a bit of coding straight away.

It also has a simple simulator so you can run your code and watch each instruction execute and change the various memory locations and ports.
**broken link removed**

Edit

I will come back to this thread (if that's allowed) to update on how things are going.

Have you seen the number of posts Atomsoft and Pommie have between them 12,000+ and thats just this year ! :D
 
Last edited:
heh :D i love posting... im not sure everyone likes all my post but heh i get bored very easy. Also if you need help feel free to ask any question on the forum... but try to search before posting heh... :)

Also a great book to read for free online:
**broken link removed**

The above link should be changed : (i think since the above link is dead)

For C code
http://www.mikroe.com/eng/products/view/285/book-pic-microcontrollers-programming-in-c/
and
For BASIC code:
http://www.mikroe.com/eng/products/view/476/pic-microcontrollers-programming-in-basic/
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top