USART+PWM Problem


Closed Thread
Results 1 to 40 of 44

Hybrid View

  1. #1
    Join Date
    Nov 2004
    Posts
    61


    Did you find this post helpful? Yes | No

    Default DMX512 Source Code

    Turns out that a few months ago, Microchip posted app notes for

    * DMX512 transmission
    * DMX512 reception
    * Software-based 3 color PWM generation

    Granted, it's all written in assembly. And it may not be quite as user-friendly to PBP newbies as DT's Instant Interrupts / SSPWM (very nice, BTW!).

    But they can gather all 512 channels of dimmer data in 27 lines of .asm code. Pretty neat!

    It's elegantly written, very compact and fairly easy to follow. Their write-up on DMX gives a nice overview of the various stages of the signal and what the processor needs to do during each.

    Their trick for generating the break signal on the transmit side is nice, too.

    Their DMX receive code is *not* interrupt based, but the PWM routine is.

    Check out notes #1074 and #1076

    Link:

    http://www.microchip.com/stellent/id...GE&nodeId=2048

    Best,

    JEC

  2. #2
    Join Date
    May 2007
    Posts
    16


    Did you find this post helpful? Yes | No

    Default dmx

    Dear JEC ;
    i looked to that site but all codes are in asm i need in PBP if i can make it better for me .really i want to make it by myself since a week and i know it is not so good to want code from peoples but really i dont know anything about the this commination in picbasicpro

    i read many documents and some code too but all in asm they explain everything in assembly language and when i want to make same thing in pbp then i have problem on interupts i think how can i solve it*?

    i have seen your code in the forum and copyed it for my devices but couldnt make it yet your code was for "'F88 @ 16 MHz" but i have f877 and 20 mhz osc the code that what i posted here it is your code .do you have some example for me in picbasicpro only for beginner i need only led intensty
    ( PWM ) nothing more i tryed it like this small code too before but also problem (i look for adres on dipsw)


    ' PIC16F876 + 20 MHz
    DEFINE OSC 20
    @ DEVICE HS_OSC

    DEFINE HSER_BITS 9
    DEFINE HSER_RCSTA 208
    DEFINE HSER_TXSTA 101
    DEFINE HSER_BAUD 250000
    DEFINE HSER_CLROERR 1

    SYMBOL IN =PORTC.0
    SYMBOL LED =PORTC.3 'LED

    INPUT IN

    TMP VAR WORD
    TMP1 VAR WORD
    VALORE VAR byte[8]
    BREAK VAR WORD
    NDMX VAR WORD
    DATI VAR WORD
    Clear

    ADCON0=0
    ADCON1=7

    OPTION_REG.7=0
    FOR TMP=0 TO 10
    TOGGLE LED
    PAUSE 200
    NEXT TMP
    LOW LED

    MAIN:

    NDMX=0
    NDMX.0=PORTA.1
    NDMX.1=PORTA.0
    NDMX.2=PORTB.7
    NDMX.3=PORTB.6
    NDMX.4=PORTB.5
    NDMX.5=PORTB.4
    NDMX.6=PORTB.3
    NDMX.7=PORTB.2
    NDMX.8=PORTB.1
    NDMX.9=PORTB.0

    ndmx = ndmx ^ %0000001111111111
    DATI=0
    PULSIN in,0,break

    IF BREAK>=44 THEN

    HSERIN 2000,MAIN,[tmp,tmp1]
    if tmp<>0 and tmp1<>0 then
    goto main
    endif

    FOR TMP=1 TO ndmx
    HSERIN 10,main,[tmp1]
    NEXT TMP

    FOR tmp=1 TO 64
    hserin 10,EXIT,[VALORE[tmp]]
    DATI=DATI+1
    NEXT TMP

    EXIT:
    FOR TMP=1 TO DATI
    VALORE[TMP]=VALORE[TMP]/4
    NEXT TMP

    '---------- here code that what i want to make for leds -----------------



    ENDIF


    GOTO MAIN

  3. #3
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post

    Yeah - I think you're trying to bite off a bit more than you can chew. Better to start with something a bit simpler and gradually progress your skills along the way.

  4. #4
    Join Date
    May 2007
    Posts
    16


    Did you find this post helpful? Yes | No

    Smile dmx

    :-) thanks

    i have made many projects with pic but dmx is not like "led open or close"
    it is different

    i wait answer only who knows about the dmx and who can help me to solve this problem and if you want i pay too

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by alex-x View Post
    :-) thanks

    i have made many projects with pic but dmx is not like "led open or close"
    it is different

    i wait answer only who knows about the dmx and who can help me to solve this problem and if you want i pay too
    It's not a matter of money...but if that's the way you want to go...so be it...
    Do you know what a good software developer charges for those services these days? It's not cheap for a good, reliable, bug-free product...
    (quite frankly neither do I...I've been paid for services before, but nothing with a contract, just a 'gentleman's agreement)
    Looks like this is one that gets fed the corn and never learns to farm...
    Last edited by skimask; - 16th May 2007 at 14:18.

  6. #6
    Join Date
    May 2007
    Posts
    16


    Did you find this post helpful? Yes | No

    Default dmx

    it is ok friends , thanks for everything
    i decided to buy a small device for me
    Last edited by alex-x; - 16th May 2007 at 19:03. Reason: x

  7. #7
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Jec, good find thanks for the info!

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