PDA

View Full Version : Permanent sleep



Russ Kincaid
- 19th January 2006, 02:57
This is my first PIC project. I am using PBC with a 16F627A. Sleep is defined for periods from 1 to 65535, but what happens if I use SLEEP 0? I want the PIC to go into low power mode until power is cycled off and on. If I let the program go to END, is that equivalent to sleep?

mister_e
- 19th January 2006, 03:07
no, and it will be in low current consumption.

BTW, who'll know that if you set the SLEEP to it's maximum and do a loop... few usec in hours in not low consumption...


GoodNight:
SLEEP 65535
goto GoodNight

Melanie
- 19th January 2006, 09:21
Permanent Sleep eh?.... Well apart from a Sledge Hammer... try...

@ SLEEP

The PIC will sleep PERMANENTLY until woken by an interrupt event... this does not mean you have to embed Assembler interrupts or the like, execution of the program 'should' continue from the next instruction when the PIC is woken from it's slumber.

For example this snippet of code shows (for a 16F628) what Registers you need to set in order to trigger a wake event...



'
' PIC Low-Power Sleep Routine
' ---------------------------
'
' Set Sleep Interrupts
' --------------------
INTCON=%00011000 ' Interrupt Control Register
' 7=0 - GIE - Global Interrupt Enable
' 6=0 - PEIE - Peripheral Interrupt Enable
' 5=0 - TOIE - TMR0 Overflow Interrupt Enable
' 4=1 - INTE - RB0/INT Enable
' 3=1 - RBIE - PORTB change interrupt Enable
' 2=0 - TOIF - TMR0 Overflow Flag
' 1-0 - INTF - RB0/Ext Interrupt Flag
' 0=0 - RBIF - PORTB Interrupt Flag
OPTION_REG.6=1 ' 1=RB0 Rising-Edge Trigger, 0=Falling-Edge Trigger
'
' Reset Interrupt Flags
' ---------------------
INTCON.1=0 ' Reset RB0 Flag
INTCON.0=0 ' Reset PORTB change Flag
'
' Sleep
' -----
@ SLEEP
Pause 100 ' Needed for system Wake-Up

You can see that I'm setting a wake-up call using either RB0 or PortB inputs. The Pause can be omitted, but works for me, so that the PIC can have a stretch, yawn, light-up a cigarette etc...

charudatt
- 12th May 2007, 13:41
Hello Mel,

I am trying to get this sleep comand to work and it simply does not work.

my code:
@ DEVICE PIC16F628A, INTRC_OSC_NOCLKOUT, WDT_OFF, LVP_OFF, PWRT_OFF, PROTECT_OFF, BOD_OFF
CMCON=7
VRCON=%01101100 'VRCON bit7 is OFF for no current drain
OPTION_REG.7 = 0 ' ENABLE INTERNAL PULLUPS
Trisa = %01111111
Trisb = %11111111
LED VAR PORTA.7

'
' PIC Low-Power Sleep Routine
' ---------------------------
'
' Set Sleep Interrupts
' --------------------
INTCON=%00011000 ' Interrupt Control Register
' 7=0 - GIE - Global Interrupt Enable
' 6=0 - PEIE - Peripheral Interrupt Enable
' 5=0 - TOIE - TMR0 Overflow Interrupt Enable
' 4=1 - INTE - RB0/INT Enable
' 3=1 - RBIE - PORTB change interrupt Enable
' 2=0 - TOIF - TMR0 Overflow Flag
' 1-0 - INTF - RB0/Ext Interrupt Flag
' 0=0 - RBIF - PORTB Interrupt Flag
OPTION_REG.6=1 ' 1=RB0 Rising-Edge Trigger, 0=Falling-Edge Trigger

CYCLE:
'
' Reset Interrupt Flags
' ---------------------
INTCON.1=0 ' Reset RB0 Flag
INTCON.0=0 ' Reset PORTB change Flag
'
' Sleep
' -----
LOW LED
@ SLEEP
@ nop
@ nop
@ nop
@ nop

Pause 100 ' Needed for system Wake-Up
HIGH LED : PAUSE 200 : LOW LED
GOTO CYCLE

Maybe I could be missing some thing. The LED just keeps blinking.

Basically I am trying to incorporate this in a garage code lock project.

any help ?

Acetronics2
- 12th May 2007, 14:31
' Set Sleep Interrupts
' --------------------
INTCON=%00011000 ' Interrupt Control Register
' 7=0 - GIE - Global Interrupt Enable
' 6=0 - PEIE - Peripheral Interrupt Enable
' 5=0 - TOIE - TMR0 Overflow Interrupt Enable
' 4=1 - INTE - RB0/INT Enable
' 3=1 - RBIE - PORTB change interrupt Enable
' 2=0 - TOIF - TMR0 Overflow Flag
' 1-0 - INTF - RB0/Ext Interrupt Flag
' 0=0 - RBIF - PORTB Interrupt Flag
OPTION_REG.6=1 ' 1=RB0 Rising-Edge Trigger, 0=Falling-Edge Trigger

?



Hi, Charudatt

May be you could simply enable the interrupts before sleeping ... might work better.

Yess GIE = 1 ... ( INTCON.7 = 1 )



oh, oh ... you are still asleep ???

Alain

Melanie
- 12th May 2007, 14:36
You are obviously being woken from Sleep, so find out what is causing it...

...and ground all the INPUT pins on PortB in case one is floating.

Acetronics2
- 12th May 2007, 15:11
Heuuu

No GIE = No Sleep ( RTFDatasheet ... $ 14.8.1 - Greyed Note ), so we set GIE Bit

Then ... Executes the 1St NOP

Then ... Branches to location 0004 ...

But there is a supposed Interrupt stubb here instead of falling into the "program" ...

a single " DEFINE INTHAND INIT " without any interrupt stubb ( LOL ! ) would push the libs away from the 4 first program locations ... and allow restarting the PIC as a first power up ...

We could also Branch to the "Pause 100" ... to have some visual effect before re-entering sleep ... ( wich is better ...I think)

Sooo ...

we add :

DEFINE INTHAND _BLINK ' near top of program

and

BLINK:

Before

Pause 100 ' Needed for system Wake-Up
HIGH LED : PAUSE 200 : LOW LED
GOTO CYCLE




I am right, Mel ???

Alain

PS: We are aboard PBC list ... what about interrupts in PBC ???

T.Jackson
- 12th May 2007, 15:33
"Super Acetronics" - I think he might be right. He should change his name to Supertronics :)

Acetronics2
- 12th May 2007, 15:37
Hehe, Trend ...

You did not know about the Underscored Inthand name ... I presume.

Permits LOTS of good things, especially if context must not be saved ( what is lots of encountered situations ...).

Also REALLY Instant Basic Pseudo-Interrupts !!! ( The return adress MUST be explicitly given )

Alain

Ron Marcus
- 12th May 2007, 16:16
Heuuu

No GIE = No Sleep ( RTFDatasheet ... $ 14.8.1 - Greyed Note ), so we set GIE Bit

Then ... Executes the 1St NOP

Then ... Branches to location 0004 ...

But there is a supposed Interrupt stubb here instead of falling into the "program" ...

a single " DEFINE INTHAND INIT " without any interrupt stubb ( LOL ! ) would push the libs away from the 4 first program locations ... and allow restarting the PIC as a first power up ...

We could also Branch to the "Pause 100" ... to have some visual effect before re-entering sleep ... ( wich is better ...I think)

Sooo ...

we add :

DEFINE INTHAND _BLINK ' near top of program

and

BLINK:

Before

Pause 100 ' Needed for system Wake-Up
HIGH LED : PAUSE 200 : LOW LED
GOTO CYCLE




I am right, Mel ???

Alain

I am using the '690. In that FM, the processor will still wake from sleep if the flag is set without the GIE set. With the GIE set you have to service the interrupt. Without, it starts up right after the sleep command.

Ron

Acetronics2
- 12th May 2007, 17:02
Hi Ron,

You're perfectly right with the '690 ... but, care ... GIE settings do not have the same effects for the '628 ... and GIE *must* be set to enter sleep ( sleep ignored if GIE = 0 ) .

Alain

charudatt
- 12th May 2007, 17:23
Hello Ron and Other,

I did not understand the Int_handler part. You mean to say , declare a Int_handler without a lable and make the pic reset.

Well setting GIE made it to go to sleep (LED not blinking but current 6mA) but did not come out of it.

any further help?

regards

Ron Marcus
- 12th May 2007, 17:58
Hi Ron,

You're perfectly right with the '690 ... but, care ... GIE settings do not have the same effects for the '628 ... and GIE *must* be set to enter sleep ( sleep ignored if GIE = 0 ) .

Alain

I did check the '628 book and you are correct sir! I reread it twice to catch it.
Ron

savnik
- 12th May 2007, 18:55
Hello Mel,

I am trying to get this sleep comand to work and it simply does not work.

my code:
@ DEVICE PIC16F628A, INTRC_OSC_NOCLKOUT, WDT_OFF, LVP_OFF, PWRT_OFF, PROTECT_OFF, BOD_OFF
CMCON=7
VRCON=%01101100 'VRCON bit7 is OFF for no current drain
OPTION_REG.7 = 0 ' ENABLE INTERNAL PULLUPS
Trisa = %01111111
Trisb = %11111111
LED VAR PORTA.7

'
' PIC Low-Power Sleep Routine
' ---------------------------
'
' Set Sleep Interrupts
' --------------------
INTCON=%00011000 ' Interrupt Control Register
' 7=0 - GIE - Global Interrupt Enable
' 6=0 - PEIE - Peripheral Interrupt Enable
' 5=0 - TOIE - TMR0 Overflow Interrupt Enable
' 4=1 - INTE - RB0/INT Enable
' 3=1 - RBIE - PORTB change interrupt Enable
' 2=0 - TOIF - TMR0 Overflow Flag
' 1-0 - INTF - RB0/Ext Interrupt Flag
' 0=0 - RBIF - PORTB Interrupt Flag
OPTION_REG.6=1 ' 1=RB0 Rising-Edge Trigger, 0=Falling-Edge Trigger

CYCLE:
'
' Reset Interrupt Flags
' ---------------------
INTCON.1=0 ' Reset RB0 Flag
INTCON.0=0 ' Reset PORTB change Flag
'
' Sleep
' -----
LOW LED
@ SLEEP
@ nop
@ nop
@ nop
@ nop

Pause 100 ' Needed for system Wake-Up
HIGH LED : PAUSE 200 : LOW LED
GOTO CYCLE

Maybe I could be missing some thing. The LED just keeps blinking.

Basically I am trying to incorporate this in a garage code lock project.

any help ?
Change the
OPTION_REG.7 = 0 ' ENABLE INTERNAL PULLUPS
to
OPTION_REG.7 = 1 ' DISABLE INTERNAL PULLUPS

Acetronics2
- 12th May 2007, 19:22
Hi, Charudatt

Do not worry !!! This is certainly one of the least documented feature of PBP ...

DEFINE INTHAND _INTER ...

1) keeps prog mem locations 2 and 3 free ...

2) places a GOTO _INTER at location 4 ... or a bit further if more than 1 program page ...and COULD need context saving.
_INTER ( Note the Leading Underscore ) is the PBP "INTER:" Label readable by Assembler ...

Consider it as a "classical" GOTO ... but you reach it when an "interrupt reason" occurs ... no latency then.

INIT (Without Underscore !!! ) is the first ASSEMBLER line your Program really executes at power ON ...

So, as is ... you can i.e. restart your PIC, ... without using MCLR - if not disposable !!!
... or goto the label you want !!!

Alain

Ron Marcus
- 12th May 2007, 19:25
Allain,
I was right. Clearing GIE does work as it does on the '690. It will wake and continue without needing an interrupt handler.

Ron

mister_e
- 12th May 2007, 19:33
<table><td>Vermont : 1
France : 0</td><td>http://www.mister-e.org/Pics/FootballHeadKick.gif</td></table>

Acetronics2
- 12th May 2007, 20:55
Allain,
I was right. Clearing GIE does work as it does on the '690. It will wake and continue without needing an interrupt handler.

Ron

What about ENTERING sleep ??? 628A datasheet clearly says IF GIE = 0 , the SLEEP command is treated as a NOP ...

I'm a bit confused here ... or I do not have the latest datasheet !!!

Alain

Ron Marcus
- 12th May 2007, 21:32
The little window says if GIE is 0 and both the flag bit and enable bit are set, it will treat the sleep command as a nop. If the flag bit is cleared, it will sleep. It IS confusingly written!

charudatt
- 13th May 2007, 11:17
ALAIN,

It still does not work,

"DEFINE INTHAND INIT" , maybe puts it to sleep and never comes out.
and "DEFINE INTHAND _BLINK" keeps the led blinking.

regards

Acetronics2
- 13th May 2007, 11:27
Hi, RON

Ok, Thanks for the explanation ...

It really might be written instead of BUT ... : AND any interrupt ... !!!

So, appears no real need to set the GIE bit here ...


Back to Charudatt's program ...


mighn't there be a PORTB reading ... ( to end the "mismatch condition" ) ???.

Alain

Charudatt :

1) DEFINE ...INIT ... the result is quite normal !!! Pic wakes up to fall asleep ...

2) if the led keeps blinking means ... the program always stay in the interrupt stubb !!! We've traced it now.

in this case ... interrupt flags are not cleared ... : good reason, no ?

Acetronics2
- 13th May 2007, 15:02
Hi, Charudatt

Straight from my test bench :


@ __CONFIG _INTOSC_OSC_NOCLKOUT & _WDT_OFF & _LVP_OFF & _PWRTE_OFF & _CP_OFF & _BODEN_OFF

DEFINE NO_CLRWDT 1
DEFINE LCD_EBIT 1

CMCON=7
VRCON=%01101100 'VRCON bit7 is OFF for no current drain
OPTION_REG.7 = 1 ' DISABLE INTERNAL PULLUPS
Porta = 0
PORTB = 0
Trisa = %11111111
Trisb = %01111111

LED VAR PORTB.5
SleepLed var PORTB.7
Dummy var byte

'
' PIC Low-Power Sleep Routine
' ---------------------------
'
' Set Sleep Interrupts
' --------------------
INTCON=%00010000 ' Interrupt Control Register
' 7=0 - GIE - Global Interrupt Enable
' 6=0 - PEIE - Peripheral Interrupt Enable
' 5=0 - TOIE - TMR0 Overflow Interrupt Enable
' 4=1 - INTE - RB0/INT Enable
' 3=0 - RBIE - PORTB change interrupt Enable
' 2=0 - TOIF - TMR0 Overflow Flag
' 1-0 - INTF - RB0/Ext Interrupt Flag
' 0=0 - RBIF - PORTB Interrupt Flag
OPTION_REG.6=1 ' 1=RB0 Rising-Edge Trigger, 0=Falling-Edge Trigger

PAUSE 500
LCDOUT $FE,1
CYCLE:
'
' Reset Interrupt Flags
' ---------------------
INTCON.1=0 ' Reset RB0 Flag
INTCON.0=0 ' Reset PORTB change Flag
'
' Sleep
' -----
LOW LED


LCDOUT $FE,2 , "*** SLEEPING ***"
High Sleepled

@ SLEEP

Dummy = PORTB
LOW SleepLed
@ nop
@ nop
@ nop

Pause 100 ' Needed for system Wake-Up
HIGH LED : PAUSE 200

LCDOUT $FE,1, " HURRY UP "

PAUSE 5000
LOW LED

GOTO CYCLE

END

CONFIG Modified to suit MPLAB Requirements ...

I used a LCD to show what happening and fixed LEDs for Wake (green) /Sleep ( Red ) states ...

disabled CLRWDT PbP insertions ... ( a passing idea ??? )

also disabled the WPU ... but that is not problematic.

also changed LEDs PORTs ...

As PORTB was used ... I did not try "Interrupt change on PortB" ... but works great with B.0 interrupt.

Works fine ... as you intended to program it !!!

Regards

Alain

charudatt
- 13th May 2007, 18:13
I'll give it a shot tomorrow and post my feedback.

regards

p.s. Today after the failed experiments, i am planning the same thing on 16F73. Lets hope it works. I shall post my feedback on both tomorrow.

Acetronics2
- 13th May 2007, 18:57
Hi, Charudatt



@ __CONFIG _INTOSC_OSC_NOCLKOUT & _WDT_OFF & _LVP_OFF & _PWRTE_OFF & _CP_OFF & _BODEN_OFF

DEFINE NO_CLRWDT 1

CMCON=7
VRCON=%01101100 'VRCON bit7 is OFF for no current drain
OPTION_REG.7 = 0 ' ENABLE INTERNAL PULLUPS
Porta = 0
PORTB = %11110001
Trisa = %11110011
Trisb = %01111111

LED VAR PORTA.2
SleepLed var PORTA.3
Dummy var byte

'
' PIC Low-Power Sleep Routine
' ---------------------------
'
' Set Sleep Interrupts
' --------------------
INTCON=%00011000 ' Interrupt Control Register
' 7=0 - GIE - Global Interrupt Enable
' 6=0 - PEIE - Peripheral Interrupt Enable
' 5=0 - TOIE - TMR0 Overflow Interrupt Enable
' 4=1 - INTE - RB0/INT Enable
' 3=1 - RBIE - PORTB change interrupt Enable
' 2=0 - TOIF - TMR0 Overflow Flag
' 1-0 - INTF - RB0/Ext Interrupt Flag
' 0=0 - RBIF - PORTB Interrupt Flag

OPTION_REG.6=0 ' 1=RB0 Rising-Edge Trigger, 0=Falling-Edge Trigger

CYCLE:
'
' Reset Interrupt Flags
' ---------------------
INTCON.1=0 ' Reset RB0 Flag
INTCON.0=0 ' Reset PORTB change Flag
'
' Sleep
' -----
LOW LED

High Sleepled

@ SLEEP
@ nop

Dummy = PORTB
LOW SleepLed
@ nop
@ nop
@ nop

Pause 100 ' Needed for system Wake-Up

HIGH LED

While ( PORTB >> 4 ) <> %00001111 ' Wait Key release
Wend ' AND a PORTB Reading ...!!!

PAUSE 200

PAUSE 5000
LOW LED

GOTO CYCLE

END


Here it is with PORTB interrupts ... ( Note I modified all inputs to be active LOW ...)

I think the origin of the problem is you forgot to read PORTB for the end of the mismatch condition ... wich Also locks the flag cancelling ( a RTFDatasheet for me ... )

Heuuuuu, CHILLED, the beer, please !!!

Alain

PS : The interrupt way also works well ... if you're intersted in, I'll post it.

Melanie
- 13th May 2007, 21:20
The original program example I posted way back during another life is valid for the non-A version of the 16F62X. In the non-A version you get a wake from sleep regardless of the state of the GIE bit. However, the operation of the GIE bit differs in the A version in that respect and Alain is correct. It teaches us all a lesson here that some of the changes between PIC versions are seriously subtle! So it's read the Datasheet - thoroughly!

mackrackit
- 13th May 2007, 21:37
So it's read the Datasheet - thoroughly!

Not another RTFD?!?! :D

charudatt
- 13th May 2007, 21:55
Alain

PS : The interrupt way also works well ... if you're intersted in, I'll post it.[/QUOTE]

Thank you very much, I am just dying to test it out.

Yes Chilled beer for sure.

Post the Interrupt way code, if you can, Thank you once again.

regards

Ron Marcus
- 13th May 2007, 22:10
Hey Mel,
I read the data sheet on the A version. It says on page 111 that the PIC will wake from sleep if both the flag and interrupt bits are set. Will it not wake from sleep if the flag bit is set after initiating sleep? I don't see where it discusses this.

Ron

Melanie
- 13th May 2007, 22:21
I'm talking about the GIE bit here. In the A version, if GIE is not set, the SLEEP (the Assembler instruction) is treated as a NOP and the PIC never enters SLEEP. This didn't work that way in the non-A version. I've a (fortunately) obsolete product that used that feature... otherwise I'd be scratching my head trying to figure why the product didn't work as expected!

Acetronics2
- 14th May 2007, 11:18
Hi, Charudatt

Here it is :





@ __CONFIG _INTOSC_OSC_NOCLKOUT & _WDT_OFF & _LVP_OFF & _PWRTE_OFF & _CP_OFF & _BODEN_OFF

DEFINE NO_CLRWDT 1
DEFINE INTHAND _Blink


CMCON=7
VRCON=%01101100 'VRCON bit7 is OFF for no current drain
OPTION_REG.7 = 0 ' ENABLE INTERNAL PULLUPS
Porta = 0
PORTB = %11110001
Trisa = %11110011
Trisb = %11111111

LED VAR PORTA.2
SleepLed var PORTA.3
Dummy var byte

'
' PIC Low-Power Sleep Routine
' ---------------------------
'
' Set Sleep Interrupts
' --------------------
INTCON=%10011000 ' Interrupt Control Register
' 7=0 - GIE - Global Interrupt Enable
' 6=0 - PEIE - Peripheral Interrupt Enable
' 5=0 - TOIE - TMR0 Overflow Interrupt Enable
' 4=1 - INTE - RB0/INT Enable
' 3=1 - RBIE - PORTB change interrupt Enable
' 2=0 - TOIF - TMR0 Overflow Flag
' 1-0 - INTF - RB0/Ext Interrupt Flag
' 0=0 - RBIF - PORTB Interrupt Flag

OPTION_REG.6 = 0 ' 1=RB0 Rising-Edge Trigger, 0=Falling-Edge Trigger

CYCLE:
'
' Reset Interrupt Flags
' ---------------------

INTCON.1 = 0 ' Reset RB0 Flag
INTCON.0 = 0 ' Reset PORTB change Flag
INTCON.7 = 1
'
' Sleep
' -----
LOW LED

High Sleepled

@ SLEEP
@ nop

Blink:

Dummy = PORTB
Pause 100 ' Needed for system Wake-Up

LOW SleepLed

HIGH LED

While ( PORTB >> 4 ) <> %00001111
Wend

PAUSE 200

PAUSE 5000
LOW LED

GOTO CYCLE

END



As you see it's not so different from the "non interrupted" way ...

But, IF I correctly understand Mel ( one more time, Mel : You're the one and Only ... !!! - no sexual meanings hidden ( LOL) ) , the interrupt way could fit both 628 and 628A ...

I must say I used a 16F628-04 batch N° 0145H9F for tests ( I do not have any 628A ... but will run a try with a brand new 648A.

********************************************
********************************************
A little "bug" in the "non interrupted" listing ... to correct:

TRISB must be % 11111111 ... instead of % 01111111

I was wondering why PortB.7 was inactive .... LOL !!!


Have fun, and read you soon

regards

Alain

Acetronics2
- 14th May 2007, 17:24
Those who really followed this thread have surely noticed there could have been other lines inserted between :

@ SLEEP
@ nop

AND ...

Blink:

didn't you ??? ....

Alain

Pic_User
- 14th May 2007, 20:14
Those who really followed this thread have surely noticed there could have been other lines inserted between :

@ SLEEP
@ nop

AND ...

Blink:

didn't you ??? ....

Alain

Hello Alain,

Do you mean:
@ SLEEP
@ nop
snore
Blink:
turn-over
@ SLEEP

Then again, sometimes I "just don’t quite get it"...
-Adam-

mackrackit
- 14th May 2007, 20:29
Gotta get new glasses.

@nap

Did not work:)

mister_e
- 15th May 2007, 04:10
<body onload="setInterval('blinkIt()',1000)">

<script type="text/javascript">
function blinkIt() {
if (!document.all) return;
else {
for(i=0;i<document.all.tags('blink').length;i++){
s=document.all.tags('blink')[i];
s.style.visibility=(s.style.visibility=='visible') ?'hidden':'visible';
}
}
}
</script>


<blink>@ NOP</blink>

@nap will just define a label
nap without the @, is a PBP function, and it's not the same as ASM

<blink>@ NOP</blink>
;)

charudatt
- 15th May 2007, 08:18
A half hearted compile of your code (Alian) for the 16F873A gave an error with DEFINE INTHAND _Blink.

I changed it to DEFINE INTHAND Blink and it did not come out of sleep (I presume) the same code compiles OK for the 16F628A.

I am sorry , I was busy with some other job, but today I shall try your code for the intended chip and post results.

Thank you for all your help,

regards

Acetronics2
- 15th May 2007, 09:45
Hi, Charudatt

See chapter 9.3 ...

your device ( 16F873 ) has two mem. pages ... 16F628 only has ONE.

What does PbP for ASM Interrupts ???

What do you have to reserve as variables room ???


TWO beers now !!!

Cheers

Alain

Acetronics2
- 15th May 2007, 10:19
Hello Alain,

Do you mean:
@ SLEEP
@ nop
snore
Blink:
turn-over
@ SLEEP

Then again, sometimes I "just don’t quite get it"...
-Adam-

Hi, Adam

Snore never happens ... might be a LABEL to call before !!!

Alain

T.Jackson
- 16th May 2007, 09:28
<body onload="setInterval('blinkIt()',1000)">

<script type="text/javascript">
function blinkIt() {
if (!document.all) return;
else {
for(i=0;i<document.all.tags('blink').length;i++){
s=document.all.tags('blink')[i];
s.style.visibility=(s.style.visibility=='visible') ?'hidden':'visible';
}
}
}
</script>


<blink>@ NOP</blink>

@nap will just define a label
nap without the @, is a PBP function, and it's not the same as ASM

<blink>@ NOP</blink>
;)

C'mon Mister_e, you can do better than that! - show us all some of your "real" java skills, like scrolling some 3D text with user definable parameters.

mister_e
- 16th May 2007, 12:15
euh... sorry i don't have any Java skills... i just copy/paste some script here and there. :(

T.Jackson
- 16th May 2007, 12:42
I'm about to start a Java unit soon - maybe I'll teach you a thing or two ;) Out of interest, I've just found some good code for VB that allows serial comms without MSCOMM.ocx !!! http://www.thescarms.com/VBasic/commio.aspx No probs in XP either.

mister_e
- 16th May 2007, 12:53
it's just too bad that it doesn't allow to open COM port > 15 or 16 :(

T.Jackson
- 16th May 2007, 12:59
:eek: Heh, how many comm ports do you have? I won't be terribly surprised if you tell me a 100 or so since I already know you have 2 monitors.

mister_e
- 16th May 2007, 13:08
LMAO nah i don't have as this much of COM port. I only have 13. But you know, some USB-Serial (if not all) default value will be higher than COM15 - 16... which is the MSComm limit. Sure there's a way to do it with old VB version (5-6). Maybe one day i'll do a deeper API/DLL search.

I'm afraid, i will need to move to .NET soon :eek:

SteveB
- 16th May 2007, 15:14
:eek: Heh, how many comm ports do you have? I won't be terribly surprised if you tell me a 100 or so since I already know you have 2 monitors.

Don't most folks have 2 monitors? I couldn't imagine life otherwise. If I had more desk space I would move up to 3 or 4! (I still swear by CRTs, but am starting to consider a move towards LCD as $ goes down and image quality/size goes up), It would be an interesting poll to see how many monitor folks on this forum have and would like to have.

Steve

skimask
- 16th May 2007, 15:23
Don't most folks have 2 monitors? I couldn't imagine life otherwise. If I had more desk space I would move up to 3 or 4! (I still swear by CRTs, but am starting to consider a move towards LCD as $ goes down and image quality/size goes up), It would be an interesting poll to see how many monitor folks on this forum have and would like to have.
Steve

With used 17 inch CRTs as cheap as they are (like $40 in the classifieds), more people should have more.
Have you seen those USB-VGA adapters? Good for 2-D screens, obivously not enough bandwidth for gaming, etc. If I remember right, XP supports up to 9 monitors. I got 4 myself, 2 on a dual output PCI card (GeForce 4400 based), 2 on an AGP card (GeForce 7600 based). I tried to get the 5th one running off the onboard VGA (ATi IGP)...never did get the 5th running right.

mackrackit
- 16th May 2007, 15:37
Don't most folks have 2 monitors? I couldn't imagine life otherwise. If I had more desk space I would move up to 3 or 4! (I still swear by CRTs, but am starting to consider a move towards LCD as $ goes down and image quality/size goes up), It would be an interesting poll to see how many monitor folks on this forum have and would like to have.

Steve

I only have one monitor per machine, six machines in the shop and one in the truck.

I got my first LCD last week, one of those 19" wide jobs, it may not stay around long. Things are a little fuzzy.

A friend of mine went with a 24" or so plasma, two monitors in one:) Thats what I want!

skimask
- 16th May 2007, 15:45
I got my first LCD last week, one of those 19" wide jobs, it may not stay around long. Things are a little fuzzy.

Usually LCD monitors are right on the money, focus and otherwise...but you gotta get the settings right.
Got good cables/connections at each end? Running the right resolution? Messed with the phase settings? Clock settings?

Acetronics2
- 16th May 2007, 15:52
Hi, Skimask

I must admit my "old" IIYAMA "pro 450" (also called A 901 HT) is far better at Graphics than lots of 19" LCDs ...

Alain

keithdoxey
- 16th May 2007, 15:55
LMAO nah i don't have as this much of COM port. I only have 13. But you know, some USB-Serial (if not all) default value will be higher than COM15 - 16... which is the MSComm limit. Sure there's a way to do it with old VB version (5-6). Maybe one day i'll do a deeper API/DLL search.

The problem with USB-Serial adapters is the way that windows works.

USB is not the easy "Plug'n'play" solution that it should be. If you plug a Prolific USB-Serial adapter into a PC it is detected and assigned the next unused COM number. so lets say it gets assigned COM3

All good so far..... except next time you decide to use it you plug it into a different USB post on your PC, now Windows sees it and depite it being the SAME physical adapter it installs it again, this time as COM4

All it recognises is the Vendor ID and Product ID so ANY Prolific USB-Serial adapter plugged into your first USB port will be COM3 and likewise the secind USB port would be COM4.

If however you plugged an FTDI USB-Serial adapter into your first USB port, it gets installed as COM5 because it is a different Vendor and Product.

Worst of all, you cant uninstall an adapter unless it is actually plugged in because it doesnt exist in Device Mangler.

I was working with a piece of kit a couple of years ago that HAD to use a USB Serial Adapter and the software HAD to run on COM3. Plugged an adapter in and it got assigned COM4 because a different brand had previously been used.

I did however discover that if you change the adapter you want to be COM3 to COM3, the "other" non existant comport then gets assigned a differnt com number.

Trying to remember which adapter you used and on which USB port is a real headache !!!

mackrackit
- 16th May 2007, 15:55
Usually LCD monitors are right on the money, focus and otherwise...but you gotta get the settings right.
Got good cables/connections at each end? Running the right resolution? Messed with the phase settings? Clock settings?

Yep, tried all of the above and still messing with it. Hooked to the onboard VGA, maybe that is the problem. It is not all that bad, my son likes his, that is why I tried one. Might also have something todo with sitting beside a 19" CRT. To easy to be critical.

The space LCD's save, I think I can deal with some fuzz:)

mackrackit
- 16th May 2007, 16:07
Trying to remember which adapter you used and on which USB port is a real headache !!!
Thats not as bad as having kids that will move keyboards around just to see dad type on the wrong machine. Gotta do a color code.

keithdoxey
- 16th May 2007, 16:14
Thats not as bad as having kids that will move keyboards around just to see dad type on the wrong machine. Gotta do a color code.

Ive got kids...I also sometimes have multiple keyboards in front of my and I can manage to type on the wrong one with no interference from the kids!!!

Wouldnt be so bad but one PC, Keyboard and Mouse is black the other is White !!!!

keithdoxey
- 16th May 2007, 16:16
I got my first LCD last week, one of those 19" wide jobs, it may not stay around long. Things are a little fuzzy.



Check the resolution of the display and PC.

A 19" widescreen monitor is probably something like 1440 x 900 and ANY Flat panel run at other than its native resolution looks truely awful compared to running at its native resolution. Some cope better than others but it still ends up fuzzy to a certain extent.

mackrackit
- 16th May 2007, 16:24
Wouldnt be so bad but one PC, Keyboard and Mouse is black the other is White !!!!
There goes the color code idea:)


A 19" widescreen monitor is probably something like 1440 x 900 and ANY Flat panel run at other than its native resolution looks truely awful compared to running at its native resolution. Some cope better than others but it still ends up fuzzy to a certain extent.

Thats it. I do not have the 1440 x 900 option. Will have to live with it or get a new card.

keithdoxey
- 16th May 2007, 16:34
Thats it. I do not have the 1440 x 900 option. Will have to live with it or get a new card.

Check for updated drivers

In the properties,click on Advanced > Monitor and see if the "hide modes my mnitor cant display" is ticked

My PC was showing 1280x1024 as the highest setting but when I unticked the box there was a 1600x900 and a 1920 x something mode.

Also take a look at a program called "Powerstrip"

http://entechtaiwan.com/util/ps.shtm

I havent used it personally but I know some people who swear by it to get custom resolutions for their PCs on Plasma and large LCD screens.

dhouston
- 16th May 2007, 17:23
it's just too bad that it doesn't allow to open COM port > 15 or 16 :(
To handle higher ports, use "\\.\COMnn" (where nn is the port number, in decimal) when you define the port using the API.

You can patch the MSCOMM32.OCX control to allow ports >COM10. Use a hex editor to search for 3D 10 00 and change it to 3D xx 00 (where xx is the new upper limit, in hex) - e.g. 3D FF 00. NOTE: This may not work with all versions of the OCX.
CAUTION: Make a backup copy before patching.

My memory has faded but I think some early versions of the OCX worked above COM10.

mister_e
- 17th May 2007, 01:44
Yeah i saw the piping method a few times here and there... just never have the real requirment andd time to experiment it. Sure i keep the info handy.

one thing is sure VB.NET handle all available COM.. i know i have to move on that one... Not sure how good and how long VB6 will work with Vista... which i still don't want to have ;) I like the good ol' stuff.

i'd downloaded VbExpress today... and :eek: it's like a brand new language... chinese to me.. for now. If anybody have some nice PDFs on it, let me know.

Visual Studio is on the 'stuff to buy one day.. but ASAP' list. I'm waiting for 2007 release... Orcas, or something like that.

Visual Studio 6 did a nice job... already paid few times ;)

PS an API call always work better... Mscomm seems to be erratic on lower baudrate on some machine, while an API call seems to solve most problems. But... who use low baudrate in 2007? ;-)


My memory has faded but I think some early versions of the OCX worked above COM10
yeah indeed.. over 10 there's no problemj, over 16.. you have a problem. There's some OCX available here and there, i don't think they worth as long you can deal with API.

unfortunately, and as far as i'm aware of, there's no 'real' API guide. Those i know are just outdated.

mister_e
- 17th May 2007, 01:49
Don't most folks have 2 monitors? I couldn't imagine life otherwise. If I had more desk space I would move up to 3 or 4! (I still swear by CRTs, but am starting to consider a move towards LCD as $ goes down and image quality/size goes up), It would be an interesting poll to see how many monitor folks on this forum have and would like to have.

Steve

I use 2 monitor since over 10 years now.. you know when those dedicated card where over hudred dollars. I think i paid 400 or 500 for a Matrox one in the past... Now you can have a basic one under 100$ :eek: Sure not good for games.. but in my book, a PC is not a toy, but a tool.

Next step is to have room enough on my bench to have 3-4 19" inches monitor. 1 it's not enough, 2 is really nice, i imagine how better 3-4 could be. Kind of thing you don't know if you didn't have tested. One thing is sure... i don't have, and i will no longer any PC here (apart my laptop) running on a single screen. Soo much handy.

mackrackit
- 18th May 2007, 14:57
Check for updated drivers

In the properties,click on Advanced > Monitor and see if the "hide modes my mnitor cant display" is ticked

My PC was showing 1280x1024 as the highest setting but when I unticked the box there was a 1600x900 and a 1920 x something mode.

Also take a look at a program called "Powerstrip"

http://entechtaiwan.com/util/ps.shtm

I havent used it personally but I know some people who swear by it to get custom resolutions for their PCs on Plasma and large LCD screens.

I updated my OS from Mandrake 10 to Mandriva 2007. Fuzzy left:)