pic contoller

Status
Not open for further replies.

goodpickles

New Member
Hello!
As I have a little spare time this time of the year I decided to pitch into a micro controller project. After looking at various different ones I have settled for the pic 16F877 with the oshensoft basic programmer.

Here is what I am planning:
a speedometer(to include ave speed, total odo, trip odo, etc.) , clock driven real-time, voltage meter/monitor, and thermometer.

My question is this, can I code all this, and stay within the program length limit?

Also do you know of any tutorials that would be helpful, as the info that oshensoft gives makes it hard for a newbie
 
u better try nigel goodwin's pic tutorials... and stick to asm... always stick to asm....lest he burst another capillary....
 
Yes I have looked at his website. It is very informative, but for a beginner I think assembly is just to hard...maybe I am just lazy? Also I think basic is faster to program. And I have some Basic knowledge in computer programming.
 
I suppose you should learn Asembly prior to Basic, it's not that hard and the code is *very* small. You will also understand how microcontroler prcess instructions, you can't see that in higher level languages.

If you use Asembly for your project, you won't have problem with Program memory space.

BTW: If you want to use high level language, I prefer C to Basic...
 
So Jay, you're saying it's the 'ol ABC's of programming...

ASSEMBLY is low level programing, BASIC is a higher level programming, and C is highest? ROFLOL :lol:

In the past, I've programmed in all three. When getting down to the processor level (like you do with µC) and talking to it on its level, nothing beats assembly.
 
I think assembly is just to hard...maybe I am just lazy?

I'm lazy too. High level languages like C and basic sacrifice some code space and execution time for clarity and ease of use. Unless you are going to make a million of the device you're programming for, the cost of the extra speed and flash arn't a big deal - less than a $ in quantity one - so don't be afraid to use a high level language. For Basic or C I'd recommend a controller with at least 4k of flash. This isn't a hard limit but it'll make it less likely that you'll run out.
 
I use Mixed C programming approach which allows flexibility and efficiency of ASM and simplicity C. Only very complicated routines are written in C such as floating number arithmetic, lengthy calculations etc. Rest of the times I prefer ASM, especially for time critical routines such as Interrupt Routines.
 

I use a Mixed C programming approach which allows ASM where required (very little) and C elsewhere. I would gladly pay a buck or two more for a processor that has what it takes to allow me to do this.

You may find that you enjoy programing in ASM. The instruction set for the PIC16 is not difficult learn, and you should learn it. Once you understand ASM and how the processor works there is no compelling reason to use it on a regular basis.

Given that you do not know PIC ASM (or any ASM?) you should use it for this project. When you are comfortable with ASM you may choose to switch to C or Basic.

I do my micro programming in C. On the PC I use C#. This allows me to switch between the two worlds without a major brain drain.
 
Processor has nothing to do with the language in which the code has been written. All you need is a compiler that supports mixed C programming approach (or atleast inline assembly). I suppose most of the modern compilers support it.
For controllers such as PIC16, where resources are limited, you are compelled to use ASM even against your desire of using C or Basic.
 
After playing around with Proton+ I'd never go back

The ease of use is unbelievable, e.g.

Code:
Device = 16F877

Dim Result As Float
Dim Sample As Float
Dim Array[10] As Word
Dim Var1[10]
Dim X as Byte
Dim Y as Byte
Dim Z as Byte

.
.
.
Sample = ADIN 0
Result = Sample * 5 / 1024
Array[X] = Result * (Array[Y] + Var1[Z])
Print At 1, 1, "Volts: ", DEC2 Result                            ' Display some data on the LCD
HRSOUT DEC Result, 13, DEC Array[X - 1], DEC Var1[Y-Z]           ' Send the data in RS232 format to your PC



The actual use of such expressions is for nothing valid, just an example of how seeming less easy 32bit math and interfacing with other devices is.. Let others do the hard work while you can focus on the real job at hand
 
I wonder if Proton+ integrates with MPLAB.
PICBASIC Pro works great with MPLAB, you also get a limited (32 lines of code) for the 16F877A and a few other PICs for free.
 
blueroomelectronics said:
I wonder if Proton+ integrates with MPLAB.
PICBASIC Pro works great with MPLAB, you also get a limited (32 lines of code) for the 16F877A and a few other PICs for free.

Proton is a development suit. Its not just a compiler/interface for programming. Theres no requirement in any way to use MPLAB and Proton..

It allows people to download and add plug-ins, simulate their software in a circuit in real time, create user specific macro's etc..

Some of the plug-ins are extremely handy, like the character generator for custom LCD characters/pictures, or the SD Card plug-in that allows SD Card interfacing with seemingly easy commands even for FAT file system creation.

There’s heaps out there, the best one of all im my opinion is for use with interrupts, and allows complete use of every basic command and hardware level interrupts at the same time - something that a lot of higher level languages lack (stops memory corruption and alterations during a hardware level interrupt, and allows the user to use any picbasic (higher level commands) during the interrupt, by only backing up the system registries and memory being used specifically in your program for optimal speed).

This is all free after you buy the software.
 
gramo said:
This is all free after you buy the software.

It is NOT free. It is at no additional cost.

If current code limit seems to be 50.

 
Last edited:
3v0 said:
It is NOT free. It is at no additional cost.

Hehe, sounds like 2 ways to say the same thing. I guess there’s nothing stopping someone from designing a great tool/plug-in and charging people for use of it, but that’s the same for any development suit that allows user customization..


3v0 said:
If current code limit seems to be 50.

Quite right, 50 Lines of PICBasic code, not what the program is compiled too.

My first thought of 50 lines was: pffft, But it doesn’t take long to realize just how little programming is required to interface with different components with a higher level language
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…