Questions for Electronics hobbyists / experts

I dabble with electronics, at a very novice level at the moment.

I’m searching for electronics forums on the net, but while I do, I thought I’d see if anyone here is also a dabbler / expert / electronics engineer :slight_smile:

I’ve been reading up on the Pic microcontrollers, and specficially about the ICSP programming protocol and have been trying to simulate it with Multisim 9 (Electronics Workbench).

It took me awhile to understand the serial data / clock signal relatioinship, but I think I’m starting to “get it”.

Anyhoo, on a very basic starting point, I created a simple circuit with two ClockVoltage sources (digital oscillators). The first one goes directly to an LED, the second one is fed through 6 hex inverters to delay the circuit. There are 3 ‘tap’ points after every two inverters connected to a (virtual) oscilliscope.

With ‘real simulation’ settings, the ‘tapped’ points show no delay on the oscilliscope. With ‘ideal’ settings chosen, the ‘tapped’ points display just a flat waveform.

Here are pics :

http://putfile.com/pic.php?pic=main/7/19515405569.jpg&s=f10
http://putfile.com/pic.php?pic=main/7/19515272134.jpg&s=f10

I also set up the same circuit in MicroCap.

With MicroCap I can get it to work with the “Probe Transient” menu, but not with the ‘Transient’ Window’.

http://putfile.com/pic.php?pic=main/7/19516302012.jpg&s=f10

I’d prefer to get it working with MultiSim, as there are more components available.

Mike

Wow, yet another piece of awsome software discovered Multisim 9. Thanks mstram.

Im not all that sure about this, since I never used the software, but are you sure that this isn’t exactly whats supposed to happen?

I mean considering that one setting makes more calculations and takes more things into account, one would figure that it would present some information in situations where the “less advanced” setting would present none.

I’m not sure though.

I’ve just edited my original post to include a screen grab from MicroCap, which shows the expected results.

I’m no electronics expert, but there should be a delay with a signal when passed through an electronic component. Even when I zoom in with the oscilloscope, no delays are shown.

Mike

Your problem may have to deal with scale.

From looking at a datasheet for 7404 inverter, I can see that the average delay time from switch A to Y is somewhere between 5 to 10 nanoseconds at optimal conditions. 1 ns is .001 us and 10ns is .010 us. So if you look in the microcap display, the delay probably is correct because you are seeing 1 microsecond divided into 5 chunks. However, your resolution is not that fine in multisim. Try increasing the resolution in the multisim. So with six inverters, the delay is really on going to be about .06 microseconds, which looks about right based off of the microcap display.

Forte,

Thanks for the suggestion, I tried zooming in on the scope in Multisim, changing the timebase to 100ns/div, but it still doesn’t work. I looked around in the simuation settings for something to do with resolution / time bases, etc but haven’t found anything yet.

http://putfile.com/pic.php?pic=main/7/19517383792.jpg&s=f10

Since you know what a ‘datasheet’ is :), is this your profession? / hobby?

Do you use any other simulation software?

I’d use MicroCap, but both of these are eval versions for now, and MS has some PIC micro chips in it that I’d like to play with, though I don’t know how well they are emulated.

The documenation is really pretty poor in MS and their support is only for customers with a support contract

They also have some eprom chip models, but there are no pins for power or Vpp, so I’m not sure how they are “programmed” in the simulator.

I’ll go look around on Sourceforge or other sources for open source sims

Mike

Electronics has been a long standing hobby of mine starting about 8 years ago, but really getting into it more and more recently. I mainly tend to do lots of robotics stuff, as I see that as the ultimate marriage of computers and electronics, but I also like doing other things (been looking into building a midi controller or theremin recently). I may one day go for it as a profession, when I get bored, but I’m happy where I am now.

Generally I haven’t really used that much simulation software. Much of what I try to do, I like to do by hand. I will generally design a circuit by hand, build it, and then if it behaves unexpectedly see where I went wrong. It can be a tedious and sometimes expensive process (sometimes marked by the blue smoke of doom), but it gives me some ways of stretching my brain and keeping just those basic ohm’s and kirchoff’s rules beaten into my head.

I know a lot circuit sim software is based off of the spice project (including both of the ones your have). I haven’t tried it extensively, but this software seems to be decent.

I know Pic is a very popular uC, but I generally go for AVRs in my projects, a lot because AVRs have a pretty dedicated and helpful community behind them, and lots of documentation.

Edit: Forgot to mention, that in the past I have on occasion used Google EE Group if I have a problem. The only thing is that it is just that, a google group, not really a very community atmosphere, but you do receive helpful response sooner or later. Also there is Google Electronics Group.

Thanks for the links to the software and the discussion groups.

I’ll check out the AVR stuff too.

I understand digital a little better than analog stuff, where I quickly get lost in the basics :slight_smile:

Mike

been looking into building a midi controller or theremin recently).

Thats cool, I have worked on stuff like that, but eventually opted for a kit for a theremin (and a midi2cv thing). There’s also a cv2midi kit but you probably know how to do that from scratch?

I’m a little confused by what you’re trying to do here. I work with PIC microcontrollers and ICSP for a living, and they’re really very easy to use. You can start PIC programming immediately by downloading the free MPLab software from the Microchip website. The board layout for the PIC is very simple and I suggest you just breadboard it, don’t bother with simulation software at all. You can try building a PC-to-ICSP interface yourself, although the circuit you’ve simulated so far doesn’t come anywhere close. I’ve never seen a PC-to-ICSP interface that doesn’t itself use a PIC, so if you’re trying to do this to program your first PIC then you’re stuffed. A much better choice would be to buy an ICD2 In-Circuit Programmer/Debugger from Microchip. Make sure you build an HE14 header onto your PIC breadboard, then just plug the ICD2 into it and voila! :slight_smile: You will need a 2V-5V power supply, depending on what PIC you’re using.

Seriously don’t bother simulating the PIC on a circuit simulator like Multisim, it’s much easier and faster to breadboard it.

Keith. :cool:

Hi Keith,

Anything is easy, once you know how to do it :slight_smile:

Thanks, I have the Mplab software.

This was more a MultiSim question than anything Pic related, as I was just
trying to simualate a very simple signal delay circuit, as part of a larger
circuit, in aid of understanding the ICSP protocol.

Someone pointed out to me on another forum that I had an open circuit, as the virtual wiring was not really connected at one point, so that was the problem :slight_smile:

Well I’m not actually trying to do anything useful with the PIC, not yet
anyway :slight_smile: Playing with the simulation software is another diversion in itself :slight_smile:

Hmm, do you mean “a PIC” to program “the PIC” ? If so, I don’t understand. Maybe it’s just terminology, or (probably) I’m totally confused about the difference between ICSP and programming via a parallel port circuit or other programmer. I understood ICSP (the “IC”) part anyway, to mean “in circuit”, but I thought the SP (serial programming) was the same regardless of whether the PIC was in a completed circuit or just sitting in a programmer.

Does it cost more than $20 ? :slight_smile:

*edit Cough … “only” $159.00 U.S (~200.00 Cad), a bit out of my hobby budget

The DV164101 kit looks a bit more reasonable at ~40.00 CAD. I presume the PIC is wired into the board (PIC12F675) and you lose the flexibility of the ICD2 being able to program different devices.

Maybe for you :slight_smile: At this point it’s a toss up at my level of skill and knowledge :slight_smile:

Actually I do have a Basic Stamp kit, when I want to do anything semi-useful. It doesn’t let you program with assembly though.

But I also enjoy tinkering around in “the basement” with assembly code, etc :slight_smile:

Half the fun is trying to get something to work :), I might attempt to build a par-port interface. Actually I have the Myke Predko book “Programming and Customizing MicroControllers”, which included the “El Cheapo” circuit board for his programmer, but I messed it up trying to build it. Tried to substitute a part (dumb).

Mike

Ofcourse you should have fun and do whatever you feel suits you the most. :slight_smile:

In-circuit serial programming allows you to program the PIC while it is on the target board, that is, while it is on the board that it will actually be used on. With ICSP you don’t need to remove the PIC and place it in a programmer. The only requirement is that you connect 2 pins (usually RB6 and RB7) to a connector (usually HE14 type) on the target board. A seperate interface board is then plugged in to the HE14 header and acts as the interface between the PC and the PIC. This interface board usually connects to the PC through either the serial port or a USB port, and a seperate PIC on the interface board is used to manage the USB-to-ICSP interface. So yes, a PIC is used to program the PIC.

LOL! :o I’ve always had an ICD2 at hand so I never bothered to find out how much they cost. There are plenty of other hobbyist boards around that should do exactly the same thing. You want to find one that has a serial port interface, and programs a PIC through ICSP on a seperate board via a connector. Alternatively, there are plenty of evaluation boards that provide ICSP service, as well as useful gadgets to play with, such as 7 segment displays, LED banks, etc. That would probably be more suitable for a hobbyist who just wants to play with the PIC to see what it can do.

Have fun! :slight_smile: