arghhh pic16f1825 s'eusart is turning me crazy


+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    jyb
    Guest jyb's Avatar

    0 Not allowed!

    Default arghhh pic16f1825 s'eusart is turning me crazy

    hi all
    need help fom seasoned member
    i use a 16f1825 (14pins) all pins are occupied but i would utilize RA0 & RAI from ICSP header
    and the pickit2 uart tool . my target is to display data and register contains for debugging on my pc screen.the routine i wrote seems running but what i get is only jam . i verified wiring, baud speed, 8bits,no parity, stopbit,start level, switch bit to ra0/ra1 ... same on pc side, unsuccesfully
    on otherhand i dont understand the difference between serout,hserout and other command like .
    i certainly miss some declaration somewhere but don't find
    what i would is that somebody indicate me the paradise way showing a verified routine as example
    thanks by advance

    ps: i beg your pardon for my bad English

    jyb

Attention
×

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,135
    Thumbs Up
    Received: 66
    Given: 26
    Total Downloaded
    3.31 GB

    0 Not allowed!

    Default Re: arghhh pic16f1825 s'eusart is turning me crazy

    Well, the obvious question is if you have setup and connected the pickit2 according to the guidelines for the logic tools.

    The 'default' TX for your device is pin 6, but since you want to use ra0, you'll have to set bit TXTKSEL (bit 2) of APFCON0 to use ra0.
    However, I'm not 100% sure if HSerout is capable of handling configurable pins. So you might have to look in the assembler listing and see which pin is used.
    If it does not handle this, or if you want to use ra1, you'll have to use Serout.

    Regards,
    Harm

  • Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #3
    jyb
    Guest jyb's Avatar

    0 Not allowed!

    Default Re: arghhh pic16f1825 s'eusart is turning me crazy

    thanks hadv215
    you are right it's exactly what i think : i miss some parameter in fuses or declares or..?

    i tried also APPFCON0 bit 2 for same result : jam displayed on pc screen
    i made a routine sending 'hello" text to RA0 when i press a switch .it runs correctly , a string is displayed each time i press the switch but what i get is tens question marks on ascii decoding or 80 00 in hexa. it make me think to an empty string or something like...i 'm searching what happen
    a big help should be to look at an existing and valid routine to take example........
    thanks a lot
    jyb

  • Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #4
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,135
    Thumbs Up
    Received: 66
    Given: 26
    Total Downloaded
    3.31 GB

    0 Not allowed!

    Default Re: arghhh pic16f1825 s'eusart is turning me crazy

    The symptoms indicate a mismatch of the settings.
    When dealing with (E)U(S)ART you'll always have to be sure the settings of the device match that of the PC.
    You don't show us any of your declares/code, so it's impossible to tell if you're missing something.

    The manual contains examples with valid settings.

  • Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #5
    jyb
    Guest jyb's Avatar

    0 Not allowed!

    Default Re: arghhh pic16f1825 s'eusart is turning me crazy

    hi hadv215

    with my first message i tried to join my code an declarations but all i got is error message when uploading basic pds file
    and i did not took time to understand the reason of error issue

    well it seems i found the way to join basic text with message
    this is just the transmit part code of the whole program
    it give same jam results as the original prog

    '************************************************* ***************
    '* Name : UNTITLED.BAS *
    '* Author : jy BELTRA *
    '* Notice : Copyright (c) 2013 [select VIEW...EDITOR OPTIONS] *
    '* : All Rights Reserved *
    '* Date : 12/06/2013 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '************************************************* ***************
    Device 16F1825
    Declare Xtal = 4 'frequence chip
    Declare Hserial_Baud 4800
    Declare Hserial_RCSTA = %10010000 ' Enable continuous receive
    Declare Hserial_TXSTA = %00100100 ' Enable transmit and asynchronous mode
    Declare Serial_Data 8 ' Set Serout and Serin data bits to 8 (default)
    'Declare Hserial_Parity = 0' Use if even parity desired
    Declare Hserial_Clear On
    OPTION_REG = %10000010
    Config1 FOSC_INTOSC,WDTE_off,PWRTE_off,MCLRE_OFF,CP_OFF,CP D_OFF,BOREN_OFF,CLKOUTEN_OFF, IESO_OFF,FCMEN_OFF
    Config2 LVP_OFF,PLLEN_ON,WRT_Off

    '*********************************CONFIGURATION DES FUSIBLES****************************************** ********
    'CONFIG DES PORTS
    '1 logique = entrée 0 logique = sortie
    Clear PORTA : Clear LATA : Clear ANSELA : Clear TRISA : Clear PORTC :Clear LATC : Clear ANSELC : Clear TRISC
    Clear OPTION_REG.7 'valides programmation des pullups
    '************************************************* ************************************************** *********
    'CONFIG CONVERT ADC
    ADCON1 = %11110000 'prepares systeme ADC
    ADCON0 = %10010001 'valides le CAN4
    '************************************************* ************************************************** *********
    'CONFIG EUSART
    APFCON0.7=1 'RX/DT sur RA1
    APFCON0.2=1 'TX/CK sur RA0
    ' TXSTA .7=0 'inutilisé
    ' TXSTA .6=0 '=8bits transmis
    ' TXSTA .5=1 'autorise emission
    ' TXSTA .4=0 'mode asynchrone
    ' TXSTA .3=1 'envoi un break avant emission
    ' TXSTA .2=1 'vitesse tr basse
    ' TXSTA .1=1 'lecture buffer transmit vide
    ' TXSTA .0=0 '
    ' 'rcsta.0= 'lecture seule bit9
    ' RCSTA .3=0 'bit 9 reçu inutile
    ' RCSTA .4=1 'autorise reception
    ' RCSTA .5=0 's'en fout (synchrone)
    ' RCSTA .6=0 '8 bits attendus
    ' RCSTA .7=1 'port reception validé
    ' Declare Hserial_RCSTA
    'Declare Hserial_TXSTA 24
    '************************************************* ************************************************** *********
    'CONFIG BAUDS
    BAUDCON.4=0 'inversion niveau el ligne
    BAUDCON.3=0 'generateur bauds 8 / 16 bits
    Dim TEXT As String *26 'creation variable texte de longueur 10 car
    Symbol BUZZ = PORTA.4 'sortie buzz sur pin 3 port RA4 buzzer
    Clear TRISA.4 'RA4 est une sortie logique
    Symbol TRACK = PORTC.2 'entree ack sur pin 8 port RC2
    Set TRISC.2 'RC2 est une entrée logique
    Set INLVLC.2 'valides le schmitt trigger
    Set WPUC.2 'valides le pullup
    deb:
    If TRACK = 0 Then Sound BUZZ ,[127,1] : GoSub serial 'valides le mode debug
    GoTo deb
    serial:


    TEXT = "hello world"
    SerOut PORTA.0,188,["hello world"]
    'Serout Tpin { \ Fpin }, Baudmode, { Pace, } { Timeout, Tlabel, } [ OutputData ]
    ' hSerout PORTA.0, 16780, [65,66,67,68,69,6A]
    Return

  • Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #6
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,135
    Thumbs Up
    Received: 66
    Given: 26
    Total Downloaded
    3.31 GB

    0 Not allowed!

    Default Re: arghhh pic16f1825 s'eusart is turning me crazy

    You have declares that read 'HSerial', but you use 'SerOut'. That does not match.
    I don't know if it matters because Serout uses software serial communication and probably does not look at these declares.
    BAUDCON should not be used for the same reason.

    But the instruction looks ok to me, it says the same in the manual.

  • Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

       

    Similar Threads

    1. Scaling problems has my head turning to gray goo
      By Tim in forum Proton Plus Compiler v3
      Replies: 6
      Last Post: 11th April 2016, 08:28
    2. HPWM declare problem PIC16F1825
      By RayEllam in forum Proton Plus Compiler v3
      Replies: 1
      Last Post: 25th November 2015, 08:33
    3. PIC16f1825 and HPWM
      By Jezsmith in forum Proton Plus Compiler v3
      Replies: 0
      Last Post: 29th March 2015, 14:22
    4. Hardware PWM - turning off?
      By shunt010 in forum Proton Plus Compiler v3
      Replies: 1
      Last Post: 26th November 2005, 22:34

    Members who have read this thread since 25th November 2019, 18:17 : 0

    Actions :  (Set Date)  (Clear Date)

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

    Tags for this Thread

    Posting Permissions

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