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.

[SOLVED] Visual Basic - Microchip

Status
Not open for further replies.

Hooseria

Newbie level 5
Joined
Sep 15, 2010
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,357
Hello, I've decided to get into microcontrollers.
I am an advanced VBA programmer, so my question is, will it be worth my while buying a book on VB for Electronics, and not opting for changing my programming Language. I'm also about to buy the PICKit 3.

Will I be able to programm Microchips via the PICKit3 on Visual Basic. I've searched the internet and could not find the answers to my querries.

Kind Regards
 

You can't run VB programs in a PIC. You should be able to write VB programs that can interface with PICs though.

All VB programs are MASSIVE, even if the executable (exe) looks small enough to fit in PIC memory, it would rely on the Windows operating system files and probably run-time libraries and DLLs as well. VB programs will not run in isolation of the PC/Windows environment.

If you want to program in BASIC, (not VB) because that's the language you are familiar with, look at either Oshonsoft's compilers at www,oshonsoft.com or at MikroBasic at www.mikroe.com.

Personally, I hate the excess baggage and waste in VB programs, I find programming on devices that run for a year on a watch battery to be far more satisfying.

Brian.
 
Ah Hah, the plot thickens, Thank you Brian. So the book that i've seen Visual Basic for Electronic Engineering "Applications", is for running programs to INTERFACE with microcontrollers, not program them.

I guess I should start getting familiar with BASIC. Just one more question, still thread related. Which is the most widely used PIC controller language. Preferably easy to Learn, that would also interface with a VB driven program.
 

A thick plot indeed!

Much as in the world of 'big' computers, the main languages are assembly, C and BASIC although there are a few others. Don't forget that your PC is almost certainly running a 32-bit or 64-bit processor and has a gigabyte or more of memory to run programs in. In the PIC world, the smallest processors only have 256 Bytes (not Kb, Mb or Gb!) of memory and even the ones with most memory are still tiny compared to what you are used to. The vast majority of PICs are also 8-bit or 16-bit so you have to be far more conservative when it comes to using storage. On the other hand, the PIC is vastly superior at doing small jobs efficiently and although they have relatively low clock speeds, the overall execution can be very fast because more is achieved per tick of the clock.

If you want to become most proficient at programming, there is no substitute for using assembly language produced by MPLAB from Microchip themselves, it's free, supports all PICs and has full debugging capabilities. Assembly will always give more 'bang per buck' than other languages but it is the most complicated to learn. MPLAB also supports high level languages and a limited version of 'C' is included in the download. You can get it from www.microchip.com

As for actual code efficiency, asm is best, 'C' is next and unfortunately BASIC comes some way behind them. Someone is bound to say I'm wrong and quote examples to prove it but I'm sticking to that statement. Assembly allows you TOTAL control of the program, C is better than BASIC at parameter passing between routines due to it's stack based operation. The choice is ultimately yours but whichever you go for, you will have to go through a process of 'decontamination' from using Microsoft tools to get back to low level programming. It's worth it though!

To interface with VB application, probably the easiest way is to use serial port (com port) routines, VB is terrible at timekeeping so if you try to send out software generated signals, for example through a parallel port, it is likely to fail. You can use USB on some of the larger PICs but again that is a serial protocol.

Brian.
 
Brian Thanks for the superb reply, I'm going to have to set time aside to start a new Language study. Assembly from MPLAB.
I had a look at Assembly though. Just a perusal.... gave me an ache of note.

Once again thanks for the help, will post my first project on this site, once done.... Hopefully I don't throw in the towel.
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top