bad expression error, linking addresses incorrectly.


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    also when i try and look at some of the threads that rorchach, or whatever his name is has posted in my antivirus keeps stopping me... i keep getting attacked by a trojan horse in those threads... not sure if anyone else has got this? but it keeps happening to me only on those recent threads.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Those threads and the Spammer have been killed.

  3. #3
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    ok doesnt look like anyone could help me before.. but i have a new question regarding the 2431.

    ive been trying to get a pwm output using the following code:

    Duty Var Word

    PORTB = 0 ' clear port latch
    TRISB = %11000000 ' PWM0,1,2,3,4,5 outputs

    TRISC = 2 ' RC1 = FLTA input (ground RC1 to halt PWM)
    ' RC1 should be pulled high for normal PWM operation
    ' when fault A is enabled.
    ' PCPWM init
    DTCON = %00000101 ' ~500nS dead-time (for complementary outputs only)
    PTCON0 = %00000000 ' 1:1 postscale, Fosc/4 1:1 prescale, free running mode
    ' PTCON0 = %00000100 would give 19.45kHz/4
    PTPERL = 0 '
    PTPERH = 1 ' PTPER = $0100 or 256d for ~19.45kHz

    ' PWM4,5 independent, PWM0,1,2,3 complementary
    PWMCON0 = %01010100 ' PWM[5:0] outputs enabled
    PWMCON1 = 1 ' updates enabled, overrides sync w/timebase
    PTCON1 = %10000000 ' PWM time base is ON, counts up
    FLTCONFIG = %00000011 ' enable fault A, cycle-by-cycle mode

    Duty = 800 ' ~50%
    PDC2L = Duty.LowByte ' maintain a fixed 50% duty cycle on PWM4,5
    PDC2H = Duty.HighByte ' independent PWM outputs.
    last night this code worked for me, and i was getting a good pwm output. however today it wont work, ive checked my wiring is correct, by testing using multimeter and with other programs. however when i run the current program i get a pulse width output for about 10 seconds before it dies, i also havee an led attached to one of the pwm outputs which also fades out at the same time to check. ive fiddled alot with the fault byte to check it wasnt that. but i cant think of what else could be causing this problem? also for the 10 seconds it does appear... the 0 points on my pwm wave are actually slanted upwards slightly...?

    additionally since i havnt purchased a crystal yet, i thought id use the internal oscilattor INTIO1. this runs at a maximum of 8mhz. maybe this is causing the problem? ive tried to adjust my prescalers inrespect to this, however i still get the problems.
    Last edited by robertpeach; - 25th August 2009 at 14:45.

  4. #4
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    oh and sometimes (moreso now) i dont get a pwm at all... it just makes the led (thats linked to a pwm output) turn on for about 10 seconds and then fade out and nothing more.

  5. #5
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    ok ignore that one... took me a while (two days almost) to figure out where i went wrong on that one...

    but i still am having trouble with using values that are from a specific buffer, and using them in calculations etc... do i need to use there addresses? or just the buffer name? etc

Similar Threads

  1. PBP bad expression
    By MyBuddy in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th October 2009, 01:01

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