Re: [jallib] USB_help

2022-12-17 Thread hans


Hi Vasile,

Your message has made me think and it brings me to a phenomenon that I have 
paid little attention to until now.

I'll try to explain.

1. I have several complete JAL packages on my PC. If a newer version is 
available I will keep the old one. Including the complete package from 
Bert's book because I have made a lot of things with it.

2. When I start something new I create a new folder, put a copy from the 
sample list in it and only if I change something from the lib list do I put 
that in there too.

3. Here's the thing: For example, if I want to view and edit something in 
an older Jal package and I click the OPEN function, Jaledit shows me the 
file map I've been working on recently.

4. If I then go to another package and do the same there, it shows the list 
of recent files from the other package.

5. So somewhere there must be a link between all those packages. So it 
could very well be that jaledit is using the wrong link

6. I will change my method and put everything in one folder as you 
indicated.

 

I hope you understand my story.

regards

Hans

Op zondag 18 december 2022 om 07:20:46 UTC+1 schreef vasile:

> I never experienced this problem, so I'm useless for LVP/USB interaction.
> What I know for sure is this: once USB works for you, save in a separate 
> folder ALL libraries related to your test program and the compiler, test 
> carefully that compilation works only from that folder and write a note 
> named maybe "warning.jal" describing clearly what was the issue and how you 
> solved it. In this particular way you will never encounter a similar issue 
> using the same compiler revision. 
> Of course you will see other issues...:)
>
> On Sat, Dec 17, 2022 at 8:59 PM hans  wrote:
>
>> Another addition Vasile, I also tested with the pickitminus, but the case 
>> does not work with or without the LVP.
>> I'm now looking for a cure for programming headaches.
>> Maybe I'd better go back to the antique things that I've been able to 
>> experience so much for years.
>> regards
>> Hans
>>
>> Op zaterdag 17 december 2022 om 18:33:20 UTC+1 schreef hans:
>>
>>> Hi Vasile,
>>> I have now discovered that if I turn off the LVP all examples work. 
>>> Apparently, activating the lvp causes both the Wisp and Pickit3 to interact 
>>> with it, causing this problem.
>>> I'm going to always turn off the LVP from now on (if I don't forget!!)
>>> Greetings and thanks again for all your responses.
>>> Hans
>>>
>>> Op zaterdag 17 december 2022 om 17:39:22 UTC+1 schreef vasile:
>>>
 Hmm, let me find an 18F2550 and check.

 On Fri, Dec 16, 2022 at 7:52 PM hans  wrote:

> Hello Vasile
> I have always worked as you indicated. Program, unplug everything and 
> then plug it back in. prompt response that the case was not recognized. 
> See 
> my previous message.
> Now your latest version, does nothing at all. Loaded the previous 
> version again and it works as stated before.
> regards
> Hans
>
> Op vrijdag 16 december 2022 om 18:07:52 UTC+1 schreef vasile:
>
>> Hans,
>> I think you are doing in this way: 
>> 1. USB connection is kept permanently between your board and PC
>> 2. your board is programmed with pickit and after programming you 
>> expect to see immediately the pic USB device in your PC
>> right?
>>
>> After programming you have to disconnect your PC from USB and connect 
>> it again, wait a bit until the computer sees your device.
>> I think the original sample will work in this way, however below is 
>> the the sample (using interrupts) which should work without 
>> disconnecting 
>> your PIC from USB after programming ( please note I did not tested, no 
>> PIC18F4450 or PIC2550 available now).
>>
>> Finally you may comment the 5s delay if you wish, but you may loss 
>> the " JALLIB USB Serial Demo" string.
>> Hopefully will work for you.
>>
>> -- ---
>> include 18f4550
>>
>>
>> -- even though the external crystal is 20 MHz, the configuration is 
>> such that
>> -- the CPU clock is derived from the 96 Mhz PLL clock (div2), 
>> therefore set
>> -- target frequency to 48 MHz
>> pragma target clock   48_000_000
>>
>>
>> -- fuses
>> pragma target PLLDIVP5  -- divide by 5 - 20MHZ_INPUT
>> pragma target CPUDIVP1  -- [primary oscillator src: 
>> /1][96 mhz pll src: /2]
>> pragma target USBDIVP2  -- CLOCK_SRC_FROM_96MHZ_PLL_2
>> pragma target OSC   HS_PLL
>> pragma target FCMEN DISABLED
>> pragma target IESO  DISABLED
>> pragma target PWRTE DISABLED-- power up timer
>> pragma target VREGENENABLED -- USB voltage regulator
>> pragma target VOLTAGE   V21 -- brown out voltage
>>
>> pragma target BROWNOUT  DISABLED  

Re: [jallib] USB_help

2022-12-17 Thread vsurducan
I never experienced this problem, so I'm useless for LVP/USB interaction.
What I know for sure is this: once USB works for you, save in a separate
folder ALL libraries related to your test program and the compiler, test
carefully that compilation works only from that folder and write a note
named maybe "warning.jal" describing clearly what was the issue and how you
solved it. In this particular way you will never encounter a similar issue
using the same compiler revision.
Of course you will see other issues...:)

On Sat, Dec 17, 2022 at 8:59 PM hans  wrote:

> Another addition Vasile, I also tested with the pickitminus, but the case
> does not work with or without the LVP.
> I'm now looking for a cure for programming headaches.
> Maybe I'd better go back to the antique things that I've been able to
> experience so much for years.
> regards
> Hans
>
> Op zaterdag 17 december 2022 om 18:33:20 UTC+1 schreef hans:
>
>> Hi Vasile,
>> I have now discovered that if I turn off the LVP all examples work.
>> Apparently, activating the lvp causes both the Wisp and Pickit3 to interact
>> with it, causing this problem.
>> I'm going to always turn off the LVP from now on (if I don't forget!!)
>> Greetings and thanks again for all your responses.
>> Hans
>>
>> Op zaterdag 17 december 2022 om 17:39:22 UTC+1 schreef vasile:
>>
>>> Hmm, let me find an 18F2550 and check.
>>>
>>> On Fri, Dec 16, 2022 at 7:52 PM hans  wrote:
>>>
 Hello Vasile
 I have always worked as you indicated. Program, unplug everything and
 then plug it back in. prompt response that the case was not recognized. See
 my previous message.
 Now your latest version, does nothing at all. Loaded the previous
 version again and it works as stated before.
 regards
 Hans

 Op vrijdag 16 december 2022 om 18:07:52 UTC+1 schreef vasile:

> Hans,
> I think you are doing in this way:
> 1. USB connection is kept permanently between your board and PC
> 2. your board is programmed with pickit and after programming you
> expect to see immediately the pic USB device in your PC
> right?
>
> After programming you have to disconnect your PC from USB and connect
> it again, wait a bit until the computer sees your device.
> I think the original sample will work in this way, however below is
> the the sample (using interrupts) which should work without disconnecting
> your PIC from USB after programming ( please note I did not tested, no
> PIC18F4450 or PIC2550 available now).
>
> Finally you may comment the 5s delay if you wish, but you may loss the
> " JALLIB USB Serial Demo" string.
> Hopefully will work for you.
>
> -- ---
> include 18f4550
>
>
> -- even though the external crystal is 20 MHz, the configuration is
> such that
> -- the CPU clock is derived from the 96 Mhz PLL clock (div2),
> therefore set
> -- target frequency to 48 MHz
> pragma target clock   48_000_000
>
>
> -- fuses
> pragma target PLLDIVP5  -- divide by 5 - 20MHZ_INPUT
> pragma target CPUDIVP1  -- [primary oscillator src:
> /1][96 mhz pll src: /2]
> pragma target USBDIVP2  -- CLOCK_SRC_FROM_96MHZ_PLL_2
> pragma target OSC   HS_PLL
> pragma target FCMEN DISABLED
> pragma target IESO  DISABLED
> pragma target PWRTE DISABLED-- power up timer
> pragma target VREGENENABLED -- USB voltage regulator
> pragma target VOLTAGE   V21 -- brown out voltage
>
> pragma target BROWNOUT  DISABLED-- no brownout detection
> pragma target WDTPS P32K-- watch dog saler setting
> pragma target WDT   CONTROL -- watchdog software controlled
> pragma target CCP2MUX   pin_C1  -- CCP2 on pin C1
> pragma target PBADENDIGITAL -- digital input port<0..4>
> pragma target LPT1OSC   LOW_POWER   -- low power timer 1
> pragma target MCLR  EXTERNAL-- master reset on RE3
> pragma target STVR  DISABLED-- reset on stack over/under
> flow
> pragma target LVP   ENABLED -- allow low-voltage
> programming
>
> pragma target XINST DISABLED -- extended instruction set
> pragma target DEBUG DISABLED-- background debugging
> pragma target CP0   DISABLED-- code block 0 not protected
> pragma target CP1   DISABLED-- code block 1 not protected
> pragma target CP2   DISABLED-- code block 2 not protected
> pragma target CP3   DISABLED-- code block 3 not protected
> pragma target CPB   DISABLED-- bootblock code not write
> protected
> pragma target CPD   DISABLED-- eeprom code not write
> protected
> pragma target WRT0  

[jallib] [jallib build] buildbot success in jallib on jallib-standard

2022-12-17 Thread build
Hi guys,

This is buildbot speaking. I have finished a build of jallib-standard on jallib.
Buildslave for this Build: sebbot

Build Reason: 
Build Source Stamp: HEAD
Blamelist: rob.jansen

Build succeeded!
Logs are attached.

sincerely,
 -The Buildbot

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jallib+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/E1p6dVo-00022b-OQ%40casadeyork.com.
Updating '.':

UU   CHANGELOG

UU   TORELEASE

Updated to revision 3879.

2792 samples to validate...

1173 libraries to validate...

All files validated :)

Environment config

JALLIB_ROOT=/home/mattschinkel/jallib/slave/standard/build

JALLIB_REPOS=/home/mattschinkel/jallib/slave/standard/build/include

JALLIB_SAMPLEDIR=/home/mattschinkel/jallib/slave/standard/build/sample

JALLIB_JALV2=/home/mattschinkel/bin/jalv2

JALLIB_PYTHON=python2.7



Time duration: 249 secs

jal jalv25r6 (compiled Oct 29 2021)

Required parameter to hex is missing!

no source file, use /home/mattschinkel/bin/jalv2 --help for help

Error while compiling file (status=1).

See previous message.

2792 samples to compile...

All samples compile :)

Environment config

JALLIB_ROOT=/home/mattschinkel/jallib/slave/standard/build

JALLIB_REPOS=/home/mattschinkel/jallib/slave/standard/build/include

JALLIB_SAMPLEDIR=/home/mattschinkel/jallib/slave/standard/build/sample

JALLIB_JALV2=/home/mattschinkel/bin/jalv2

JALLIB_PYTHON=python2.7



Time duration: 2022 secs



Re: [jallib] Re: For Loop Issue

2022-12-17 Thread flyway38
Hello Rob,

Thank you for your time on this issue.
Don't worry much. Take your time.
As I said above, have also found another way of reaching the same result 
with a code not much different.
So, for me its a solved issue for now. But understand you in raising new 
compiler issue as it should be addressed in future for a better compiler.
Thank you very much.

Cheers,
FS

On Saturday, December 17, 2022 at 6:03:54 PM UTC rob...@hotmail.com wrote:

> Hi Filipe,
>
> I did some analysis and it seems to be a compiler issue. I registered the 
> issue under: https://github.com/jallib/jalv2compiler/issues/26
>
> 
> Problem when incrementing index and using index directly in a function 
> call · Issue #26 · jallib/jalv2compiler 
> 
> Given this code -- This goes wrong. print_string(serial_hw_data, 
> Test 1 must show C to J : ) for (MY_ARRAY_SIZE - 2) using index 
> loop variable_array[index + 1] = data_eeprom(index + 1) ...
> github.com
> I also added the analysis where the problem is visible in the assembly 
> code. Maybe too much detail but handy for later.
>
> I was working on another compiler issue (#25) but got it only partly 
> solved and now I am stuck with the part that is not yet working correctly. 
>
> Maybe I will have a look at this issue later. For now the workaround 
> works, which is also shown in the analysis.
>
> Kind regards,
>
> Rob
>
> --
> *Van:* jal...@googlegroups.com  namens Rob CJ <
> rob...@hotmail.com>
> *Verzonden:* zaterdag 17 december 2022 11:33
> *Aan:* jal...@googlegroups.com 
>
> *Onderwerp:* Re: [jallib] Re: For Loop Issue
> Hi Filip,
>
> The problem with these kind of issues is finding the reproduction 
> scenario. I made one and found indeed a problem which might be a compiler 
> issue.
>
> Attached you find a test program that I made to reproduce your issue. 
> There are 6 test and test number 5 goes wrong (when counter is not equal to 
> 0) and a workaroud is given in test 6 by using a temporary variable. The 
> output of test 5 and test 6 should have been the same but it is not, see 
> screenshot below.
>
>
>  
> I need to analyze this further to see where the compiler goes wrong. For 
> now your problem could be fixed by using a temporary variable. Please give 
> it a try and let me know if it solves your problem.
>
>
> Thanks.
>
> Kind regards,
>
> Rob
>
> --
> *Van:* jal...@googlegroups.com  namens flyway38 <
> fsfo...@gmail.com>
> *Verzonden:* vrijdag 16 december 2022 22:46
> *Aan:* jallib 
> *Onderwerp:* Re: [jallib] Re: For Loop Issue 
>  
> Missed this information above.
> n goes from 0 to something like 20, and nSmsCenterPhone is also a byte 
> and assumes 12 in this case.
>
>
> On Friday, December 16, 2022 at 9:41:07 PM UTC flyway38 wrote:
>
> Hi Rob,
>
> Thanks for your support.
> Both vars are bytes.
>
> Cheers,
> FS
>
> On Friday, December 16, 2022 at 6:52:05 PM UTC rob...@hotmail.com wrote:
>
> Hi Filip,
>
> No idea. I need to see if I can reproduce this.
>
> Of what type are Index and n? What is the value of n?
>
> Thanks
>
> Kind regards,
>
> Rob
>
> --
> *Van:* jal...@googlegroups.com  namens flyway38 <
> fsfo...@gmail.com>
> *Verzonden:* vrijdag 16 december 2022 19:34
> *Aan:* jallib 
> *Onderwerp:* [jallib] Re: For Loop Issue 
>  
> Heres the issue in a different form:
> This code works:
>   for nSmsCenterPhone+1 using Index loop
>   SmsCenterPhone[Index]=data_eeprom(Index+n)+48
>   end loop
>   SmsCenterPhone[0]=data_eeprom(n)-- Insert 
> "+" @[0]
>
> This should work and the same, but no... it doesn't work.
>   SmsCenterPhone[0]=data_eeprom(n)-- Insert 
> "+" @[0]   
>  for nSmsCenterPhone using Index loop
>   SmsCenterPhone[Index+1]=data_eeprom(Index+n+1)+48
>   end loop
>
> Very odd issue.
> Any ideas?
> Thank you.
>
> Cheers,
> FS
> On Friday, December 16, 2022 at 6:15:16 PM UTC flyway38 wrote:
>
> Hello all,
>
> Have found an odd issue.
> Maybe me not doing it right, but need to ear from you about it.
> Here's the code:
>
>   for nSmsCenterPhone using Index loop
>   SmsCenterPhone[Index+1]=data_eeprom(Index+n)+48
>   end loop
>
> Situation is; I need to start filling array SmsCenterPhone[20] starting 
> from 2nd byte [1].
> It fails and don't understand why.
> EEprom data is ok. Have double checked it.
> Have found that it works if I don't add +1 do Index to 
> SmsCenterPhone[Index+1], but would like to understand why this is happening.
> Thank you very much.
>
> Kind regards,
> Filipe Santos
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jallib+un...@googlegroups.com.
> To view this discussion on the web visit 
> 

Re: [jallib] Re: For Loop Issue

2022-12-17 Thread Rob CJ
Hi Filipe,

I did some analysis and it seems to be a compiler issue. I registered the issue 
under: https://github.com/jallib/jalv2compiler/issues/26

[https://opengraph.githubassets.com/1d9eae7bfc9ec02b5864bd18740a2ed14edde635409db785c63be0dd32a3be7e/jallib/jalv2compiler/issues/26]
Problem when incrementing index and using index directly in a function call · 
Issue #26 · 
jallib/jalv2compiler
Given this code -- This goes wrong. print_string(serial_hw_data, "Test 1 must 
show C to J : ") for (MY_ARRAY_SIZE - 2) using index loop variable_array[index 
+ 1] = data_eeprom(index + 1) ...
github.com
I also added the analysis where the problem is visible in the assembly code. 
Maybe too much detail but handy for later.

I was working on another compiler issue (#25) but got it only partly solved and 
now I am stuck with the part that is not yet working correctly.

Maybe I will have a look at this issue later. For now the workaround works, 
which is also shown in the analysis.

Kind regards,

Rob


Van: jallib@googlegroups.com  namens Rob CJ 

Verzonden: zaterdag 17 december 2022 11:33
Aan: jallib@googlegroups.com 
Onderwerp: Re: [jallib] Re: For Loop Issue

Hi Filip,

The problem with these kind of issues is finding the reproduction scenario. I 
made one and found indeed a problem which might be a compiler issue.

Attached you find a test program that I made to reproduce your issue. There are 
6 test and test number 5 goes wrong (when counter is not equal to 0) and a 
workaroud is given in test 6 by using a temporary variable. The output of test 
5 and test 6 should have been the same but it is not, see screenshot below.

[cid:78423049-8124-4154-9d1d-ada2a50e63cc]

I need to analyze this further to see where the compiler goes wrong. For now 
your problem could be fixed by using a temporary variable. Please give it a try 
and let me know if it solves your problem.


Thanks.

Kind regards,

Rob


Van: jallib@googlegroups.com  namens flyway38 

Verzonden: vrijdag 16 december 2022 22:46
Aan: jallib 
Onderwerp: Re: [jallib] Re: For Loop Issue

Missed this information above.
n goes from 0 to something like 20, and nSmsCenterPhone is also a byte and 
assumes 12 in this case.


On Friday, December 16, 2022 at 9:41:07 PM UTC flyway38 wrote:
Hi Rob,

Thanks for your support.
Both vars are bytes.

Cheers,
FS

On Friday, December 16, 2022 at 6:52:05 PM UTC rob...@hotmail.com wrote:
Hi Filip,

No idea. I need to see if I can reproduce this.

Of what type are Index and n? What is the value of n?

Thanks

Kind regards,

Rob


Van: jal...@googlegroups.com  namens flyway38 

Verzonden: vrijdag 16 december 2022 19:34
Aan: jallib 
Onderwerp: [jallib] Re: For Loop Issue

Heres the issue in a different form:
This code works:
  for nSmsCenterPhone+1 using Index loop
  SmsCenterPhone[Index]=data_eeprom(Index+n)+48
  end loop
  SmsCenterPhone[0]=data_eeprom(n)-- Insert "+" @[0]

This should work and the same, but no... it doesn't work.
  SmsCenterPhone[0]=data_eeprom(n)-- Insert "+" @[0]
 for nSmsCenterPhone using Index loop
  SmsCenterPhone[Index+1]=data_eeprom(Index+n+1)+48
  end loop

Very odd issue.
Any ideas?
Thank you.

Cheers,
FS
On Friday, December 16, 2022 at 6:15:16 PM UTC flyway38 wrote:
Hello all,

Have found an odd issue.
Maybe me not doing it right, but need to ear from you about it.
Here's the code:

  for nSmsCenterPhone using Index loop
  SmsCenterPhone[Index+1]=data_eeprom(Index+n)+48
  end loop

Situation is; I need to start filling array SmsCenterPhone[20] starting from 
2nd byte [1].
It fails and don't understand why.
EEprom data is ok. Have double checked it.
Have found that it works if I don't add +1 do Index to SmsCenterPhone[Index+1], 
but would like to understand why this is happening.
Thank you very much.

Kind regards,
Filipe Santos

--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jallib+un...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/a5e8729b-7dc4-4f2d-904f-7950f3b3d05cn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jallib+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Re: [jallib] USB_help

2022-12-17 Thread hans
Hi Vasile,
I have now discovered that if I turn off the LVP all examples work. 
Apparently, activating the lvp causes both the Wisp and Pickit3 to interact 
with it, causing this problem.
I'm going to always turn off the LVP from now on (if I don't forget!!)
Greetings and thanks again for all your responses.
Hans

Op zaterdag 17 december 2022 om 17:39:22 UTC+1 schreef vasile:

> Hmm, let me find an 18F2550 and check.
>
> On Fri, Dec 16, 2022 at 7:52 PM hans  wrote:
>
>> Hello Vasile
>> I have always worked as you indicated. Program, unplug everything and 
>> then plug it back in. prompt response that the case was not recognized. See 
>> my previous message.
>> Now your latest version, does nothing at all. Loaded the previous version 
>> again and it works as stated before.
>> regards
>> Hans
>>
>> Op vrijdag 16 december 2022 om 18:07:52 UTC+1 schreef vasile:
>>
>>> Hans,
>>> I think you are doing in this way: 
>>> 1. USB connection is kept permanently between your board and PC
>>> 2. your board is programmed with pickit and after programming you expect 
>>> to see immediately the pic USB device in your PC
>>> right?
>>>
>>> After programming you have to disconnect your PC from USB and connect it 
>>> again, wait a bit until the computer sees your device.
>>> I think the original sample will work in this way, however below is the 
>>> the sample (using interrupts) which should work without disconnecting your 
>>> PIC from USB after programming ( please note I did not tested, no 
>>> PIC18F4450 or PIC2550 available now).
>>>
>>> Finally you may comment the 5s delay if you wish, but you may loss the " 
>>> JALLIB USB Serial Demo" string.
>>> Hopefully will work for you.
>>>
>>> -- ---
>>> include 18f4550
>>>
>>>
>>> -- even though the external crystal is 20 MHz, the configuration is such 
>>> that
>>> -- the CPU clock is derived from the 96 Mhz PLL clock (div2), therefore 
>>> set
>>> -- target frequency to 48 MHz
>>> pragma target clock   48_000_000
>>>
>>>
>>> -- fuses
>>> pragma target PLLDIVP5  -- divide by 5 - 20MHZ_INPUT
>>> pragma target CPUDIVP1  -- [primary oscillator src: 
>>> /1][96 mhz pll src: /2]
>>> pragma target USBDIVP2  -- CLOCK_SRC_FROM_96MHZ_PLL_2
>>> pragma target OSC   HS_PLL
>>> pragma target FCMEN DISABLED
>>> pragma target IESO  DISABLED
>>> pragma target PWRTE DISABLED-- power up timer
>>> pragma target VREGENENABLED -- USB voltage regulator
>>> pragma target VOLTAGE   V21 -- brown out voltage
>>>
>>> pragma target BROWNOUT  DISABLED-- no brownout detection
>>> pragma target WDTPS P32K-- watch dog saler setting
>>> pragma target WDT   CONTROL -- watchdog software controlled
>>> pragma target CCP2MUX   pin_C1  -- CCP2 on pin C1
>>> pragma target PBADENDIGITAL -- digital input port<0..4>
>>> pragma target LPT1OSC   LOW_POWER   -- low power timer 1
>>> pragma target MCLR  EXTERNAL-- master reset on RE3
>>> pragma target STVR  DISABLED-- reset on stack over/under flow
>>> pragma target LVP   ENABLED -- allow low-voltage programming
>>>
>>> pragma target XINST DISABLED -- extended instruction set
>>> pragma target DEBUG DISABLED-- background debugging
>>> pragma target CP0   DISABLED-- code block 0 not protected
>>> pragma target CP1   DISABLED-- code block 1 not protected
>>> pragma target CP2   DISABLED-- code block 2 not protected
>>> pragma target CP3   DISABLED-- code block 3 not protected
>>> pragma target CPB   DISABLED-- bootblock code not write 
>>> protected
>>> pragma target CPD   DISABLED-- eeprom code not write 
>>> protected
>>> pragma target WRT0  DISABLED-- table writeblock 0 not 
>>> protected
>>> pragma target WRT1  DISABLED-- table write block 1 not 
>>> protected
>>> pragma target WRT2  DISABLED-- table write block 2 not 
>>> protected
>>> pragma target WRT3  DISABLED-- table write block 3 not 
>>> protected
>>> pragma target WRTB  DISABLED-- bootblock not write protected
>>> pragma target WRTD  DISABLED-- eeprom not write protected
>>> pragma target WRTC  DISABLED-- config not write protected
>>> pragma target EBTR0 DISABLED-- table read block 0 not 
>>> protected
>>> pragma target EBTR1 DISABLED-- table read block 1 not 
>>> protected
>>> pragma target EBTR2 DISABLED-- table read block 2 not 
>>> protected
>>> pragma target EBTR3 DISABLED-- table read block 3 not 
>>> protected
>>> pragma target EBTRB DISABLED-- boot block not protected
>>>
>>> WDTCON_SWDTEN = OFF -- disable watchdog
>>>
>>> const USB_INTERRUPT_DRIVEN = TRUE
>>> include delay
>>> include usb_serial
>>> 

Re: [jallib] USB_help

2022-12-17 Thread vsurducan
Hmm, let me find an 18F2550 and check.

On Fri, Dec 16, 2022 at 7:52 PM hans  wrote:

> Hello Vasile
> I have always worked as you indicated. Program, unplug everything and then
> plug it back in. prompt response that the case was not recognized. See my
> previous message.
> Now your latest version, does nothing at all. Loaded the previous version
> again and it works as stated before.
> regards
> Hans
>
> Op vrijdag 16 december 2022 om 18:07:52 UTC+1 schreef vasile:
>
>> Hans,
>> I think you are doing in this way:
>> 1. USB connection is kept permanently between your board and PC
>> 2. your board is programmed with pickit and after programming you expect
>> to see immediately the pic USB device in your PC
>> right?
>>
>> After programming you have to disconnect your PC from USB and connect it
>> again, wait a bit until the computer sees your device.
>> I think the original sample will work in this way, however below is the
>> the sample (using interrupts) which should work without disconnecting your
>> PIC from USB after programming ( please note I did not tested, no
>> PIC18F4450 or PIC2550 available now).
>>
>> Finally you may comment the 5s delay if you wish, but you may loss the "
>> JALLIB USB Serial Demo" string.
>> Hopefully will work for you.
>>
>> -- ---
>> include 18f4550
>>
>>
>> -- even though the external crystal is 20 MHz, the configuration is such
>> that
>> -- the CPU clock is derived from the 96 Mhz PLL clock (div2), therefore
>> set
>> -- target frequency to 48 MHz
>> pragma target clock   48_000_000
>>
>>
>> -- fuses
>> pragma target PLLDIVP5  -- divide by 5 - 20MHZ_INPUT
>> pragma target CPUDIVP1  -- [primary oscillator src:
>> /1][96 mhz pll src: /2]
>> pragma target USBDIVP2  -- CLOCK_SRC_FROM_96MHZ_PLL_2
>> pragma target OSC   HS_PLL
>> pragma target FCMEN DISABLED
>> pragma target IESO  DISABLED
>> pragma target PWRTE DISABLED-- power up timer
>> pragma target VREGENENABLED -- USB voltage regulator
>> pragma target VOLTAGE   V21 -- brown out voltage
>>
>> pragma target BROWNOUT  DISABLED-- no brownout detection
>> pragma target WDTPS P32K-- watch dog saler setting
>> pragma target WDT   CONTROL -- watchdog software controlled
>> pragma target CCP2MUX   pin_C1  -- CCP2 on pin C1
>> pragma target PBADENDIGITAL -- digital input port<0..4>
>> pragma target LPT1OSC   LOW_POWER   -- low power timer 1
>> pragma target MCLR  EXTERNAL-- master reset on RE3
>> pragma target STVR  DISABLED-- reset on stack over/under flow
>> pragma target LVP   ENABLED -- allow low-voltage programming
>>
>> pragma target XINST DISABLED -- extended instruction set
>> pragma target DEBUG DISABLED-- background debugging
>> pragma target CP0   DISABLED-- code block 0 not protected
>> pragma target CP1   DISABLED-- code block 1 not protected
>> pragma target CP2   DISABLED-- code block 2 not protected
>> pragma target CP3   DISABLED-- code block 3 not protected
>> pragma target CPB   DISABLED-- bootblock code not write
>> protected
>> pragma target CPD   DISABLED-- eeprom code not write protected
>> pragma target WRT0  DISABLED-- table writeblock 0 not
>> protected
>> pragma target WRT1  DISABLED-- table write block 1 not
>> protected
>> pragma target WRT2  DISABLED-- table write block 2 not
>> protected
>> pragma target WRT3  DISABLED-- table write block 3 not
>> protected
>> pragma target WRTB  DISABLED-- bootblock not write protected
>> pragma target WRTD  DISABLED-- eeprom not write protected
>> pragma target WRTC  DISABLED-- config not write protected
>> pragma target EBTR0 DISABLED-- table read block 0 not
>> protected
>> pragma target EBTR1 DISABLED-- table read block 1 not
>> protected
>> pragma target EBTR2 DISABLED-- table read block 2 not
>> protected
>> pragma target EBTR3 DISABLED-- table read block 3 not
>> protected
>> pragma target EBTRB DISABLED-- boot block not protected
>>
>> WDTCON_SWDTEN = OFF -- disable watchdog
>>
>> const USB_INTERRUPT_DRIVEN = TRUE
>> include delay
>> include usb_serial
>> include print
>>
>>
>> -- constants
>> const  byte str_welcome[] = "JALLIB USB Serial Demo app\n"
>>
>> -- variables
>>
>> -- interrupts? No thanks
>> -- INTCON_GIE = false
>>
>>
>> -- setup the USB serial library
>> usb_serial_init()
>>
>> var bit has_shown_welcome_msg = true
>> var byte ch
>>
>> delay_1s (5)
>>
>> -- main loop
>> forever loop
>>
>> if !defined(USB_INTERRUPT_DRIVEN) then
>>   -- When the interrupt mode is not used we need to poll the usb ISR
>> function
>>   -- on a regular base, in 

[jallib] [jallib/jallib] 89fd3b: Added new device files and blink samples.

2022-12-17 Thread 'Rob Jansen' via jallib
  Branch: refs/heads/master
  Home:   https://github.com/jallib/jallib
  Commit: 89fd3b750b1fa846373bca0f592c8febbf31fa9d
  
https://github.com/jallib/jallib/commit/89fd3b750b1fa846373bca0f592c8febbf31fa9d
  Author: Rob Jansen <12682653+robjanse...@users.noreply.github.com>
  Date:   2022-12-17 (Sat, 17 Dec 2022)

  Changed paths:
M CHANGELOG
M TORELEASE

  Log Message:
  ---
  Added new device files and blink samples.

for 16f18015, 16f18025, 16f18044, 16f18045,


-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jallib+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/jallib/jallib/push/refs/heads/master/ebd400-89fd3b%40github.com.


Re: [jallib] Re: For Loop Issue

2022-12-17 Thread Rob CJ
Hi Filip,

The problem with these kind of issues is finding the reproduction scenario. I 
made one and found indeed a problem which might be a compiler issue.

Attached you find a test program that I made to reproduce your issue. There are 
6 test and test number 5 goes wrong (when counter is not equal to 0) and a 
workaroud is given in test 6 by using a temporary variable. The output of test 
5 and test 6 should have been the same but it is not, see screenshot below.

[cid:78423049-8124-4154-9d1d-ada2a50e63cc]

I need to analyze this further to see where the compiler goes wrong. For now 
your problem could be fixed by using a temporary variable. Please give it a try 
and let me know if it solves your problem.


Thanks.

Kind regards,

Rob


Van: jallib@googlegroups.com  namens flyway38 

Verzonden: vrijdag 16 december 2022 22:46
Aan: jallib 
Onderwerp: Re: [jallib] Re: For Loop Issue

Missed this information above.
n goes from 0 to something like 20, and nSmsCenterPhone is also a byte and 
assumes 12 in this case.


On Friday, December 16, 2022 at 9:41:07 PM UTC flyway38 wrote:
Hi Rob,

Thanks for your support.
Both vars are bytes.

Cheers,
FS

On Friday, December 16, 2022 at 6:52:05 PM UTC rob...@hotmail.com wrote:
Hi Filip,

No idea. I need to see if I can reproduce this.

Of what type are Index and n? What is the value of n?

Thanks

Kind regards,

Rob


Van: jal...@googlegroups.com  namens flyway38 

Verzonden: vrijdag 16 december 2022 19:34
Aan: jallib 
Onderwerp: [jallib] Re: For Loop Issue

Heres the issue in a different form:
This code works:
  for nSmsCenterPhone+1 using Index loop
  SmsCenterPhone[Index]=data_eeprom(Index+n)+48
  end loop
  SmsCenterPhone[0]=data_eeprom(n)-- Insert "+" @[0]

This should work and the same, but no... it doesn't work.
  SmsCenterPhone[0]=data_eeprom(n)-- Insert "+" @[0]
 for nSmsCenterPhone using Index loop
  SmsCenterPhone[Index+1]=data_eeprom(Index+n+1)+48
  end loop

Very odd issue.
Any ideas?
Thank you.

Cheers,
FS
On Friday, December 16, 2022 at 6:15:16 PM UTC flyway38 wrote:
Hello all,

Have found an odd issue.
Maybe me not doing it right, but need to ear from you about it.
Here's the code:

  for nSmsCenterPhone using Index loop
  SmsCenterPhone[Index+1]=data_eeprom(Index+n)+48
  end loop

Situation is; I need to start filling array SmsCenterPhone[20] starting from 
2nd byte [1].
It fails and don't understand why.
EEprom data is ok. Have double checked it.
Have found that it works if I don't add +1 do Index to SmsCenterPhone[Index+1], 
but would like to understand why this is happening.
Thank you very much.

Kind regards,
Filipe Santos

--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jallib+un...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/a5e8729b-7dc4-4f2d-904f-7950f3b3d05cn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jallib+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/adb14af6-a36e-4440-9c9d-14d69514636fn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jallib+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/GVXP195MB1637CA9F2DBE49FAB7B1C589E6E79%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM.


16f1825_index_problem.jal
Description: 16f1825_index_problem.jal


Re: [jallib] USB_help

2022-12-17 Thread Rob CJ
Hi Vasile,

Thanks for the update. I can add a sample for the PIC18F4550 to the new Jallib 
release.

@Hans. Can you send the version that works OK?

Thanks.

Kind regards,

Rob


Van: jallib@googlegroups.com  namens vsurducan 

Verzonden: zaterdag 17 december 2022 08:00
Aan: jallib@googlegroups.com 
Onderwerp: Re: [jallib] USB_help

It seems to me that flushing was the problem. It works with interrupts but jal 
1.7.0 seems to not have the usb serial interrupt sample for pic18f4550?

That delay is ok if you program the pic while is connected to usb. It tooks a 
while until pc see the pic, but that depends on pc, os, etc. If you send only 
once a text (as the sample is), there are big chances to not see it on pc.


On Fri 16 Dec 2022, 9:02 PM Rob CJ 
mailto:rob...@hotmail.com> wrote:
Hi Hans, Vasile,

What has been changed that it now works?

If I look at the setting for the chip I do not see a difference with the 
program that Hans had sent before.

I see in the program below a delay of 5 seconds but that will cause a problem.

There are two ways to use the USB library, without interrupt (which used to be 
the only way to use it) and with interrupt.

If you use it without interrupt you have to call the usb_serial_flush() routine 
regularly otherwise the USB wil stop working.

If you cannot serve this function regulary then you should use the library in 
the mode that is uses the interrupt which I see is being used in the last 
example.

If this 5 seconds delay was in the previous program then that may have caused 
the USB problem.

Kind regards,

Rob


Van: jallib@googlegroups.com 
mailto:jallib@googlegroups.com>> namens hans 
mailto:hanze...@zeelandnet.nl>>
Verzonden: vrijdag 16 december 2022 18:52
Aan: jallib mailto:jallib@googlegroups.com>>
Onderwerp: Re: [jallib] USB_help

Hello Vasile
I have always worked as you indicated. Program, unplug everything and then plug 
it back in. prompt response that the case was not recognized. See my previous 
message.
Now your latest version, does nothing at all. Loaded the previous version again 
and it works as stated before.
regards
Hans

Op vrijdag 16 december 2022 om 18:07:52 UTC+1 schreef vasile:
Hans,
I think you are doing in this way:
1. USB connection is kept permanently between your board and PC
2. your board is programmed with pickit and after programming you expect to see 
immediately the pic USB device in your PC
right?

After programming you have to disconnect your PC from USB and connect it again, 
wait a bit until the computer sees your device.
I think the original sample will work in this way, however below is the the 
sample (using interrupts) which should work without disconnecting your PIC from 
USB after programming ( please note I did not tested, no PIC18F4450 or PIC2550 
available now).

Finally you may comment the 5s delay if you wish, but you may loss the " JALLIB 
USB Serial Demo" string.
Hopefully will work for you.

-- ---
include 18f4550


-- even though the external crystal is 20 MHz, the configuration is such that
-- the CPU clock is derived from the 96 Mhz PLL clock (div2), therefore set
-- target frequency to 48 MHz
pragma target clock   48_000_000


-- fuses
pragma target PLLDIVP5  -- divide by 5 - 20MHZ_INPUT
pragma target CPUDIVP1  -- [primary oscillator src: /1][96 mhz 
pll src: /2]
pragma target USBDIVP2  -- CLOCK_SRC_FROM_96MHZ_PLL_2
pragma target OSC   HS_PLL
pragma target FCMEN DISABLED
pragma target IESO  DISABLED
pragma target PWRTE DISABLED-- power up timer
pragma target VREGENENABLED -- USB voltage regulator
pragma target VOLTAGE   V21 -- brown out voltage

pragma target BROWNOUT  DISABLED-- no brownout detection
pragma target WDTPS P32K-- watch dog saler setting
pragma target WDT   CONTROL -- watchdog software controlled
pragma target CCP2MUX   pin_C1  -- CCP2 on pin C1
pragma target PBADENDIGITAL -- digital input port<0..4>
pragma target LPT1OSC   LOW_POWER   -- low power timer 1
pragma target MCLR  EXTERNAL-- master reset on RE3
pragma target STVR  DISABLED-- reset on stack over/under flow
pragma target LVP   ENABLED -- allow low-voltage programming

pragma target XINST DISABLED -- extended instruction set
pragma target DEBUG DISABLED-- background debugging
pragma target CP0   DISABLED-- code block 0 not protected
pragma target CP1   DISABLED-- code block 1 not protected
pragma target CP2   DISABLED-- code block 2 not protected
pragma target CP3   DISABLED-- code block 3 not protected
pragma target CPB   DISABLED-- bootblock code not write protected
pragma target CPD   DISABLED-- eeprom code