But better read this topic instead (all of it)
http://www.microchip.com/forums/m106426.aspx


On Thu, Jul 31, 2014 at 7:56 AM, vasi vasi <[email protected]> wrote:

> http://www.internetking.org/fsusb/
>
>
> On Thu, Jul 31, 2014 at 5:14 AM, Jim Gregory <[email protected]>
> wrote:
>
>> Yes, I've tried both jalv2.4q2 (both stable and "bee'), jalv2.4p9, even
>> jalv2.4o-0.7.1.  Same results on all of them.
>>
>> I've also tried uploading the script using both Albert Faber's original
>> jallib USB bootloader application UsbBootLoader.py, as well as Seb's
>> adaptation of it.  I got the same results both times.  (Why is this no
>> longer included in the jallib project sample, BTW?  I find it really
>> useful!)
>>
>> Compiling '18f14k50_usb_serial.jal using:
>>
>> /home/jim/uc/pic/jal/compiler/jalv2 -no-asm -no-codfile -no-fuse
>> -loader18 2048 -s /home/jim/uc/pic/jal/lib 18f14k50_usb_serial.jal
>>
>> and then flashing the hex file using:
>>
>> python UsbBootLoader.py -x -v write 18f14k50_usb_serial.hex
>>
>> results in screenfuls of garbage characters as it continually attempts to
>> print the line "JALLIB USB Serial Demo app\n"
>>
>> Seems like the problem is in either the bootloader or the
>> UsbBootLoader.py application.  I'm compiling the bootloader using:
>>
>> /home/jim/uc/pic/jal/compiler/jalv2 -no-asm -no-codfile -s
>> /home/jim/uc/pic/jal/lib autostart_usb_bootloader_18f14k50.jal
>>
>>  Are there any other flags I should be including?  Are there any other
>> Linux-compatible uploading applications compatible with the bootloader
>> you'd recommend?
>>
>> -Jim
>> P.S.  Just tried re-compiling the sample 18f14k50_usb_serial.jal without
>> the bootloader flags and uploading it using my PICKit2, but got the same
>> screenfuls of garbage characters.  Now I'm not sure what's wrong....:(
>>
>>
>> On Wednesday, July 30, 2014 8:34:32 PM UTC-5, mattschinkel wrote:
>>>
>>> Did you try with version jalv2.4q2 ?
>>>
>>> Matt.
>>>
>>> On Tuesday, July 29, 2014 6:08:14 AM UTC-4, Jim Gregory wrote:
>>>>
>>>> The problem with the print_string function is somehow due to the
>>>> bootloader, because if I upload the program using a PICKit2 the
>>>> print_string function works as expected (although I still can't reconnect
>>>> after disconnecting).
>>>>
>>>> On Monday, July 28, 2014 6:24:43 AM UTC-5, Jim Gregory wrote:
>>>>>
>>>>> -- chip setup
>>>>> include 18f14k50
>>>>>
>>>>> -- target frequency to 48 MHz
>>>>> I am experiencing strange behavior with the print_string() function
>>>>> using usb_serial and an 18f14k50 and jalv2.4q and jallib version 1.0.0.
>>>>> With the following code:
>>>>>
>>>>> pragma target clock       48_000_000
>>>>>
>>>>> -- no fuses (use bootloader)
>>>>> pragma BOOTLOADER loader18  2048
>>>>> pragma fuses no
>>>>>
>>>>> const byte str_welcome[] = "Hi there"
>>>>> var byte i           -- temporary variable
>>>>>
>>>>> forever loop
>>>>>    -- poll the usb ISR function on a regular base, in order to
>>>>>    -- serve the USB requests
>>>>>    usb_serial_flush()
>>>>>
>>>>>     -- check if USB device has been configured by the HOST
>>>>>    if ( usb_cdc_line_status() !=  0x00 )  then
>>>>>       if !has_shown_welcome_msg then
>>>>>          has_shown_welcome_msg = true
>>>>>          print_string( usb_serial_data, str_welcome )
>>>>>          print_crlf( usb_serial_data )
>>>>>       end if
>>>>>    else
>>>>>       has_shown_welcome_msg = false
>>>>>    end if
>>>>>
>>>>>    -- check for input character
>>>>>    if usb_serial_read( ch ) then
>>>>>       -- echo input character
>>>>>       usb_serial_data = ">"
>>>>>       usb_serial_data = ch
>>>>>       print_crlf( usb_serial_data )
>>>>>    i  print_string( usb_serial_data, str_welcome )
>>>>>       print_crlf( usb_serial_data )
>>>>>       blink_led(green)
>>>>>    end if
>>>>> end if
>>>>>
>>>>> Under Linux, it prints 3 unprintable characters when a serial
>>>>> connection is established and each time a key is pressed.  Under Windows 
>>>>> 8,
>>>>> it prints the correct string.
>>>>>
>>>>> If I replace the print_string() function calls by explicitly looping
>>>>> through the array, i.e.:
>>>>>
>>>>>       ;print_string( usb_serial_data, str_welcome )
>>>>>       for 8 using i loop
>>>>>          usb_serial_data = str_welcome[i]
>>>>>       end loop
>>>>>
>>>>> The string prints normally on both Linux and Windows 8.
>>>>>
>>>>> Furthermore, if I close the serial terminal and try to re-establish a
>>>>> connection under either Linux or Windows, I can't reconnect regardless of
>>>>> which code I use.  Under Linux, I receive the error message:
>>>>>
>>>>> tty_port_close_start: tty->count = 1 port count = 0.
>>>>>
>>>>> It won't reconnect without manually resetting the 18f14k50.
>>>>>
>>>>> I suspect the two problems are related, but am not sure....:(
>>>>>
>>>>  --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/jallib.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Vasi
>



-- 
Vasi

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to