Searching \ for '[PIC:] Strange Jal error' 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: 'Strange Jal error'.

Exact match. Not showing close matches.
PICList Thread
'[PIC:] Strange Jal error'
2004\08\17@180006 by Jason S

flavicon
face
I've finally started coding the LED stroboscope.  I'm using JAL as a
language and an 18F252.

I have a simple piece of code that should turn the LED on for 50uS and then
off for enough time to use up the rest of a 50mS interval (so the frequency
will be 20Hz, and on-time will be 50uS).

When I try to compile my code, I get the error:
jal 0.4.60 (GCC 3.2)
>  error: unknown identifier tmr0
>  file '\data\pic\jal_46\jal-04~1.win\lib\interval.jal' line 60 char 4
>  :     tmr0 = _tmr0_start
>  :  ---^^^^

My code is:
include f252_4

include jdelay
include interval

var bit LED is pin_b7
pin_b7_direction = output

forever loop
init_interval_50mS(1) -- 50 miliseconds (20Hz)
 LED = low  -- LED is on
 delay_50us(1) -- wait 50 microseconds
 LED = high -- LED is off
next_interval()
end loop

Anyone have an idea what's causing the error?

Thanks,
 Jason

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2004\08\17@192828 by Tim - K1BR

flavicon
face
On Tuesday 17 August 2004 06:04 pm, Jason S wrote:
> I've finally started coding the LED stroboscope.  I'm using JAL as a
> language and an 18F252.

> >  error: unknown identifier tmr0

I'm not an expert in this (as I've not used JAL on 16-bit cores), but from what I can see, for 16-bit cores, tmr0 is defined as TMR0L and TMR0H.

From P18F458.jal (which is used for 18F definitions in jpic16.jal):
var volatile byte TMR0H at 0xFD7
var volatile byte TMR0L at 0xFD6

I think 16-bit support in JAL is a functional work-in-progress. There is a JAL mailing list on Yahoo groups.
Regards, Tim

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body

2004\08\17@201241 by Jason S

flavicon
face
I switched to a 16F628 and it's working perfectly (well except for being a
lot dimmer at a 0.1% duty cycle than I'd hoped :).

Thanks,
 Jason


From: "Tim - K1BR" <k1brspamKILLspamK1BR.NET>
Sent: Tuesday, August 17, 2004 4:29 PM


> I think 16-bit support in JAL is a functional work-in-progress. There is a
JAL
> mailing list on Yahoo groups.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body

2004\08\17@203146 by Spehro Pefhany

picon face
At 05:15 PM 8/17/2004 -0700, you wrote:
>I switched to a 16F628 and it's working perfectly (well except for being a
>lot dimmer at a 0.1% duty cycle than I'd hoped :).
>
>Thanks,
>   Jason

Some revisions of the 16F628 have a nasty bug in the CCP that might
cause you problems. They reverse logic in the comparison after the third
match..

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
EraseMEspeffspam_OUTspamTakeThisOuTinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2004\08\17@205508 by Jinx

face picon face
>18F252.
>
>  error: unknown identifier tmr0

You have to specify tmr0l or tmr0h (presumably you have case
sensitivity off) as tmr0 can be 16-bits on the 18F. You could modify
the .inc file to use tmr0 as an alternative name for tmr0l

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body

2004\08\18@010712 by Jason S

flavicon
face
From: "Spehro Pefhany" <KILLspamspeffKILLspamspamINTERLOG.COM>
Sent: Tuesday, August 17, 2004 5:44 PM

> Some revisions of the 16F628 have a nasty bug in the CCP that might
> cause you problems. They reverse logic in the comparison after the third
> match..

Thanks, I wasn't aware of that and it could have led to trouble.  Is there
an easy way to check if the chips I have have that error?  I have 4 16F628's
bought a few months apart from 2 sources, so hopefully at least one is good.

It turns out I won't be using the 16F628 anyway.  There's no ADC, which I
didn't realize.  Since I plan to use a 10-turn pot as the frequency control,
I will need an ADC.

It seems like I have a lot of different pics but the only 14-bit ones with
an ACD are 16F676, 16F876 and 16F877.  The 8xx ones are much larger (not to
mention more expensive) than I think the project needs, so I'll be using the
16F676.  Are there any quirks about that one that I should know about? :)

So far, I'll need at least 10 I/O lines.  I hope the 12 on the 16F676 isn't
shooting myself in the foot.

Jason

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu

2004\08\18@021047 by Wouter van Ooijen

face picon face
> I've finally started coding the LED stroboscope.  I'm using JAL as a
> language and an 18F252.
>
> I have a simple piece of code that should turn the LED on for
> 50uS and then
> off for enough time to use up the rest of a 50mS interval (so
> the frequency
> will be 20Hz, and on-time will be 50uS).

the interval library does not support tyhe 18F's.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestspamBeGonespammitvma.mit.edu

2004\08\18@081704 by Olin Lathrop

face picon face
Jason S wrote:
> It turns out I won't be using the 16F628 anyway.  There's no ADC,
> which I didn't realize.  Since I plan to use a 10-turn pot as the
> frequency control, I will need an ADC.

So your plan is to run the output of the 10 turn pot into the PIC A/D?
Since the PIC A/D is 10 bit, you won't get anywhere near the resolution you
would expect from a 10 turn pot and an analog circuit.  With a 10 bit A/D
you're only going to get 1024 different input settings.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-requestEraseMEspamspam_OUTmitvma.mit.edu

2004\08\18@093205 by Sergio Masci

picon face
----- Original Message -----
From: Olin Lathrop <RemoveMEolin_piclistspamTakeThisOuTEMBEDINC.COM>
To: <PICLISTEraseMEspam.....MITVMA.MIT.EDU>
Sent: Wednesday, August 18, 2004 1:17 PM
Subject: Re: [PIC:] Strange Jal error


> Jason S wrote:
> > It turns out I won't be using the 16F628 anyway.  There's no ADC,
> > which I didn't realize.  Since I plan to use a 10-turn pot as the
> > frequency control, I will need an ADC.
>
> So your plan is to run the output of the 10 turn pot into the PIC A/D?
> Since the PIC A/D is 10 bit, you won't get anywhere near the resolution you
> would expect from a 10 turn pot and an analog circuit.  With a 10 bit A/D
> you're only going to get 1024 different input settings.

To put this another way: there are 360 degrees per turn and 10 turns. From end
to end you will have to turn through 360*10 = 3600 degrees. Divide this by the
range of the ADC which is 1024 and you get about 3.5 degrees per unit of ADC
measurement. This meens you would have to turn the pot control by about 3.5
degrees before the ADC would register a change.

Regards
Sergio Masci

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspammitvma.mit.edu

2004\08\18@093825 by Alan B. Pearce

face picon face
>This meens you would have to turn the pot control by
>about 3.5 degrees before the ADC would register a change.

and doing it like that gives a resolution not that different to what you
could obtain from a rotary encoder where you sense every edge as a step
adjustment, so you don't really need an ADC on the pic if you go this route.

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestEraseMEspamEraseMEmitvma.mit.edu

2004\08\18@094034 by Wouter van Ooijen

face picon face
{Quote hidden}

If all you want is a rotary input (not the readout of a 10-turn pot) a
rotary encoder might be a better idea (no A/D required, just read the
Q-signals, and you can freely choose the number of turns that
corresponds to your full scale. You could even implement a 'fast turn'
feature (turning fast will change the 'value' even faster).

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspam_OUTspamKILLspammitvma.mit.edu

2004\08\18@095954 by Herbert Graf

flavicon
face
On Wed, 2004-08-18 at 01:12, Jason S wrote:
> From: "Spehro Pefhany" <RemoveMEspeffTakeThisOuTspamspamINTERLOG.COM>
> Sent: Tuesday, August 17, 2004 5:44 PM
>
> > Some revisions of the 16F628 have a nasty bug in the CCP that might
> > cause you problems. They reverse logic in the comparison after the third
> > match..
>
> Thanks, I wasn't aware of that and it could have led to trouble.  Is there
> an easy way to check if the chips I have have that error?  I have 4 16F628's
> bought a few months apart from 2 sources, so hopefully at least one is good.
>
> It turns out I won't be using the 16F628 anyway.  There's no ADC, which I
> didn't realize.  Since I plan to use a 10-turn pot as the frequency control,
> I will need an ADC.

       No reason at all to drop the 628 if all you need is to read a POT. Add
a cap and you can determine the POT's position based on the charge (or
discharge) time of the cap, no need for a full ADC.



-----------------------------
Herbert's PIC Stuff:
http://repatch.dyndns.org:8383/pic_stuff/

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspamspamspamBeGonemitvma.mit.edu

2004\08\18@143914 by Jason S

flavicon
face
Thanks Wouter.

The docs on your site say it doesn't support the Scenix SX18 and SX28
targets.  I thought that since it didn't mention the 18F devices it
supported them.

Jason

{Original Message removed}

2004\08\18@145538 by Jason S

flavicon
face
I did calculate that I'd get about 3.5 degrees per unit.  That's a lot more
useful than 0.35 where it's almost impossible to get the value you want.

Would I be better off with a pic with a 12-bit A/D?  I'm still not sure how
I will generate the pulse lengths.  I will normalize the 0-1023 range to 1
to 200 Hz..

I'll probably just divide the number by 5 and let 0-4 and 1001-1023 take it
slightly out of the "offical" range.  I can include a switch and have a
1-100 and 101-200 range to double the precision to 0.1 Hz.

What I still don't know how to do is translate that frequency into a delay
time.  I'll have 5mS to cycle the LED, get the input, update the LCD, and
calculate the delay time, so my use of floating point libraries is limited.

With a 200Hz top end on my range, I will automatically have that 5mS delay,
then I'll have to wait period = [1/freq - 5mS] seconds.

Jason

From: "Sergio Masci" <RemoveMEsmplKILLspamspamNTLWORLD.COM>
Sent: Wednesday, August 18, 2004 6:34 AM


> From: Olin Lathrop <olin_piclistSTOPspamspamspam_OUTEMBEDINC.COM>
> Sent: Wednesday, August 18, 2004 1:17 PM
>
> >
> > So your plan is to run the output of the 10 turn pot into the PIC A/D?
> > Since the PIC A/D is 10 bit, you won't get anywhere near the resolution
you
> > would expect from a 10 turn pot and an analog circuit.  With a 10 bit
A/D
> > you're only going to get 1024 different input settings.
>
> To put this another way: there are 360 degrees per turn and 10 turns. From
end
> to end you will have to turn through 360*10 = 3600 degrees. Divide this by
the
> range of the ADC which is 1024 and you get about 3.5 degrees per unit of
ADC
> measurement. This meens you would have to turn the pot control by about
3.5
> degrees before the ADC would register a change.

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestSTOPspamspamEraseMEmitvma.mit.edu

2004\08\18@145539 by Jason S

flavicon
face
Can you point out a good tutorial on using an optical encoder?  I've never
used one and I don't know what's involved.

Jason

From: "Wouter van Ooijen" <KILLspamwouterspamBeGonespamVOTI.NL>
Sent: Wednesday, August 18, 2004 6:40 AM

> If all you want is a rotary input (not the readout of a 10-turn pot) a
> rotary encoder might be a better idea (no A/D required, just read the
> Q-signals, and you can freely choose the number of turns that
> corresponds to your full scale. You could even implement a 'fast turn'
> feature (turning fast will change the 'value' even faster).

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspamEraseMEmitvma.mit.edu

2004\08\18@151234 by Wouter van Ooijen

face picon face
> The docs on your site say it doesn't support the Scenix SX18 and SX28
> targets.  I thought that since it didn't mention the 18F devices it
> supported them.

I wrote that when the 16F877 the hot chip. Later I added 18F support,
but I never rewrote the manual. The documentation is not exactly the
strongest point of Jal :)

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-request@spam@spamspam_OUTmitvma.mit.edu

2004\08\18@151237 by Jan-Erik Soderholm

face picon face
Jason S wrote :

> Can you point out a good tutorial on using an optical
> encoder?  I've never used one and I don't know what's involved.

Googling for "rotary quadrature encoder" gave this as one of the
top 10 hits :

http://www.circuitcellar.com/library/print/0303/millier152/index.htm

Pretty OK...

Jan-Erik.

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestspamKILLspammitvma.mit.edu

2004\08\18@151444 by Wouter van Ooijen

face picon face
> Can you point out a good tutorial on using an optical
> encoder?  I've never
> used one and I don't know what's involved.

I can't, but you can google for quadrature encoding.

But not that you don't need to go optical, the cheaper rotary encoders
are mechanical.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestspam_OUTspammitvma.mit.edu

2004\08\18@200717 by Andrew Warren

flavicon
face
On 18 Aug 2004 at 12:00, Jason S wrote:

> I will normalize the 0-1023 range to 1 to 200 Hz..
>
> I'll probably just divide the number by 5 and let 0-4 and 1001-1023
> take it slightly out of the "offical" range.

   I missed the start of this thread, so forgive me if I'm repeating
   what others have said, or misunderstanding the problem entirely.

   It's easier to divide by 4 to get 0-255... And if you then map 0-30
   to 1, 31-230 to 1-200, and 231-255 to 200, you'll be sure to have the
   entire range even if your pot doesn't quite go to the ends of its
   travel.

> What I still don't know how to do is translate that frequency into a
> delay time.  I'll have 5mS to cycle the LED, get the input, update the
> LCD, and calculate the delay time, so my use of floating point
> libraries is limited.

   Don't use floating-point math for this... Use a lookup table.

   -Andy

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-request.....spamTakeThisOuTmitvma.mit.edu

2004\08\18@204738 by Jason S

flavicon
face
From: "Andrew Warren" <TakeThisOuTaiwKILLspamspamspamCYPRESS.COM>
Sent: Wednesday, August 18, 2004 5:05 PM


>     It's easier to divide by 4 to get 0-255... And if you then map 0-30
>     to 1, 31-230 to 1-200, and 231-255 to 200, you'll be sure to have the
>     entire range even if your pot doesn't quite go to the ends of its
>     travel.

When I said divide by 5, I didn't mean throwing away information; for
example 633 would become 126.6Hz which is a different result than 634 which
is 126.8.  I could use your way and then have my values rounded to the
nearest 0.25 instead of 0.2, but I don't know that it will be that important
to compensate for a pot that doesn't let me get to the end of the range.
Especially if I'm using a 10-turn pot which should be of generally higher
quality and much more likely to get to the end of its range of travel.

>     Don't use floating-point math for this... Use a lookup table.

That would be easiest, but are their shortcuts if I go that route?  I'll
have 1000 input values, and I'll need 2 bytes to output for each one (number
for 100uS and number of 10mS to delay).  That means a 2000 value lookup
table.

Jason

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestspamRemoveMEmitvma.mit.edu

2004\08\18@233126 by Andrew Warren

flavicon
face
Jason S <RemoveMEPICLISTspamspamBeGonemitvma.mit.edu> wrote:

> When I said divide by 5, I didn't mean throwing away information ....
> I'll have 1000 input values, and I'll need 2 bytes to output for each
> one (number for 100uS and number of 10mS to delay).  That means a 2000
> value lookup table.

I'm sorry, Jason.  As I said, I missed the start of the thread, so I
didn't realize that you needed 1000 discrete values in steps of 0.2
Hz; I thought you were dividing by 5 to get 200 values in steps of 1
Hz.

A lookup table for 1000 entries would be, as you pointed out, rather
unwieldy.

-Andy

=== Andrew Warren - spamBeGoneaiw@spam@spamspam_OUTcypress.com
===
=== Principal Design Engineer
=== Cypress Semiconductor Corporation

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-requestspamspammitvma.mit.edu

2004\08\19@003327 by Jason S

flavicon
face
From: "Andrew Warren" <aiwEraseMEspamCYPRESS.COM>
Sent: Wednesday, August 18, 2004 8:32 PM

> I'm sorry, Jason.  As I said, I missed the start of the thread, so I
> didn't realize that you needed 1000 discrete values in steps of 0.2
> Hz; I thought you were dividing by 5 to get 200 values in steps of 1
> Hz.
>
> A lookup table for 1000 entries would be, as you pointed out, rather
> unwieldy.

No need to be sorry, I appreciate your trying to help.  I was hoping you had
some insights into a better way to do lookup tables :)

Jason

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\08\19@041354 by Jan-Erik Soderholm

face picon face
Hi.
Have you thought of thinking this over at large ?

Like using some exernal deviders (I think there are some
10 or 12 bit settable/programmable deviders in the 74xx or
40xx lines) and let the PIC just control them ?

There might even be some special "freq generator" chips
with more features built-in, like an I2C or similar interface.

As some one else pointed out, the PWM module is fine when
you have a fixed freq and adjust the pulse width (that
*could* be the reason it's called the "PWM" module :) ).

Jan-Erik.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

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