Searching \ for '[PIC]: Comparison code generator?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Comparison code generator?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Comparison code generator?'
2006\06\09@152224 by Philip Pemberton

face picon face
Hi,
  I've been doing a lot of meddling with 16-bit numbers as part of my battery
charger project. I seem to recall that a number of years ago, I had a copy of
a program that took an expression (along the lines of "x < 5") and generated
the code to perform that comparison. ISTR it also had support for 8- and
16-bit comparisons.

  Does anyone else remember seeing something like this?

Thanks.
--
Phil.                         | Kitsune: Acorn RiscPC SA202 64M+6G ViewFinder
spam_OUTphilpemTakeThisOuTspamdsl.pipex.com         | Cheetah: Athlon64 3200+ A8VDeluxeV2 512M+100G
http://www.philpem.me.uk/     | Tiger: Toshiba SatPro4600 Celeron700 256M+40G

2006\06\09@155611 by James Newton, Host

face picon face
> Hi,
>    I've been doing a lot of meddling with 16-bit numbers as
> part of my battery charger project. I seem to recall that a
> number of years ago, I had a copy of a program that took an
> expression (along the lines of "x < 5") and generated the
> code to perform that comparison. ISTR it also had support for
> 8- and 16-bit comparisons.

http://www.markworld.com/microtools.html does math but not comparisons.

http://www.sxlist.com/techref/expeval2.asp does everything, but doesn't
really do it. Just helps you do it yourself. Oh, and it uses Parallax
mnemonics not PIC.

http://www.piclist.com/techref/microchip/compcon.htm has all the code
snippets you could want.

http://www.piclist.com/techref/microchip/codeflow.htm has more general
information

http://www.seanet.com/~karllunt/picmacro.htm has macros that implement high
level conditional statements in MPASM but I don't believe it does 16 bit
stuff.

And I'm interested in anything else that is found...

---
James Newton: PICList webmaster/Admin
.....jamesnewtonKILLspamspam@spam@piclist.com  1-619-652-0593 phone
http://www.piclist.com/member/JMN-EFP-786
PIC/PICList FAQ: http://www.piclist.com




2006\06\09@155749 by Dave Wheeler

flavicon
face
Hi Philip,

One that sounds like that was done by Tony Nixon and I think it was
called asmhelp or helpasm
I might have it in an old archive if Google does not help

Cheers,
Dave


Philip Pemberton wrote:
{Quote hidden}

2006\06\09@161939 by Philip Pemberton

face picon face
Dave Wheeler wrote:
> One that sounds like that was done by Tony Nixon and I think it was
> called asmhelp or helpasm
> I might have it in an old archive if Google does not help

That rings a few bells! I take it you mean the Tony Nixon who ran
bubblesoftonline.com? Unfortunately it seems everything he worked on has
disappeared into a black hole :(

If you can have a quick look in the archive, I'd really appreciate it.

Thanks.
--
Phil.                         | Kitsune: Acorn RiscPC SA202 64M+6G ViewFinder
philpemspamKILLspamdsl.pipex.com         | Cheetah: Athlon64 3200+ A8VDeluxeV2 512M+100G
http://www.philpem.me.uk/     | Tiger: Toshiba SatPro4600 Celeron700 256M+40G

2006\06\09@165256 by Dave Wheeler

flavicon
face
Philip Pemberton wrote:
> Dave Wheeler wrote:
>  
>> One that sounds like that was done by Tony Nixon and I think it was
>> called asmhelp or helpasm
>> I might have it in an old archive if Google does not help
>>    
>
> That rings a few bells! I take it you mean the Tony Nixon who ran
> bubblesoftonline.com? Unfortunately it seems everything he worked on has
> disappeared into a black hole :(
>
> If you can have a quick look in the archive, I'd really appreciate it.
>
> Thanks.
>  
Hi Philip,

PM sent to your pipex account
Dave

2006\06\09@173940 by Bob Axtell

face picon face
Philip Pemberton wrote:
> Dave Wheeler wrote:
>  
>> One that sounds like that was done by Tony Nixon and I think it was
>> called asmhelp or helpasm
>> I might have it in an old archive if Google does not help
>>    
>
> That rings a few bells! I take it you mean the Tony Nixon who ran
> bubblesoftonline.com? Unfortunately it seems everything he worked on has
> disappeared into a black hole :(
>
> If you can have a quick look in the archive, I'd really appreciate it.
>
> Thanks.
>  
Tony threw out his computer and everything engineering. He now gives
flying lessons.

I think he's doing better than we are.

--Bob

2006\06\09@184731 by David VanHorn

picon face
>
> Tony threw out his computer and everything engineering. He now gives
> flying lessons.


Wow.  What happened?

2006\06\09@185620 by Philip Pemberton

face picon face
Bob Axtell wrote:
> Tony threw out his computer and everything engineering. He now gives
> flying lessons.

Yeah, I think I heard about that.. Shame nobody archived his site beforehand
though - some of the stuff on there was pretty useful (like the comparison
code generator).

> I think he's doing better than we are.

Probably...

I've nearly got the battery charger going though - it's regulating current
(badly), and the MOSFET driver works. Learned a few lessons too:
  1) P-channel MOSFETs switch on when Vgs is negative. That means if Vs is at
+5V, Vg needs to be grounded (assuming Vgs(th) <= 5V).
  2) Check your MOSFET driver carefully - look at each bit separately and
figure out what's going to happen when it gets a high input, then do the same
for a low input. I managed to build a driver that switched on when Vin was
low. The PIC realised Vout was going way too high, reduced the PWM time to
zero, and ended up locking the MOSFET on instead. Oops. At least it didn't let
out the magic smoke, but it did burn the solder flux residue a little...
  3) Hooking up power to the opamp is a very good idea too. I spent 40
minutes trying to figure out why Vout was stuck at 0V, then noticed the opamp
was plugged into the "V4" bus line, and that there was no link between "V3"
(SMPS supply voltage) and "V4"...
  4) Cheap breadboards are very good at developing loose connections.
  5) I need to get some decent single- and double-cell battery holders.

What fun!

I'm going to hook up a 20MHz crystal in a bit and see if I can get it to
update a bit faster. I might also try rewriting the code to do PSM instead of
PWM and see if that makes it work any better.

And I need to try and figure out what part of the SMPS driver is eating nearly
200mA, even when the PWM output is off (=0V)...

A break sounds real good about now.

--
Phil.                         | Kitsune: Acorn RiscPC SA202 64M+6G ViewFinder
.....philpemKILLspamspam.....dsl.pipex.com         | Cheetah: Athlon64 3200+ A8VDeluxeV2 512M+100G
http://www.philpem.me.uk/     | Tiger: Toshiba SatPro4600 Celeron700 256M+40G

2006\06\09@203452 by David P Harris

picon face
Philip Pemberton wrote:

>Bob Axtell wrote:
>  
>
>>Tony threw out his computer and everything engineering. He now gives
>>flying lessons.
>>    
>>
>
>Yeah, I think I heard about that.. Shame nobody archived his site beforehand
>though - some of the stuff on there was pretty useful (like the comparison
>code generator).
>  
>
Yes, I did not believe he would give it all up -- we can only hope he
misses us all!

I may have some of his site somewhere..... I will look.

David



2006\06\09@204332 by David VanHorn

picon face
>   2) Check your MOSFET driver carefully - look at each bit separately and
> figure out what's going to happen when it gets a high input, then do the
> same
> for a low input.


Also when the proc is in reset, or being programmed!


I managed to build a driver that switched on when Vin was
> low. The PIC realised Vout was going way too high, reduced the PWM time to
> zero, and ended up locking the MOSFET on instead. Oops. At least it didn't
> let
> out the magic smoke, but it did burn the solder flux residue a little...


Ain't it fun? :)

 3) Hooking up power to the opamp is a very good idea too. I spent 40
> minutes trying to figure out why Vout was stuck at 0V, then noticed the
> opamp
> was plugged into the "V4" bus line, and that there was no link between
> "V3"
> (SMPS supply voltage) and "V4"...
>   4) Cheap breadboards are very good at developing loose connections.


Definitely. I'd proto the power part on some PCB material, and fly-wire it.

 5) I need to get some decent single- and double-cell battery holders.


Tough. Especially with 1C sorts of charge rates.

What fun!
>
> I'm going to hook up a 20MHz crystal in a bit and see if I can get it to
> update a bit faster. I might also try rewriting the code to do PSM instead
> of
> PWM and see if that makes it work any better.


PSM?  As in pulse skipping?

Beware of the bifurcation.


And I need to try and figure out what part of the SMPS driver is eating
> nearly
> 200mA, even when the PWM output is off (=0V)...


Hmm.. That's not right.

2006\06\12@043002 by Alan B. Pearce

face picon face
>   I've been doing a lot of meddling with 16-bit numbers as
>part of my battery charger project. I seem to recall that a
>number of years ago, I had a copy of a program that took an
>expression (along the lines of "x < 5") and generated the
>code to perform that comparison. ISTR it also had support
>for 8- and 16-bit comparisons.

As an addition to the other answers received, have a look at the macros Olin
has in his development environment.

2006\06\12@043226 by Alan B. Pearce

face picon face
>4) Cheap breadboards are very good at developing loose connections.

<vbg> Now you see why people go to the extent of drawing up a PCB, and
getting a one off made ...

2006\06\12@050551 by Ravi Pailoor

flavicon
face
It is "helpasm" from Tony Nixon. James has it in his archive.

Cheers

Ravi

Dave Wheeler wrote:
{Quote hidden}

--
Best wishes and regards

Ravi Pailoor
Managing Director

C.C. Ms. Miriam, Director, e-CHIP INFOTEK (P) LTD.

e-CHIP INFOTEK (P) LTD.
Member - Microchip Consultant Program
GOLD LEVEL
Microchip Design House - http://www.microchip.com
Web : http://www.echip.co.in
No. 60/1, 2nd Floor, Above ICICI ATM,
Opp. St. Pius Church,
Kammanahalli Main Road,
Bangalore-560 084.
INDIA

Email : EraseMEechipspam_OUTspamTakeThisOuTvsnl.net
BSNL : +91-80-25446315

This e-mail and any attachment may contain confidential and privileged
material intended for the addressee only. If you are not the addressee,
you are notified that no part of the e-mail or any attachment may be
disclosed, copied or distributed, and that any other action related to
this e-mail or attachment is strictly prohibited, and may be unlawful.

If you have received this e-mail by error, please notify the sender
immediately by return e-mail, and delete this message. e-CHIP, its
subsidiaries and/or its employees shall not be liable for the
incorrect or incomplete transmission of this e-mail or any attachments,
nor responsible for any delay in receipt.

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...