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.

New To Microcontrollers and Programming

Status
Not open for further replies.

Jon Wilder

Active Member
Hi all. New to the forum. I've got 20 years electronics experience under my belt which is mostly all analog/vacuum tube technology stuff (been building guitar amps for 13 years).

I've recently decided to take the leap into the digital world as my goal is to learn how to build MIDI decoder circuitry, which requires some sort of uC with onboard hardware UART/USART. I know some guys have been successful in emulating a UART through software "bit banging" but I figure why do that when there are plenty of uC's available with on chip hardware UARTs?

I'm full and aware of what I need to know about the MIDI specification. What I'm seeking to learn is how exactly to implement these criteria in the software and programming of the uC. I'm starting out with simple programming of the 16F84 on a circuit board with LEDs on the Port B pins just to get a feel for assembly, but I plan to order up some 16F628s pretty soon and experiment with those, then eventually move up to the 8031/80C31 uC as most MIDI devices use this uC for MIDI functions. I know the 8031 is just a ROM-less 8051 so I assume most companies prefer to have the ROM off chip for easy repurposing via software revision and just swapping in a different ROM chip.

Anyway I'm sure I'll have lots of questions along the way. Lookin' forward to speaking with you all!
 
You might look at the PIC18F-series and either Swordfish Basic or Amicus/Proton Basic.

The 18Fs are a big enhancement over the 16F series and may be all you need for a MIDI controller.

As a starting point for Swordfish and Amicus/Proton, check out **broken link removed**. There are many examples and guidance on getting started.
 
This should be of some use to you, **broken link removed**, it uses the PIC16F628, ASM and the USART. Might be a good jumping off point if nothing else.
 
Thanks for those links guys. LTX71CM...yeah I had been to his site before but some of his English was hard to understand (that and his code comments all appear to be in French lol).

I've also been reading up on the PIC16F628 data sheet as well to gain an understanding of what the SFRs and addressable bits in the USART do so that I can understand the USART routines as well.

Sometime next week I should have some 16F628s to play with and see if I can successfully apply the example codes as well as see what the chip actually does with given input data values vs software code, etc etc. Tonight I'll be building up a basic 7805 based +5VDC supply to run my experiments from.
 
I would also suggest skipping the 16F series and going for the modern 18F series. Plus the 18F have Swordfish BASIC with an excellent demo version.

The 18F1320 is a nice little PIC to get you started.
 
I will also add my voice for the 18 series chips and Swordfish Basic. As for external ROMs, don't bother, these days the (flash) ROM is on the chip and updated via ICSP (In Circuit Serial Programming).

Mike.
 
hold up there.....skip the 16F series? And miss all the bank switching fun and limited RAM?

Only do that if u skipping asm. The bigger chips handle hi level languages better. BUT, if u have to do tiny projects for commercial purposes or training purposes you should not overlook the 16F series.
 
BUT, if u have to do tiny projects for commercial purposes or training purposes you should not overlook the 16F series.

Are they cheaper or better for that?
 
hold up there.....skip the 16F series? And miss all the bank switching fun and limited RAM?

Only do that if u skipping asm. The bigger chips handle hi level languages better. BUT, if u have to do tiny projects for commercial purposes or training purposes you should not overlook the 16F series.

Please tell me that you're not teaching or training others.
 
The only reasons to use the older 14bit or 12bit cores are 8 & 6 pin packages and ever so slightly cheaper than the 16bit core.
The 18F have free Student editions of C (C18) and BASIC (Swordfish), more options (USB, Ethernet), more RAM, FLASH. Improved instruction set with none of the oddities of a MPU designed in 1977 (the original PIC1650) on which the 16 series were based.
IMO a PICkit2 / 3, Swordfish / C18 and an 18F is as easy to learn and offers more flexibility the very popular Arduino.
 
What's so terribly wrong with a bit of bankswitching?

Better to know about it than not I think. Seems that the ppl u train Pommie will not know what to do if presented with older asm core code to use/learn from. Therefore they are unable to make use of the massive amounts of sample code online. But then, I work with qualified engineers as my basic feedstock, not high school grads etc.
 
I can't see using 16fchips myself. If you can program a 18f in asm I'm sure you could program a 16f chip LOL

A 18f1220 or 18f1320 is as good as it get's for general projects. And code swapping is easy. With C or basic need more pin a 18f2520 or 18f4550 and have usb

What would be nice is a 8pin 18f chip

I work with qualified engineers
Are there such a thing coding changes fast for some one to stay up to date. I don't think they will find that in what they learn as a engineer

It's a day to day update
 
The 18F1330 is targeted at motor control so it gives up one timer in favor of more PWM hardware. The neat thing is that it has a PLL so you can run with the internal clock at 32Hz and get 8 mips. 4X the speed of the non PLL'ed chips.

It also has 3 breakpoints instead of 1.
 
Last edited:
I tend to observe that people who take the shortest route to a result are not always innovators although they make good 'regular' workers.

Sometimes it requires innovative thinking and approaches when using the more limited 16F capabilities. I am not merely looking to train programmers, they are easy to come by. I train mechatronic innovation. I need my engineers to come up with novel approaches to problems. It's not about spoon feeding them the easy solutions.

By understanding a wider range of uC issues you have a better grasp of optimisation. High level languages & powerful processors and so on have their place for larger project management. There will always be a place for those who can work with basic processors and get good results.

I will fail a project that uses an 18F when a 16F will do.

Perhaps a couple years from now the 18F will become the baseline but it isn't yet.

Everyone has their own approach to this topic. It's a bit like 6 or a half dozen.
 
Last edited:
In the penny pinching mode you must compute total cost. If the production run is not large it is cheaper to spend a bit more per unit if it reduces engineering time/cost.

Many products are very "time to market" sensitive. It is best to start a project with enough headroom to ensure that you can finish it without a processor change.
 
I'm for sure missing something here most things I find have one of these pic16C54 PIC16C54

66 cents 16f54 but it has not a thing but I/O and timer0

$2.85 18f1220 adc pwm timers 3 uart

I'm missing a lot of fun bit bang it all must be good I'm ordering a tube today
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top