![]() | ||
| Home | SwiftX Archive | SwiftForth Archive | |

Leon,
Thanks I'll try it. I'll try anything.
The CH1 is...
%00000000 EQU NO-CHAN \ LShift RShift work on 16 bits
%00001000 EQU CH1
%00001001 EQU CH2
%00001010 EQU CH3
%00001011 EQU CH4
%00001100 EQU CH5
%00001101 EQU CH6
%00001110 EQU CH7
%00001111 EQU CH8
These dial up the 8 to 1 mux internal to the LTC2408 A/D
Tried the 2408-DATA 2@ D.
Following data, the flushing out of the previous reading is seen and OK
IR-ON 2408-data 2@ d. 13 100MS 2408-data 2@ d. CH1 GET-DATA 2408-DATA 2@
IR-OFF D. 324795 324795 328785 ok
IR-ON 2408-data 2@ d. 13 100MS 2408-data 2@ d. CH1 GET-DATA 2408-DATA 2@
IR-OFF D. 328785 328785 363537 ok
IR-ON 2408-data 2@ d. 13 100MS 2408-data 2@ d. CH1 GET-DATA 2408-DATA 2@
IR-OFF D. 363537 363537 331223 ok
IR-ON 2408-data 2@ d. 13 100MS 2408-data 2@ d. CH1 GET-DATA 2408-DATA 2@
IR-OFF D. 331223 331223 330393 ok
IR-ON 2408-data 2@ d. 13 100MS 2408-data 2@ d. CH1 GET-DATA 2408-DATA 2@
IR-OFF D. 330393 330393 313148 ok
IR-ON 2408-data 2@ d. 13 100MS 2408-data 2@ d. CH1 GET-DATA 2408-DATA 2@
IR-OFF D. 313148 313148 320658 ok
www 227161 ok
www 235898 ok
www 242076 ok
will try 2408-data 2@ D. inside WWW
Gene...Later
-----Original Message-----
From: Leon Wagner [mailto:leon_at_forth.com]
Sent: Friday, September 20, 2002 11:41 AM
To: Gene Silvernail
Subject: RE: [swiftx] What the hey !.... ATMEGA103
It would be interesting to do this:
WWW 2408-DATA 2@ D.
If the answer is the same, dump 2408-DATA between each word you're
interpretively executing and use .S to see what's happening on the
stack.
What is CH1? Is it just a 1?
> -----Original Message-----
> From: swiftx-bounce_at_forth.com [mailto:swiftx-bounce_at_forth.com]On
<mailto:swiftx-bounce_at_forth.com%5dOn>
> Behalf Of Gene Silvernail
> Sent: Thursday, September 19, 2002 7:32 PM
> To: Swiftx Listserve
> Subject: [swiftx] What the hey !.... ATMEGA103
>
>
>
>
> What is going on....
>
> The following data comes from an AD, (24 bit) that is used to read IR.
> I get different results depending upon whether the compiled word WWW
> is Executed verses the words that are making up WWW. All this is done
> from the XTL console. Why should running the compiled word WWW make
> any difference versus the running the words that are used to compile
> WWW. The following are copies from XTL and my editor.
>
> Something gotta be nailing the body of the compiled code.TIB ??
>
> Any suggestions on how to trouble shoot this would be appreciated.
>
>
>
>
>
>
> : PICK-CHANNEL ( n-- ) \ Enter with
> CH1...CH8, or NO-CHAN
> SPI-ON
> LTC2408-SPI-MODE
> 2408-DESELECT \ Must
leave
> CS on LTC2408 must be HI
> SPDR C!
> ;
>
>
> {
> ======================================================================
> ==
> =
>
> GET-DATA stores the 4 bytes from the LTC2408, storing at
>
> 2408-DATA bits 31-24 offset 1
> 2408-DATA+1 bits 23-16 offset 0
> 2408-DATA+2 bits 15-8 offset 3
> 2408-DATA+3 bits 7-0 offset 2
>
> This is correct for 2@, 2!
> ======================================================================
> ==
> = }
>
>
>
> : GET-DATA ( n -- )
> PICK-CHANNEL
> BEGIN AD-DONE? UNTIL
> 0 SPDR C! ?SPI-DONE SPDR C@ 1 2408-DATA + C!
> 0 SPDR C! ?SPI-DONE SPDR C@ 2408-DATA C!
> 0 SPDR C! ?SPI-DONE SPDR C@ 3 2408-DATA + C!
> 0 SPDR C! ?SPI-DONE SPDR C@ 2 2408-DATA + C!
> 2408-DATA 2@ D2/ D2/ D2/ D2/
> 2408-DATA 2!
> 0 2408-DATA 1+ C!
> SPI-OFF
> ;
>
>
> : IR-ON ( -- )
> IR-CONTROL PORTD SET-BIT
> ;
>
>
> : IR-OFF ( -- )
> IR-CONTROL PORTD CLEAR-BIT
> ;
>
>
> : WWW ( -- )
>
> IR-ON 13 100MS CH1 GET-DATA 2408-DATA 2@ IR-OFF D. ;
>
> Compiled WWW code
>
>
> 3106 IR-ON RCALL 3AD8
> 3108 (LITERAL) CALL 0E943000
> 310C LITERAL D
> 310E 100MS RCALL BBD8
> 3110 (LITERAL) CALL 0E943000
> 3114 LITERAL 8
> 3116 GET-DATA RCALL F7DE
> 3118 (LITERAL) CALL 0E943000
> 311C LITERAL 8FF
> 311E 2@ CALL 0E944F02
> 3122 IR-OFF RCALL 33D8
> 3124 D. JMP 0C947506 ok
>
>
>
>
>
> HERE IS A TYPICAL SESSION....
>
>
>
>
> READCOLD 5372 ok
> READCOLD 5788 ok
> READCOLD 5954 ok
> READCOLD 5718 ok
>
>
> Now we turn the IR source on..climbing values are to expected
>
>
> WWW 350322 ok
> WWW 359556 ok
> WWW 367106 ok
> WWW 372434 ok
>
>
> Here are the words direct..big difference.. eh
>
> IR-ON 13 100MS CH1 GET-DATA 2408-DATA 2@ IR-OFF D. 485175 ok IR-ON 13
> 100MS CH1 GET-DATA 2408-DATA 2@ IR-OFF D. 493667 ok IR-ON 13 100MS
> CH1 GET-DATA 2408-DATA 2@ IR-OFF D. 503249 ok IR-ON 13 100MS CH1
> GET-DATA 2408-DATA 2@ IR-OFF D. 509294 ok
>
>
> Repeating WWW
>
> WWW 347811 ok
> WWW 353093 ok
> WWW 361707 ok
> WWW 368330 ok
>
>
> Repeating words direct..
>
>
> IR-ON 13 100MS CH1 GET-DATA 2408-DATA 2@ IR-OFF D. 487014 ok IR-ON 13
> 100MS CH1 GET-DATA 2408-DATA 2@ IR-OFF D. 497636 ok IR-ON 13 100MS
> CH1 GET-DATA 2408-DATA 2@ IR-OFF D. 506249 ok IR-ON 13 100MS CH1
> GET-DATA 2408-DATA 2@ IR-OFF D. 513419 ok
>
> Redoing WWW to this was no help..forced an output value
>
> Also forced an output value from within GET-DATA..worked fine
>
> : WWW
>
> IR-ON 13 100MS CH1 GET-DATA
> { 2408-DATA 2@ }
> 1234567.
> IR-OFF D.
> ;
>
>
> IR-ON 13 100MS CH1 GET-DATA 1234567. IR-OFF D. 1234567 ok IR-ON 13
> 100MS CH1 GET-DATA 1234567. IR-OFF D. 1234567 ok WWW 1234567 ok
> WWW 1234567 ok
> WWW 1234567 ok
> IR-ON 13 100MS CH1 GET-DATA 1234567. IR-OFF D. 1234567 ok
> IR-ON 13 100MS CH1 GET-DATA 1234567. IR-OFF D. 1234567 ok
>
>
> ----------------------------------------------------------------------
> swiftx_at_forth.com The SwiftX programming discussion email list
> To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
> For help with listar commands, send subject "help" to listar_at_forth.com
> Archives are located at http://www.forth.com/swiftx -- check them out!
> ----------------------------------------------------------------------
> THIS LIST IS NOT FOR BUG REPORTS! Send bug reports to
> support_at_forth.com.
----------------------------------------------------------------------
swiftx_at_forth.com The SwiftX programming discussion email list
To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/swiftx -- check them out!
----------------------------------------------------------------------
THIS LIST IS NOT FOR BUG REPORTS! Send bug reports to support_at_forth.com.
Received on Fri Sep 20 2002 - 12:43:27 PDT
This archive was generated by hypermail 2.2.0 : Fri Dec 05 2008 - 03:04:21 PST