Readadc from alternate power rail

huw2m9

New Member
Hello All, I've a pretty basic problem with simulating inputs to a PICAXE where the power rail of the input voltage is not the same as the PICAXE.

I want to sense the Aux line voltage in a car. I'll use a 7805 to power the PICAXE and a resistor divider to cut down the nominal 12V Aux line to a safe value for the adc input on P2 (pin 5) see attached design and listing.

The problem I'm having is that simulation of readadc is always "0" when not using the default power rail.

I use a +12V power terminal to represent the car battery.
If I remove the "+12V" string in the "Edit Terminal Label" dialogue the simulation shows a value for the readadc, as I assume the power terminal defaults to the standard 5 volts commoned with the PICAXE chip's V+.

I've tried defining a new +12V Power Rail Configuration (using the associated dialogue) but this power rail doesn't appear in the drop down list for the 12V power terminal.

How does one simulate an input voltage sourced from other than the default 5V power rail associated with a PICAXE?

Thanks in advance,
Neville
 

Attachments

Technical

Technical Support
Staff member
Your issue is that you have used a 12V power terminal without a 5V power terminal. This causes rail confusion under SPICE.

Simply right click on the design, Place>Terminal>Power and drop the terminal anywhere on the design. It does need to be conected to anything, it just acts as a power rail reference for the simulation.
 

Jimtemp

New Member
Thankyou Technical that's solved it.
Your design shows the 12volt supply but I cant see how the picaxe is powered.
I would like to simulate the picaxe being powered by 4.5 volts but keeping the 12volt supply for a relay. How would you do that in your design? Is using a Battery supply (rather than a power terminal) the only way?
I find the help on this (Power Rail Configuration dialogue form) a little confusing and have ended up using 2 Battery supplies instead of VCC and VEE power terminals.
 

Jimtemp

New Member
No Need to reply. Trial and error got a result. Had to play around a bit using a common ground and 2 identicle resistors with a volt probe in the centre (so I could see 2.5 volts).
I connected another 2 resistors and tied one end to ground.
Went to the top menu bar Design _ Configure Power Rails and selected NEW. Called the new PS "+12" and entered "12" in the Voltage field. (OK). Returned to sheet, right-clicked, Place _ Terminal_POWER and dropped it over the 2 extra resistors & named it "+12". Connected it and ran the simulation and observed the voltage probe = 6volts.

Regards, Jim
 
Last edited:
Top