USART+PWM Problem


Closed Thread
Results 1 to 40 of 44

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by alex-x View Post
    Yes we canmake it so as a 1 chanel and workşng no problem but if i want to use it 4 or 8 chanel then i will need a pwm and pic has max 3 pwm no more how can we use and make other chanels pwm if i want to use 5 chanel dmx data for led inensty?Then i will need more pwm and i have to make it with code i think*
    SSPWM...already been mentioned here...in this thread...

  2. #2
    Join Date
    May 2007
    Posts
    16


    Did you find this post helpful? Yes | No

    Default usart

    SSPWM ??

    how is it?

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by alex-x View Post
    SSPWM ??

    how is it?
    Did you search for it yet?

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


    Did you find this post helpful? Yes | No

    Default

    Steve

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

  5. #5
    Join Date
    May 2007
    Posts
    16


    Did you find this post helpful? Yes | No

    Default usart

    @mister_e thanks i will try it

  6. #6
    Join Date
    May 2007
    Posts
    3


    Did you find this post helpful? Yes | No

    Exclamation dmx protocol

    Hi , i tryed this code but it is not working as a pwm for led
    where is the problem?

    is it here ? How can we use newlevel1 as a pwm value?

    "" pwm portc.2, newlevel1 ,100 'i want dimming a LED on PORTC.2"""




    ************************************************** *******
    ************************************************** *******

    DEFINE OSC 20
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_SPBRG 4
    DEFINE HSER_BAUD 250000
    DEFINE HSER_CLROERR 1



    counter VAR word
    idleflag VAR WORD
    dummy VAR WORD
    RCIF VAR byte
    startcode VAR WORD
    aminus VAR WORD
    adresse_grada VAR WORD
    x VAR WORD
    newlevel1 VAR WORD
    ADCON0=0
    ADCON1=7
    adresse_grada = 2


    checkdmx:

    counter = 1
    pulsin portc.7,0,counter
    if counter = 0 then
    idleflag = 1
    endif


    if counter < 40 then checkdmx

    dummy = RCREG
    dummy = RCREG
    SPBRG = 0
    TXSTA.2 = 0 'brgh = 0
    TXSTA.4 = 0
    RCSTA.7 = 1
    RCSTA.6 = 0
    RCSTA.4 = 0
    RCSTA.4 = 1

    while RCIF = 0:wend

    startcode = RCREG

    if startcode <> 0 then checkdmx

    aminus = adresse_grada - 1

    for x = 1 to aminus
    while RCIF = 0:WEND
    dummy = RCREG
    next x

    newlevel1 = RCREG
    pwm portc.2, newlevel1 ,100 ' HERE PROBLEM I THINK
    RCSTA.7 = 0

    goto checkdmx
    return

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


    Did you find this post helpful? Yes | No

    Default

    Hi and welcome on the forum.

    1. Those DEFINE's HSER_xxxx are not needed if you're not using HSERIN.

    2. it look like another DMX routine to me

    What's working and what doesn't?

    Do you understand the DMX protocol?

    How about your schematic, configuration fuses, PIC#?
    Steve

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

  8. #8
    Join Date
    Dec 2008
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by alex-x View Post
    SSPWM ??

    how is it?
    MiBAM is much smoother (personal opinion). You can dim 24 pins with very little processing power. Send the value and it retains it until you change it.

Similar Threads

  1. Variable PWM PIC18F2431
    By trr1985 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th June 2009, 06:03
  2. byte Tx w/ USART 16f876a problem
    By GargamelDigi in forum mel PIC BASIC
    Replies: 2
    Last Post: - 15th July 2008, 05:50
  3. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  4. problem with USART
    By leemin in forum Serial
    Replies: 4
    Last Post: - 11th December 2006, 17:56
  5. PWM problem CCP2 port
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 19th September 2006, 23:34

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