[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]
4chanarchives logo
Hi guys
Images are sometimes not shown due to bandwidth/network issues. Refreshing the page usually helps.

You are currently reading a thread in /diy/ - Do It yourself

Thread replies: 59
Thread images: 7
File: SSOP.gif (16 KB, 320x240) Image search: [iqdb] [SauceNao] [Google]
16 KB, 320x240
Hi guys
Could you recommend me a good book about programing microcontrollers? One that I can download because unfortunately it's hard to get those kind of books in my country.

I'm a beginner but I have experience with electronics and C language but I never tried to do something serious, so if you could help me I would be thank

I'm thinking about to use some Microchip model because the ATMELs are too expensive in my country, about USD20 due to taxes. (20 bucks is like what I expend in a month in the supermarket)
File: nano.png (385 KB, 1169x623) Image search: [iqdb] [SauceNao] [Google]
385 KB, 1169x623
>ATMELs are too expensive in my country, about USD20 due to taxes.

Son, let me introduce you to the wondrous world of ebay. Behold, Atmega devboard for <$2 with free shipping, straight from china.
Why not get someone to pay you to fuck you in the ass, because that's what you'll be doing by going Microchip?

There's a fuckton of material available on the net, and many active communities that can help you. No shortage of example code either.
File: Screenshot.png (282 KB, 1893x920) Image search: [iqdb] [SauceNao] [Google]
282 KB, 1893x920
That almost made me cry, I can't buy things outside I don't live in a civilized country, that would take 3 months to arrive and I would have to go to another state to pay the freaking tax.
That if it was not robbed by someone in the mail center
It's not worth, I envy you
Things don't make any sense in that fucking dictatorship

I know there is a lot of information out there but that's the problem, I'm lost. By the way you are very rude person
*I just realized that's the price without shipping so add R$25 of shipping = R$85
god I can't believe it's USD1.55
Mind telling us which dictatorship?
A tip, we speak Portuguese
File: IMG_0311.jpg (803 KB, 1600x1200) Image search: [iqdb] [SauceNao] [Google]
803 KB, 1600x1200
Hello br friend.
At least they ship to your country. Back home the only way for me was to have it delivered via courrier. Gotta love our corrupt systems.
at any rate, can't you have it delivered through Uruguay/Argentina?
If anything, just wait until you have enough a big parcel and have it all delivered via DHL/Fedex.
Have you tried your version of mercado libre/ebay?
as for books, two that I'm occasionally consulting are:
Practical AVR Microcontrollers by Alan Trevennor
Beggining C for Arduino by Jack Purdum
Sadly both are for arduino and atmel micro's.
As for PIC, there's Pic Microcontroller by Muhammad Ali. Haven't done much with it yet but it's my school's textbook.
worth noting that the pic book is notorious for errata... so the only reason I use it is because I have to.

>At least they ship to your country. Back home the only way for me was to have it delivered via courrier.
Normally I would send it to my home and I would go to the nearest mail center and pay the bill (if applied)
but now I'm in the North working for my company in a small city with basically nothing to do in my free time.

>Gotta love our corrupt systems.
By the law products that cost less than USD50 can't have taxes applied but often they do apply at least 120% of taxation and you have to refuse the product and ask for them to re-tax it with the right value

>I buy it for USD5
>at least one month to ship to Brazil
>my product enter in the line of the taxation department (it stays there at least 1 week)
>they release my product with a wrong taxation and send it to me, +1 week to the mail center next to my house
>I go to the mail center and refuse to pay the tax and ask them to send it back for review +1 week
>see step 3 and 4 again
>I go to the mail center and my product was stolen in the shipping without insurance
>go back home with a sad face

That's why I don't like to buy things on Ebay/Alibaba/DX, only Amazon 'cos we have it here
and I refuse to pay for the overpriced ones.

>If anything, just wait until you have enough a big parcel and have it all delivered via DHL/Fedex.
Fedex is great because they do all the work for you and you receive your parcel quickly
but I travel a lot in my country because of my work
so normally I send all my mail to my mail box in the mail center
and when I'm back home I just need to go there and take it from my mail box
if I used Fedex the mail center wouldn't let my parcel to be put in my mail box
because they don't allow other companies to do that, only the Government State company - Correios Ltda.

What makes me happy is that I'm moving from all this soon huehuehuehuehue
A hug bro

PT 1/2
PT 2/2
>Have you tried your version of mercado libre/ebay?
Ya but almost they all act like that:
They put the product at R$40 and the shipping for R$45 with insurance, so no big difference

>Sadly both are for arduino and atmel micro's.
Ya ;-;

>As for PIC, there's Pic Microcontroller by Muhammad Ali. Haven't done much with it yet but it's my school's textbook.
Cool, knowing that it's used in a school means a lot to me - thank you I will download it when I go to the PC

Thank you for the help my dear friends, I wish you a great and peaceful night
well, hope you get that worked out.
I reiterate. Be careful with mohammed ali's book. Our professor warned us to always look up the circuit before we tried it out as it will very likely damage the micro. Just hold off until someone more experienced and knowledgeable shows up.
I will
I see it uses PIC18 family so it's perfect for me, thank you again
>Atmel shills
>Not using the superior microcontroller from the company that offers superior support and it's most likely to keep going in say 10 years
Alguien está aquí por dros
worth noting that the pic chips are notorious for errata
Enjoy your fixed call stack depth, paged memory and busted compilers.
I really like atmega tiny 85 they are relay cheap! Here you can get them under one bug... ore you can look for some 8051. They are old but you can get updated versions. Good luck and have fun programming;)
The fuck are you using a stack for on something barely more powerful than a ZX Spectrum?
>not suggesting a book for those interested to learn.
really, man?

A book about PICs: http://www.mikroe.com/chapters/view/1/introduction-world-of-microcontrollers/

Also worth reading: https://ti.tuwien.ac.at/ecs/teaching/courses/mclu/theory-material/Microcontroller.pdf

Having worked with MCUs from 8051, STM32, Atmel and a bit of PIC families I can say that the only significant difference between MCU families is their processing core. Obviously there is also different hardware squeezed (or not) into the same chip, like ADCs, UARTs, DMA modules and whatnot, but the essentials are really quite similar. Once you get better at these, you'll certainly benefit from anything related to microcontrollers, no matter what family. For starters it is obviously better to use the literature that's written specifically for your MCU of choice, but it is also worth getting some architecture-independent knowlege to broaden your horizon.

Use google next time, though.
Maybe you've heard of the C language? But your post brings up another point: people who start out on PICs become bad programmers. The methods you have to use to make anything run on them don't scale beyond trivial programs, and when they try they end up with buggy, uncontrolled messes.

If you've ever seen a program consisting of 10000+ lines in a single loop, because PICs can't handle subroutines well, you know what I'm talking about. If you haven't, consider yourself lucky.
Piggybacking on OP question:
My teachers only taught me how to program PIC16s and I studied myself how to program PIC18s and bought myself a pickit3 because I wanted to keep programming MCUs as a hobby (mostly using breadboards, some etched circuits and absolutely no devboard).
Had to stop due to university (chose a very different career path) and general lack of spare time.
Should I drive back into the realm of PICs or should I change family?
Any tips on how to migrate my residual knowledge, should I choose to do the latter?
Ya they are like 2 dollars in US, but here they are around 13 - that doesn't sound hyper crazy but if you realize that I have to pay it with my currency
that today in first time in history have dropped it's value to 1/4 of dollar the price would be equivalent to USD35 just for a freaking ATMEL

I'm not even going to buy the pickit I'm going to build myself huehuehuehueheu

Thank you for the recommendations
You also said a lot of things that still don't know the meaning so I'm going find it out
File: IMAG0258.jpg (1 MB, 1836x3264) Image search: [iqdb] [SauceNao] [Google]
1 MB, 1836x3264
I know that feeling all too well. Honduran here. We're at 22 local to a dollar, and with plans to drop again soon.
Fuckit, I'm feeling generous. You said the problem was with taxes, what's the legalities of a personal gift? Does that get taxed, or is there some requirement to state the value of the product? China often undervalues the products they ship, and simply list it as 'electronic components' at a few cents.
"What is 'inlining', Alex"

Isn't Portugual in the Eurozone? Buy arduinos from Italy, Atmegas straight from Sweden. There you go, that's the cheapest way into microcontrollers.
>By the law products that cost less than USD50 can't have taxes

So that's Brazil

Well, an Arduino will still be cheaper than a PIC + pickit 2, even with shipping.
I'm not Portuguese opá
$500 - "Running out of space".

Also all data must be global and accessed freely from everywhere.
Hi, i know how you feel
I've started using microchip years ago here in brazil because atmels chips are too expensive
There is a few books that i recommed to start with:
> Microcontroladores PIC18 – Aprenda e Programe em Linguagem C by Alberto Noboru
>Livro Microcontroladores PIC Programação em C - Fábio Pereira
>Desbravando O Microcontrolador Pic 18 - Recursos Avançados
Cape Verde? Mocambique?
Know how to program AVR's would be a useful skill to have, I myself have always used AVR's and can never get the motivation to try PIC's
THey both a uC if you using "C" there almoust no diferences you just need to know whot you want from your project and pick right chip, for example. you can write i2c or RS communication algorithms on uP witch didn't have special ( controllers )circuits for them, built why when you can get one wit them build in.
Complications arive when you want or need write a code for uC in assembler.. then you need to know much more, Microchip uC are the best and the fastest 8Bits because they are pure RISC Atmel in other hand is a 8086 cousin and it have CISC architecture as well 8051 clones , H8, or Renesans chips, I will not go to even try to wrote program for Motorolla DragonBall or ARM & Corthex. to complex tu use pure asm, they build in with C orientation architecture.
In my opinion for small 16 - 32 bit application Renesas is the best of, for biger ONLY ARM !!! and for small devices Microchip.

But there is no major diference in code for PIC , and Atrmel if you writing code, problem is for people who just copy paste code from other sources then atmel is your dream because you can find lot of examples.
Atmel is popular just because arduino and its similarities with 8086 architecture.
And taking about IDE, MP-LAB is really good, when Arduino IDE I'm finding a bit dole. Atmel IDE is ok.
But locking from compiled code optimization you cant beat MIcrochip XC or even HiTech. But for people who want to code blinking diode, or control Character LCD DISPLAY this argument is not-relevant.
File: as.jpg (67 KB, 419x300) Image search: [iqdb] [SauceNao] [Google]
67 KB, 419x300
Wow it's cool to see that my thread is still around

>Hi, i know how you feel
I don't know how this country is going to progress everything seems so hard without reason.
In other countries children have access to all the cool toys for cheap that's probably why they are so good at science
When I was 12 I tried to buy an electronics kit but the thing was just too expensive, imagine yourself as kid playing with Arduinos and things like that.
Even Legos are freaking expensive

Thank you for the recommendations, it's cool to see that it is in C.
I tried the other books the Anon have recommend me but I couldn't pass through the Assembly part so I just learned the basics principles of it

Angola? Macau? No
In the UK, every kid had a mecano set back in the 1920s. That's why everything looks like it was made of mecano from back then. The kits were really amazing. Topgear did a segment on how they built a differential with one of the original kits.

Well this was me but I had one of those 100 in one electronic boards. Shit was awesome. Goto remember that it was rare back in the early 90s for people to even have a computer in the house but when they did, iii cost 2000$ and could barely run lotus.
That's cool, it is a pity we don't have that culture here
I had to collect my electronics from old Radios, TVs and dead toys to make my first LED blink
I hope in future we will change for something better, those taxes kill us all

btw I don't want to buy a pickit because I'm running out of money. Do you think it's worth for me to make my programmer myself?
I know that would add one possible point of failure in project but do you think it is worth?
A pickit is about R$200 and I don't want to expend that money now
Well, I guess my post >>880808 didn't include some important info.
I used to love programming PICs in assembler code. I actually enjoy more the challenge of writing as little code as possible and still have a functional device.
So yeah, I think my question should have been "is coding for atmel chips any similar (syntax, structure, etc) to coding for Microchip stuff? Would it be worth the effort to switch or should I stick with a product I already know reasonably well?"

>atmel -> arduino
>microchip -> ???
File: faggotpic.jpg (562 KB, 738x4013) Image search: [iqdb] [SauceNao] [Google]
562 KB, 738x4013
ebay has chinese clones for 34 brazillian reals
There was something as basic stamp, and flew other, But it's true you can do something as Adruino on PIC or on Renesas, its just a break board with usb programmer build in. some 10-15 years ago iv got evaluation board from renesas doing exactly that.
And there is such thing, any manufacturer making evaluation boards for theirs Chips.
Only thing they made in limited sample quantity's, most like manufacturer giving them out for free but for engineers and company cooperating with them, if you want to buy one its a bit expensive comparing to arduino.
There to factors, of sauces of arduino.

1. there a huge support and community build around it, even here any one praying it as it a best thing ever.
Lots of websites micro projects, some books written around it.
And its good because it giving alot of people first easy steps into electronic and coding.
2 factor is China :), Chinese people a very fast in adapting to market trends, and arduino wasn't that cheap, till they start making clones of it in millions.

I'm not a fascist in way I will use PIC or Atmel because it the best, saying that you proving you are very limited, in your engineering skills, and you truly just start on one uC, and get know it well blocking automatically the others. It is like some people choosing local football team and they fans of them for ever, and they hate & discredit every one else.
Good engineer is a engineer who newer stop learning,.
You can be a good, engineer just knowing one family line, and knowing only one language, fg. "C", but Engineer who knows many types, wroted code in assembler , C , C++, know the differences between all of them good and bad sides, and designing something he can get the best approach, and do things more efficiently.
I'm not saying assembler is required to be good, it's handy in very limited projects, and mostly I using just assembler injection code in C or C++ when i know i will be better then compiler code.
>"is coding for atmel chips any similar (syntax, structure, etc) to coding for Microchip stuff?
The basic ideas are the same, but AVR has lots of registers, normal programmer-accessible stack, normal conditional jumps (like "branch if lower", instead of "test bit and skip") and generally no need for bank switching.
All of this is pretty irrelevant if you're using a C compiler, though.

>Would it be worth the effort to switch or should I stick with a product I already know reasonably well?
Depends. If it's just your hobby and there's no clear need for you to switch, then it's probably better to continue using what you already know.
AVRs have a more modern architecture, that allows you to use better programming practices, and is more suitable for high-level languages. Atmel's AVR compiler is completely free (GCC), Microchip have a free one that doesn't optimize, for that you have to pay. Because the PIC architecture is so poorly suited for C, their compiler is also pretty buggy.

You can also tell both Atmel and Microchip to go fuck themselves, and buy a cheap Chinese Cortex-M board. Compilers and IDEs are free, debuggers are really cheap, it's the future.
Thank you for your very thorough answers. Actually taught me some things about the programming world. Programming has never been an important part of my school studies, so I learned by trial and error and stuck to assembler as a programming language.

As >>882938 said, I chose a very different career but I'd like to continue working on electronic circuits as a hobby. I just can't get myself to start learning C, but since it looks like it is the most practical language, I'll have to give up and grab some books.

Now that's something new
But aren't those awfully complex for someone who never stepped beyond 8 bit computing?
>But aren't those awfully complex for someone who never stepped beyond 8 bit computing?
Is an Atmel Xmega "simple" just because it's 8-bit? Eg. the STM32F1 series are not complicated, and there's library code to help you with clock setup. Besides, I thought you wanted to learn?
Yes, that's the whole point, learning by doing.
32 bit uC datasheets pretty much scared me off when I tried to get working on the PIC32 board that came with my PicKit3 package.

I don't really think I can get to use them without learning C, but I guess it's time to be brave and leave my comfort zone.
Any suggestion on learning material, besides google?
My big suggestion of learning C or C++,
start that for simply computer programs first "Hello Word" etc,
there is a flew differences between uC a computer code but they down to bit operations etc. in computer coding you simply not using them.
apart of that if you know all commands loops etc how they work, get down to uC programming it will be much easier.
You can find tutorials and start courses everywhere in internet for C language, lots of books,and whole courses.
learn to use simple librarians as math. Std. then you can jump into uC programming.
So there are people that program in Assembly but don't know how to program in C?
That's really surprising
Not that surprising, if he started with low end PICs quite a long time ago. All the decent C compilers for them were commercial. Also, if he learned it in school, his teacher might have though that asm is educational.
That's what happened, and the only other languages the man taught us were Turbo Pascal (!!) and Lazarus.
Then in uni I learned some Matlab, but that's another, painful kind of story.
So yes, I got fascinated by the challenge of implementing complex operations using as little code as possible.
I remember writing a routine to divide a 16 bit integer by an 8 bit integer (with 16 bit result) in mpasm on a PIC18F4550. That thing took quite a while to code but was amazingly satisfying to get it to work.

Here's one last stupid question: care to give me some URLs on those ARM devboards you (or someone else) told me about? I'm not asking to be spoonfed, but I really have no idea what I should look for.
Open source stuff would be perfect, since I'm really getting into open source software and hardware.

Thank you all very much, /diy/.
Go to eBay and search for "stm32f103". For debugging you want something that's supported by OpenOCD. There's some really cheap ST-Link V2 clones on eBay, but I don't know if they work or not. A real ST-Link, or a CoLink isn't too expensive. I would recommend against a J-Link or ULink clone, they don't work with the real software.

Google "gcc arm embedded" for an ARM-supported version of GCC. "GNU ARM Eclipse" is a set of Eclipse plugins for integrating the GNU ARM GCC compiler and OpenOCD with Eclipse. There's also other environments like CooCox that others really like.
If you're not the guy who has limited access to buying things from the internet because he lives in a third world shithole, then there's plenty of ARM-CM devboards I've been using lately.

I do really like TI's Tiva Launchpad series. They're what I learned on in Uni, and the TivaWare driverlib software package even pre-dates ARM's CMSIS package.

Now, if you go a little cheaper, then ST has two dev board families for their ARM-CM chips: Nucleo and Discovery. Nucleo tends to be more bare-bones, all the Nucleo boards just have the chip, a crystal, and maybe an LED or two as attached peripherals, while the Discovery boards typically have at least one or two major demo peripherals attached for education purposes.

They don't sell them directly though, you'll probably have to look for your favorite online component retailer (Digikey, Mouser, Farnell...)

Those are my two personal favorites. There's also the Silicon Labs' Gecko family, Freescale's Freedom family, plug those search terms into the internet and see what comes out.
Well, it depends on whether you consider Italy to be a third world shithole or not.
Actually, following >>883463 's advice I was looking into the ST Nucleo family because I can get them relatively cheap (~19€ including delivery) and the decent support section ST has on them.
This price range is well within my budget, and I've still got many unused components from old projects, so the connectors on the Nucleos would be good enough for me.

I guess I have to contradict myself and as yet another question: should I go for an "high end" ST Nucleo board (STM32F411) or a "baseline" board (STM32F103)?
I think I should go for the one with more memory, so that I can worry less about optimisation while I'm learning the basics. Any more tips?
To clarify: with PICs I avoided using high end MCUs for basic stuff because of the fuckton of internal devices that _had_ to be configured individually before writing the main program.
Is this still an issue on ARM microcontrollers?
In my experience with ARM-CM's, all Peripheral Enabling Registers default to "Disabled" on compile, and you do initialization to turn stuff on during the very beginning of run-time.

I would say going with a Nucleo your primary advantage is the on-board debug and the included ST-LINKv2 on board. But those won't be relevant until/unless you want to start programming chips outside of your devboard prototyping. At that point it's a godsend because the Nucleo (And Discovery) doubles as an ICSP and ICDI and you don't need to buy stand-alone programmers and debuggers.

The advantage with the cheap F103 boards on eBay, besides price, is that it looks a lot like it's just a Arduino-compatible bootloaded device without a need for an external programmer.
Great, I'm going for this, then http://it.rs-online.com/web/p/products/8224052/
As soon as I find local board prototype businesses (don't want to mess with FeCl3 anymore), external programming will become a necessity so that's a big plus for me.

Thanks a bunch /diy/! I'm back to lurking

(oh come on, just one shortened link!)
That's cool, I'm not the Anon you quoted
Thread replies: 59
Thread images: 7
Thread DB ID: 61175

[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.
If a post contains personal/copyrighted/illegal content you can contact me at wtabusse@gmail.com with that post and thread number and it will be removed as soon as possible.