Serout/Serout2 and PIC18F97J60 (100 pin)


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest

    Default

    Code:
    SEROUT2 LCD, 84, ["Hello World",13,10]

  2. #2
    Join Date
    Aug 2006
    Location
    Italy
    Posts
    72

    Default Still does not work...

    Thank you Skimask and Mikendee.
    I've already tested the code putting 84 instead of N9600, but nothing.
    Actually I modified the program in order to increase a BYTE sized variable "instead" of the 84.
    So, pressig one button, I get that variable increased by 1 (and toggle a led).
    Pressing another button I get that variable decreased by 1 (and toggle the same above led).

    The loop is working because I see the toggling of the LED each time I press some button (debounced as well), but still nothing good...
    Code:
    DEFINE OSC 25                      'Set the Crystal Clock speed
    INCLUDE "modedefs.bas"          'Inline compiler's pre-defined constants
    ADCON0 = 0                          'AD converter module 0 = disabled
    ADCON1 = %00001111            'Set all analog pins to digital
    ADCON2 = %00000000
    CMCON  = %00000111            'Comparator = disabled
    INTCON = %00111000
    INTCON2 = %10000000
    INTCON3 = %00000000
    RCON.7 = %00000000
    EECON2.5 = 0                       'Ethernet Module Disabled
    SSP1CON1.5 = 0                   'Disable SPI 1 and set pins as GPIO
    SSP2CON1.5 = 0                   'Disable SPI 2 and set pins as GPIO
    TRISD.7 = 0                         'PortD7 = RS-232 TX output for Display
    serSpeed        var byte
    
        serspeed = 84
    TestLoop:
        serout2 PortD.7, SERSPEED, ["SerSpeed=", dec serSpeed,13,10]
        if SW_ManualReset = 0 then
            pause 10
            if sw_manualreset = 0 then
                LED_what = ~ LED_what
                serspeed = serspeed - 1
            endif
            while sw_manualreset = 0
            wend
            LED_what = ~ LED_what
        endif
        if SW_PWR_On_Off = 0 then
            pause 10
            if SW_PWR_On_Off = 0 then
                LED_what = ~ LED_what
                serspeed = serspeed + 1
            endif
            while sw_pwr_on_off = 0
            wend
            LED_what = ~ LED_what
        endif
        pause 500
        goto TestLoop
    After the first weird sending then the PortD.7 pin is just muted.
    No other sending even if the loop is still going. Actually if I press one of the buttons, I see that the led is toggling.

    Same result if I change on any pin on PortC.
    Of course, neighter Serin/Serin2 work...

    I submitted the issue to Melabs too.

    Any idea in the meanwhile?

  3. #3
    skimask's Avatar
    skimask Guest

    Default

    Time to break it down...
    Does the old blinky LED program blink at the proper rate?
    Code:
    led var portd.7 : output led
    main: led = 1 : pause 500 : led = 0 : pause 500 : goto main
    1 second blinks?

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    ..........never mind......................
    Last edited by mister_e; - 19th May 2008 at 17:22.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Aug 2006
    Location
    Italy
    Posts
    72

    Default Something is working now...

    Thank you Skimask,
    is exactly what I did last night.
    Conclusion:
    The chip is FRIED!
    There is something wrong with the PortD and PortC.
    Actually a new board with another chip it work properly!

    My apologises...

    I've also apologized with MeLabs... even if I submitted another issue to them.
    The new (old) one is related to the fact that the PIR1.5 register seems never find a character in the buffer even if I know that is sure there.
    DEFINE HSER_CLROERR 1 and DEFINE HSER2_CLROERR 1 are both at the top of the program.
    Things start going bad if I use some I2C command and then inquiry the PIR1.5
    What I do not understand is that inquiring PIR3.5 (for the other attached device), it work regularly at any speed (between 2400 and 115200)
    the only way to get data from the device attached is to use HSerin with a timeout of 10ms...
    If I DON'T USE any I2C commands, both PIR1.5 and PIR3.5 reflect the correct data and behaviour...
    I've already posted this strange things in a more detailed post:
    http://www.picbasic.co.uk/forum/showthread.php?t=8638

    Thank you all guys.
    Hope in some hint...
    Last edited by mikebar; - 20th May 2008 at 05:04. Reason: Forgot greetings...

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    That's weird... i'll order few sample of this chip just for fun...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Aug 2006
    Location
    Italy
    Posts
    72

    Default

    Mister-e,
    thank you very much for your curiosity.
    Be prepared. The package IS EXTREMELY SMALL!

    Let me know if you discover sothing.

    Thank you again.

Similar Threads

  1. HSERIN2 not working on PIC18F97J60 ???
    By mikebar in forum Serial
    Replies: 8
    Last Post: - 4th May 2008, 16:20

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts