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.

Programming

Status
Not open for further replies.
ICD all the way for me, a emulator or logic analyizer would be nice but is outside my budget. Not much use for simulators.

Write the framework and stub the rest out.
Try to have code that compiles and runs
on hand at all times (and not too distant from current).

Replace the stubs with code as needed.
Build and test as frequently as possible.

Step-wize (small steps) refinement.

Write test code to ensure that you do not break the code you wrote yesterday. (not as much as I should)
 
3v0 said:
ICD all the way for me, a emulator or logic analyizer would be nice but is outside my budget.

Thats a structured approach you've got 3v0.
Just on the logic analyizer, have you considered POScope? Or is that still out og the budget?
This **broken link removed** offers less digital debugging, but it has up to 100 Ms/s real-time sampling rate and 100MHz bandwidth compared to the 200K/s on the POScope

Download the software for each and see how it works.

Leftyretro said:
I use a PICAXE

I've heard the programs are a lot slower than that of normal PIC programming, is that the case?
 
gramo said:
Thats a structured approach you've got 3v0.
Just on the logic analyizer, have you considered POScope? Or is that still out og the budget?
This **broken link removed** offers less digital debugging, but it has up to 100 Ms/s real-time sampling rate and 100MHz bandwidth compared to the 200K/s on the POScope

Download the software for each and see how it works.



I've heard the programs are a lot slower than that of normal PIC programming, is that the case?


Well actually they are much faster ;) (to write, debug and run) then most others, but yes being an interpretive basic it will have slower run times then either assembly or complied languages.

However my first love is hardware not software so I like what works easiest and cheapest and gives me the fewest problems. For lowest cost and quickest learning curve I have found nothing to compare to the PICAXE series. For those times that it can't handle a high speed application I'll try augmentation with external hardware assistance :)

I've only had mine a few weeks but have played around with IR remote control decoding (Sony format), hobby servo control, analog output using PWM + RC filtering, PS/2 keyboard decoding and I2C interfacing to a external eeprom. They work well, the free IDC software is very complete including simulation, debugging, sytax checking and of course program downloading via a bootloader in the picaxe using a serial cable and two resistors!

So while it's certainly not the best choice to use for highest performance and commercial applications, for home hobbyist use it's a very viable alternative, esp' for getting started.

Lefty
 
What kind of programmer are you? Do you make a sketch/pull out the white board/make lots of small routines/randomly write things until it works?
For some small simple programming projects I'll dive right in and code away.
For more complex stuff I'll make a simple flow chart without the boxes. (Just text and some arrows on paper)
What are your debugging techniques? ICD/VSM/Attack the computer?
I'll use a SIM for basic debugging and an ICD for anything that is hardware intensive. I have been known to talk to my code. :D
I also tend to cut and paste tried and true code segments between projects.
 
For the most part the ICD2 works well enough. Most of the stuff I do these days is not too difficult. Mostly teaching and home control stuff.

It is more a matter of motivation then money. I have an older HP analyizer that I picked up at the company scrap sale when I was working. Last winter the CRT quit.

I could get it fixed but it makes a lot of noise. Maybe new fans would help. Some day...
 
Last edited:
Am I going nuts here, or does anyone else see a rabbit with a pancake on its head? I don't understand the reference - am I missing something?

For programming, write something that makes sense to you, and above all else, works. Programming protocol, efficiency, etc, are all secondary to the primary objective: making something that works. After you've got something that works, then refine the program as necessity dictates and resources allow. Don't fear the critics, do something that works - everything after that is academic.

It helps to have a crystal clear idea of what it is you want to accomplish. When things fall apart, it's usually because there was never a good idea of what was the objective, and (just as important) what were the dismissable factors. That's okay if you're programming to just learn more about programming, but not okay if you want to get something done. Have a precise concept of the final product, and everything else will fall into place. I guess what I'm saying is that any method/approach to programming is inherently self-serving on at least some level - what you want to be inherently self-serving is the thing you're trying to accomplish, not the means of getting there.
 
Last edited:
hi gramo,
I see from the pic props that its a 'pancake-rabbit!'.

Ref programming I use a top down method, similar to 3v0.

Using a programmers text editor, paste in a PIC Config header, start with the function headers, sub headers subroutine headers and then flesh out with comments.

By using a text editor I havn't got the temptation to start writing code before I have a clear idea of the structure.

Using MPLAB, create a project and paste in the text file, write the assembler code for the program control flow sequence, then paste in known working assembler subr's from my library.

I know this sounds long winded, but once you have the PIC headers and proven subr code in a database, cut and pasting is fast.

To assist in any in circuit debugging I paste a LCD and UART subr in the program, writing short diagnostic subr as required to display/transmit the status of program variables.
Its also useful have a program 'strobe/sync' output pin on the PIC that can be called from the program in order to trigger
the external scope.

The PIC pcb is self made, with ZIF sockets and 4*16 LCD and MAX232 etc with two project boards along side.

To debug I use the Oshonsoft sim, I write my own external sim modules, using VB, for the sim to suit the project.
Vladimir of OS has made a recent change in the sim's refresh rate, the sim rate is much improved.

Using a PICstart+ ICSP programmer its nice and simple. For harware debug I use a scope etc.

It works for me.
 
Last edited:
ericgibbs said:
To assist in any in circuit debugging I paste a LCD and UART subr in the program, writing short diagnostic subr as required to display/transmit the status of program variables.
Its also useful have a program 'strobe/sync' output pin on the PIC that can be called from the program in order to trigger
the external scope.

The PIC pcb is self made, with ZIF sockets and 4*16 LCD and MAX232 etc with two project boards along side.

To debug I use the Oshonsoft sim, I write my own external sim modules, using VB, for the sim to suit the project.
Vladimir of OS has made a recent change in the sim's refresh rate, the sim rate is much improved.

Using a PICstart+ ICSP programmer its nice and simple. For harware debug I use a scope etc.

It works for me.

Your home made development board sounds great! I have something similar with just a 2 * 16 LCD, COM port for UART, and a 40Pin ZIF & 10Mhz Crystal (For PLL with 18F PIC's).

Making my own development board was definitely the best thing I ever did with PIC's! I use Polarized Headers to link other protoboards/breadboards to the development board. They are simply the best for linking other boards/sharing power, but the trade off is constructing all the leads

**broken link removed**


I use multi core telephone cable, and crimp the ends and add a dab of solder to make them a little more rigid to the crimp connectors (Part # PLHDPIN futurlec.com )


Your overall approach does anything but set you up for a fall gibbsy, nice too see so much structure and pre-thought involved
 
hi gramo,
Are you using 'remote viewing' to look over my shoulder???

I also use Molex 0.1 inch pitch connectors, [white] with tinned solids wire from re-cycled multi-core post office cable,
crimped and soldered, it also fits nicely into the push fit sockets on the project boards.

At the moment I am upgrading the osc section on the board, added a 8 pin DIL connector, using modular osc chips, 4,10,20 MHz
and using 8 pin plug in headers for crystals with caps. 16F877 and 18F452 are more useful on my commercial projects.

Also my friends call me gibbsy, on a good day!

Regards
 
hi gramo,

Ref the Molex Pol connectors, if you are not already aware, you can get them in a 'right angled' version ie: the solder pins are bent at 90deg to the moulding, so they lay flat on the pcb.
There are two types, one with polbar in contact with the pcb and the other with polbar over the pins.

Ron: Never had a 'bunny' for breakfast before, I'm thinking, I'm to old to try now. If you know what I mean!
 
gramo said:
What kind of programmer are you? Do you make a sketch/pull out the white board/make lots of small routines/randomly write things until it works?

What are your debugging techniques? ICD/VSM/Attack the computer?

Just curious :eek:

**broken link removed**


Pfft I myself use the "Hit the computer untill it does something" method.
 
hi rumiam,

There's an old saying, when a piece of equipment is not working.

A Mechanic knows it needs kicking.

A Technician knows it needs kicking and how hard to kick it.

A Engineer knows it needs kicking, how hard and where to kick it.
 
There's another old saying that's becoming more pertinent by the day.

The graduate with a Science degree asks, "Why does it work?" The graduate with an Engineering degree asks, "How does it work?" The graduate with an Accounting degree asks, "How much will it cost?" The graduate with an Arts degree asks, "Do you want fries with that?"
:D :D :D

Love it.

Mike.
 
gramo said:
Just on the logic analyzer, have you considered POScope? Or is that still out og the budget?
This **broken link removed** offers less digital debugging, but it has up to 100 Ms/s real-time sampling rate and 100MHz bandwidth compared to the 200K/s on the POScope

This offering from HobbyLab looks to be identical to the PoScope (even to the point of using the same software), only it would be a cheaper purchase for someone living in the US (169.50$ + free shipping as compared to 212.89$ + shipping for the PoScope).

Other recommended alternatives for logic analyzers are the Intronix LogicPort (which I own and highly recommend), the USBee, and the RockyLogic ANT. All three have gotten good reviews in industry magazines.

On PC Oscillocopes: If you search around, you can find colour digital oscilloscopes at better prices (bang-for-buck) and with better technical statistics than PC-based offerings. Check tequipment.net and saelig.com, as well as google, for the Owon 20MHz (around 329$) and 60MHz (around 579$) models. If you subscribe to the Electronix Express Newsletter, their current offering for subscribers is a 100MHz, 2-channel, color DSO for 895$. You can find prices even better than these if you go analog.

Check around. Subscribe to company newsletters. There are always deals to be had on test equipment! I have gotten quite lucky in the past on closeouts and subscriber discounts. :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top