![]() | ![]() | ![]() |
| | |||||||
| Notices |
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink (permalink)) |
| 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 | |
| | |
| | (permalink (permalink)) |
| 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... | |
| | |
| | (permalink (permalink)) |
| 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.
__________________ Dave Life may not be the party we hoped for, but while we are here we might as well dance. | |
| | |
| | (permalink (permalink)) | |
| Quote:
| ||
| | |
| | (permalink (permalink)) |
| 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. | |
| | |
| | (permalink (permalink)) | |
| Quote:
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. | ||
| | |
| | (permalink (permalink)) |
| 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. | |
| | |
| | (permalink (permalink)) |
| 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
__________________ Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net | |
| | |
| | (permalink (permalink)) | |
| Quote:
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.
__________________ Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net | ||
| | |
| | (permalink (permalink)) | ||
| Quote:
If current code limit seems to be 50. Quote:
Last edited by 3v0; 7th March 2007 at 07:01 AM. | |||
| | |
| | (permalink (permalink)) | ||
| Quote:
Quote:
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
__________________ Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net | |||
| | |