Serin serout problem - Page 7


Closed Thread
Page 7 of 9 FirstFirst ... 3456789 LastLast
Results 241 to 280 of 337
  1. #241
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    led on RC3,.. do not work

    @ DEVICE PIC16F876A , HS_OSC , WDT_OFF , PWRT_ON , BOD_ON , LVP_OFF , PROTECT_OFF
    'HS 20mhz, watchdog off, powerup timer on, mclr external, brown out detect on, low volt program off , code protect off

    INCLUDE "modedefs.bas"

    DEFINE LCD_DREG PORTC ' Set LCD Data port
    DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
    DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
    DEFINE LCD_EREG PORTB ' Set LCD Enable port
    DEFINE LCD_EBIT 0 ' Set LCD Enable bit
    DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 2 ' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 2500
    DEFINE LCD_DATAUS 250
    DEFINE CHAR_PACING 2000

    TRISC =0

    Pause 1000 ' Wait 1 second

    loop:

    lcdout $FE,1, "Number: ", dec 55
    pause 100

    portc.3=0
    portc.3=1
    pause 300
    portc.3=0

    goto loop

    end

  2. #242
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    even this do not work...
    compiles and everything, but no action

    @ DEVICE PIC16F876A , HS_OSC , WDT_OFF , PWRT_ON , BOD_ON , LVP_OFF , PROTECT_OFF
    'HS 20mhz, watchdog off, powerup timer on, mclr external, brown out detect on, low volt program off , code protect off
    DEFINE OSC 20
    INCLUDE "modedefs.bas"
    TRISC =0
    loop:

    portc.3=1 'Blink led
    pause 300
    portC.3=0
    pause 300

    goto loop

    end
    Last edited by lerameur; - 7th January 2007 at 02:48.

  3. #243
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    yes it does oscillate
    when I put thisline:

    @ DEVICE PIC16F876A , HS_OSC , WDT_OFF , PWRT_ON , BOD_ON , LVP_OFF , PROTECT_OFF

    and not:
    DEFINE OSC 20
    DEFINE OSC 20 is for PBP and it's internal compiler and setting up various timing loops; it doesn't set any config bits anywhere in the PIC.

    Leave both in there.

  4. #244
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    then why doesn't the program in post 242 work ??

  5. #245
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    then why doesn't the program in post 242 work ??
    osc running at ~20mhz?
    are you using a crystal or one of those can oscillators?
    all other things being equal, it's probably the programmer's fault (not you, I mean the actual hardware)

  6. #246
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    i am using a crystal 20.0Mhz
    programmer ? I have another one ...

  7. #247
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    ok TRied the easy Prog Programmer,
    http://www.embedinc.com/easyprog/index.htm
    does not work more, same thing, I meam .. nothing is happening...
    Last edited by lerameur; - 7th January 2007 at 04:48.

  8. #248
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    ok TRied the easy Prog Programmer,
    http://www.embedinc.com/easyprog/index.htm
    does not work more, same thing, I meam .. nothing is happening...
    Just curious, is the chip a 16F876 or a 16F876A.... there's a difference as far as programming method goes...

  9. #249
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    it is the 876A and 877A BOTH

  10. #250
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I also have te Pic18F4685, PBP do not have a file to compile this...
    How do I go about making an Hex file out of it ??
    Last edited by lerameur; - 7th January 2007 at 16:36.

  11. #251
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    ok I am doing a remote control for my robot I wrote a code below, It seems long, Maybe you have a better idea. I am using two Potentiometer , the values of each will control the left and right motor of the robot:

    'Remote control*****************

    direction var word : speed var word

    Loop:
    If (left => 115) AND (left <= 135) AND (right => 115) AND (right <= 135) then
    goto stop

    If (left => 115) AND (left <= 135) AND (right <= 115) then 'left is stop, right is CCW
    goto LeftstopRightCCW

    If (left => 115) AND (left <= 135) AND (right => 135) then 'left is stop , right is CW
    goto LeftstopRightCW

    If (right => 115) AND (right <= 135) AND (right <= 115) then 'right is stop, left is CCW
    goto RightstopLeftCCW

    If (right => 115) AND (right <= 135) AND (right => 135) then 'right is stop , left is CW
    goto RightstopLeftCW

    If (left > 135) AND (right > 135) then 'Left Cw & right CW
    goto LeftCWRightCW

    If (left > 135) AND (right < 135) then 'Left CW & right CCW
    goto LeftCWRightCCW

    If (left < 135) AND (right > 135) then 'Left CCW & right CW
    goto LeftCCWRightCW

    If (left < 135) AND (right < 135) then 'Left CCW & right CCW
    goto LeftCCWRightCCW

    In brief:
    'Stop '--------------------------------$69 = 01 10 10 01
    'Leftwheel =stop : Rightwheel= CCW '--- $A6 = 10 10 01 10
    'Leftwheel =stop : Rightwheel= CW '----- $96 = 10 01 01 10
    'Leftwheel =CCW : Rightwheel= stop '---- $9a = 10 01 10 10
    'Leftwheel =CW : Rightwheel= stop '----- $A5 = 10 10 01 01
    'Leftwheel =CW : Rightwheel= CW '---- $66 = 01 10 01 10
    'Leftwheel =CW : Rightwheel= CCW '---- $56 = 01 01 01 10
    'Leftwheel =CCW : Rightwheel= CW '---- $5a = 01 01 10 10
    'Leftwheel =CCW : Rightwheel= CCW '---- $65 = 01 10 01 01
    Last edited by lerameur; - 7th January 2007 at 21:29.

  12. #252
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    I also have te Pic18F4685, PBP do not have a file to compile this...
    How do I go about making an Hex file out of it ??
    Upgrade to 2.47...

  13. #253
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    ok I am doing a remote control for my robot I wrote a code below, It seems long, Maybe you have a better idea. I am using two Potentiometer , the values of each will control the left and right motor of the robot:

    'Remote control*****************

    direction var word : speed var word

    Loop:
    If (left => 115) AND (left <= 135) AND (right => 115) AND (right <= 135) then
    goto stop

    If (left => 115) AND (left <= 135) AND (right <= 115) then 'left is stop, right is CCW
    goto LeftstopRightCCW

    If (left => 115) AND (left <= 135) AND (right => 135) then 'left is stop , right is CW
    goto LeftstopRightCW

    If (right => 115) AND (right <= 135) AND (right <= 115) then 'right is stop, left is CCW
    goto RightstopLeftCCW

    If (right => 115) AND (right <= 135) AND (right => 135) then 'right is stop , left is CW
    goto RightstopLeftCW

    If (left > 135) AND (right > 135) then 'Left Cw & right CW
    goto LeftCWRightCW

    If (left > 135) AND (right < 135) then 'Left CW & right CCW
    goto LeftCWRightCCW

    If (left < 135) AND (right > 135) then 'Left CCW & right CW
    goto LeftCCWRightCW

    If (left < 135) AND (right < 135) then 'Left CCW & right CCW
    goto LeftCCWRightCCW

    In brief:
    'Stop '--------------------------------$69 = 01 10 10 01
    'Leftwheel =stop : Rightwheel= CCW '--- $A6 = 10 10 01 10
    'Leftwheel =stop : Rightwheel= CW '----- $96 = 10 01 01 10
    'Leftwheel =CCW : Rightwheel= stop '---- $9a = 10 01 10 10
    'Leftwheel =CW : Rightwheel= stop '----- $A5 = 10 10 01 01
    'Leftwheel =CW : Rightwheel= CW '---- $66 = 01 10 01 10
    'Leftwheel =CW : Rightwheel= CCW '---- $56 = 01 01 01 10
    'Leftwheel =CCW : Rightwheel= CW '---- $5a = 01 01 10 10
    'Leftwheel =CCW : Rightwheel= CCW '---- $65 = 01 10 01 01

    You're right. There probably is a better/shorter way to do that.
    I'll think about it for a bit and get back to ya.
    I take it that the reason you've got 115 and 135 is for a bit of a 'deadband' so the thing doesn't jitter on you?

    (see that?, the manchester encoding is handy isn't it?)

    How about


    'Remote control*****************

    direction var word : speed var word
    bits var byte
    'bits = bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
    ' LCW (-LCW) LCCW -(LCCW) RCW (-RCW) RCCW (-RCCW)
    'use odd bits as a direction flag, use the even bits inverted from the others as the same thing, but also as a bit of error detection

    TX end...

    Loop:
    bits = %01010101

    If (left => 115) AND (left <= 135) then bits.7 = 0 : bits.6 = 1
    if (right => 115) AND (right <= 135) then bits.3 = 0 : bits.2 = 1
    if (right <= 115) then bits.1 = 1 : bits.0 = 0
    If (right => 135) then bits.3 = 1 : bits.2 = 0
    If (left <= 115) then bits.5 = 1 : bits.4 = 0
    If (left => 135) then bits.7 = 1 : bits.6 = 0
    transmit
    goto loop


    RX end....
    In brief:
    if bits.7 = bits.6 then bitserror 'bit pairs shouldn't be equal
    if bits.5 = bits.4 then bitserror
    if bits.3 = bits.2 then bitserror
    if bits.1 = bits.0 then bitserror

    'Stop '--------------------------------$69 = 01 10 10 01
    'Leftwheel =stop : Rightwheel= CCW '--- $A6 = 10 10 01 10
    'Leftwheel =stop : Rightwheel= CW '----- $96 = 10 01 01 10
    'Leftwheel =CCW : Rightwheel= stop '---- $9a = 10 01 10 10
    'Leftwheel =CW : Rightwheel= stop '----- $A5 = 10 10 01 01
    'Leftwheel =CW : Rightwheel= CW '---- $66 = 01 10 01 10
    'Leftwheel =CW : Rightwheel= CCW '---- $56 = 01 01 01 10
    'Leftwheel =CCW : Rightwheel= CW '---- $5a = 01 01 10 10
    'Leftwheel =CCW : Rightwheel= CCW '---- $65 = 01 10 01 01

    And at the receiver end, the receiver code wouldn't actuate a motor until receiving a few correct codes in a row (a one time code wouldn't trip the motors into running).

    Just a quick thought I had...

  14. #254
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I got the module working now, I will be doing some testing thursday.
    by the way i wouls like to have a crystal oscillate by itself, How do i do that ? I have a sensor chip that needs to be clocked. I tried connecting it to + and ground but nothing

  15. #255
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    I got the module working now, I will be doing some testing thursday.
    by the way i wouls like to have a crystal oscillate by itself, How do i do that ? I have a sensor chip that needs to be clocked. I tried connecting it to + and ground but nothing
    Crystals don't oscillator by themselves. In short, you have to have a small inverting amp, induce a phase shift, and a few other things to get a usable signal from them. Grab the datasheet for a 4066 and see what they do with a crystal and one of those chips. Or just buy a DIP oscillator of the frequency of your choice (Digikey ECS oscillators).

  16. #256
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I got the oscillator goimg, Its square wave, I will be adding a couple of caps and resisor to make it more like a sin wave.

    Also I needed more memory for my project so I got the monster Pic18F4685. Iuse the same program as for the Pic16F877a and it gives errors about the nbit number, I guess I have to change all the specification of my program. but I am not sure what; here is the message i am getting after compiling:

    C:\PBP>pbp -p18F4685 motorG
    PICBASIC PRO(TM) Compiler 2.47, (c) 1998, 2006 microEngineering Labs, Inc.
    All Rights Reserved.
    PM Assembler 4.08, Copyright (c) 1995, 2006 microEngineering Labs, Inc.
    Error 18F4685.INC 14 : [235] Opcode Expected Instead of 'Error: PM does not sup
    port this device. Use MPASM.'
    Error C:\PBP\MOTORG.ASM 85 : [225] Undefined Symbol 'PORTB'
    Error C:\PBP\MOTORG.ASM 86 : [225] Undefined Symbol 'PORTC'
    Error C:\PBP\MOTORG.ASM 87 : [225] Undefined Symbol 'TRISB'
    Error C:\PBP\MOTORG.ASM 88 : [225] Undefined Symbol 'TRISC'
    Error PBPPIC18.LIB 161 : [225] Undefined Symbol 'PORTB'
    Error PBPPIC18.LIB 379 : [225] Undefined Symbol 'PORTB'
    Error PBPPIC18.LIB 1153 : [200] Instruction Restricted to 14-Bit Core
    Error PBPPIC18.LIB 1153 : [218] Address Limit of FFFFh Exceeded
    Error PBPPIC18.LIB 1158 : [200] Instruction Restricted to 14-Bit Core
    Error PBPPIC18.LIB 1158 : [218] Address Limit of FFFFh Exceeded
    Error PBPPIC18.LIB 1281 : [200] Instruction Restricted to 14-Bit Core
    Error PBPPIC18.LIB 1281 : [218] Address Limit of FFFFh Exceeded
    Error PBPPIC18.LIB 1282 : [200] Instruction Restricted to 14-Bit Core
    Error PBPPIC18.LIB 1282 : [218] Address Limit of FFFFh Exceeded
    Fatal PBPPIC18.LIB 1282 : [300] Too Many Errors

    C:\PBP>

  17. #257
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    I got the oscillator goimg, Its square wave, I will be adding a couple of caps and resisor to make it more like a sin wave.

    Also I needed more memory for my project so I got the monster Pic18F4685. Iuse the same program as for the Pic16F877a and it gives errors about the nbit number, I guess I have to change all the specification of my program. but I am not sure what; here is the message i am getting after compiling:

    C:\PBP>pbp -p18F4685 motorG
    PICBASIC PRO(TM) Compiler 2.47, (c) 1998, 2006 microEngineering Labs, Inc.
    All Rights Reserved.
    PM Assembler 4.08, Copyright (c) 1995, 2006 microEngineering Labs, Inc.
    Error 18F4685.INC 14 : [235] Opcode Expected Instead of 'Error: PM does not sup
    port this device. Use MPASM.'
    Error C:\PBP\MOTORG.ASM 85 : [225] Undefined Symbol 'PORTB'
    Error C:\PBP\MOTORG.ASM 86 : [225] Undefined Symbol 'PORTC'
    Error C:\PBP\MOTORG.ASM 87 : [225] Undefined Symbol 'TRISB'
    Error C:\PBP\MOTORG.ASM 88 : [225] Undefined Symbol 'TRISC'
    Error PBPPIC18.LIB 161 : [225] Undefined Symbol 'PORTB'
    Error PBPPIC18.LIB 379 : [225] Undefined Symbol 'PORTB'
    Error PBPPIC18.LIB 1153 : [200] Instruction Restricted to 14-Bit Core
    Error PBPPIC18.LIB 1153 : [218] Address Limit of FFFFh Exceeded
    Error PBPPIC18.LIB 1158 : [200] Instruction Restricted to 14-Bit Core
    Error PBPPIC18.LIB 1158 : [218] Address Limit of FFFFh Exceeded
    Error PBPPIC18.LIB 1281 : [200] Instruction Restricted to 14-Bit Core
    Error PBPPIC18.LIB 1281 : [218] Address Limit of FFFFh Exceeded
    Error PBPPIC18.LIB 1282 : [200] Instruction Restricted to 14-Bit Core
    Error PBPPIC18.LIB 1282 : [218] Address Limit of FFFFh Exceeded
    Fatal PBPPIC18.LIB 1282 : [300] Too Many Errors

    C:\PBP>
    Check your PBP manual. You can't use the assembler that comes with PBP, gotta use MPASM for the PIC18Fxxxx parts.

  18. #258
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    O ok, because i saw the .BAS and .INC files, so I thougt it would take it.
    alright

  19. #259
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    HI,
    I am almost finish writing my code and I get an error at the receivring end, I have an LCDout and the sending end, it good number, but at the receiving end the information is confused.
    meaning the Left is showing the same thing as the sending left.
    But the right is showing me number like 12421 (pot at center). I encode and decode he same way, This is weird. what also struck me is that number 12421 is constant, so that when I move my pot there is a variation from 12542 to 12288 .
    I also flipped the serin line for left and right and i get the same result..
    (the sending and show number varying between 0 to 255)
    here is a snippet of the code:

    right var word : left var word : temp var word : counter var byte
    rightold var word : leftold var word : speedright var word : speedleft var word
    loop:
    waitfor55:
    serin portb.2 , n2400 , temp
    if temp <> $55 then goto waitfor55

    waitforaa:
    serin portb.2 , n2400 , temp : if temp <> $aa then goto waitforaa

    serin portb.2, n2400, rightold.LowBYTE : serin portb.2, n2400, rightold.HighBYTE
    serin portb.2, n2400, leftold.LowBYTE : serin portb.2, n2400, leftold.HighBYTE

    For counter=0 TO 7 'decoding
    left.0[counter]=leftold.0[counter*2]
    right.0[counter]=rightold.0[counter*2]
    Next counter

    Lcdout $fe, 1 'Clear screen
    Lcdout "Left: ", Dec left
    Lcdout $fe, $C0, "Right: ", DEC right
    Pause 100

    before you ask, here is my sending part:

    send:
    Lcdout $fe, 1 'Clear screen
    Lcdout "Left: ", Dec left
    Lcdout $fe, $C0, "Right: ", DEC right

    serout portb.2, n2400,[$55,$55,$55,$55,$55,$55,$55,$55,$aa]

    serout portb.2, n2400,[rightnew.LowBYTE,rightnew.HighBYTE]
    serout portb.2, n2400,[leftnew.LowBYTE,leftnew.HighBYTE]

    goto loop
    end
    Last edited by lerameur; - 11th January 2007 at 17:54.

  20. #260
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    it works now, changed some word to byte ...

  21. #261
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Hey , I just realize that after running my receiving circuit for a minute or so , he Lm7805 gets very hot, Is this normal ?. on my sending circuit it stays cool.
    I have on the receiving, an lcd, the receiving RF module, a Pic16F877a and an H-Bridge.. The H bridge is running directly from the battery for the Vs. everything is battery operated

  22. #262
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    Hey , I just realize that after running my receiving circuit for a minute or so , he Lm7805 gets very hot, Is this normal ?. on my sending circuit it stays cool.
    I have on the receiving, an lcd, the receiving RF module, a Pic16F877a and an H-Bridge.. The H bridge is running directly from the battery for the Vs. everything is battery operated
    Does the LCD have a backlight ?

    If so, try running it from the unregulated power supply after increasing the resistor accordingly.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  23. #263
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    yes it does have a backlioght.
    The supply is a 12v battery cannot put that directly on thebattery

  24. #264
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    yes it does have a backlioght.
    The supply is a 12v battery cannot put that directly on thebattery
    Do you have a series resistor between your 5v supply and the LCD backlight?

    If not it will be drawing excessive current which will definately be why the 7805 is cooking.

    If you do have a resistor, then increase its value and drive the backlight from the 12v supply. Search for threads about "backlight", one just resurfaced in the last couple of days.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  25. #265
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    i have a potenetiometer between the 5 v and the LCD, I swiched to the 12v with the pot, and the LCD is finished

  26. #266
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    i have a potenetiometer between the 5 v and the LCD, I swiched to the 12v with the pot, and the LCD is finished
    Sorry to hear that you toasted the LCD but I didnt suggest running the LCD from the 12v supply.... just the backlight.

    If you had read the other threads about this you would see the reason behind it. The LCD only takes a couple of milliamps but the backlight takes 50-80mA which is a lot of extra for the regulator to handle.

    The backlight doesnt need a regulated supply, just a current limited one hence the use of a series resistor which you calculate according to the forward voltage of the backlight , the required current through the backlight and the maximum voltage of the unregulated supply.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  27. #267
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    a ok , i get it,
    By the way , anybody knows why My h_bridge, L298N get really really hot even with a heat sink and just 1.8 amp ?and yes it is connected to the 12v battery. Getting hot, and its not working anymore...
    Last edited by lerameur; - 14th January 2007 at 22:22.

  28. #268
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Country Fried

    Quote Originally Posted by lerameur View Post
    a ok , i get it,
    By the way , anybody knows why My h_bridge, L298N get really really hot even with a heat sink and just 1.8 amp ?and yes it is connected to the 12v battery. Getting hot, and its not working anymore...
    Hi Leramuer, sounds like the magic smoke escaped from that device. 12v x 1.8 a
    = 21.6 watts, I assume thats the running current under normal load. That figure increases exponentialy when you reverse direction and that's a whole lot of heat. What do you have for a heat sink? Maybe in addition to more heat sink you should put in a thermal shutdown circuit.
    JS

  29. #269
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    a ok , i get it,
    By the way , anybody knows why My h_bridge, L298N get really really hot even with a heat sink and just 1.8 amp ?and yes it is connected to the 12v battery. Getting hot, and its not working anymore...
    If it was me doing a project needing an H-bridge, I'd skip the H-bridge and just go with a set up using a bunch of logic-level N-channel enhancement mode MOSFETs (try saying that 3 times fast), or P-channel, whatever. That way I know for sure I can drive whatever it is I need to drive. And if the MOSFETs get too hot even after putting a heatsink on them, you can always parallel them. Which gets me to thinking...have you tried paralleling a couple of L298N's? I haven't read the datasheet, don't know if it's possible (or even wise)...might work though.

    And 12v @ 1.8a does = 21.6watts, but only if the L298N has resistance across it, zero resistance = zero load. Maybe the L298N isn't being driven hard enough. (Sounds like it's time to get my butt over to the datasheets so I know what I'm talking about here).

  30. #270
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I have a big ass heat sink, about 9 times he size of the chip.
    I believe I was under th wattage recommended (or maybe just on it, cause the battery was fully charged at 12.85 and @ 1.9 amp 24.7 watt.
    would that of killed it.

    I looked at comse circuit for making my own H-bridge, but is seems a bit messy.
    I have some IRFZ44N N mos, maybe get their brother P's and work with that, you have any schematic ?
    I found this: http://www.armory.com/~rstevew/Publi...d/nch-brdg.htm
    but I dont know


    update:
    I tried one IRFZ44N , it become very hot with just 5watt. I know I can put a heat sink, but this thing is suppose to support 94 watt. Is there somehting I am not getting ??
    Last edited by lerameur; - 15th January 2007 at 04:39.

  31. #271
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    to go back to my LCD problem , I am not using backlight. I thought you where refering to the contrast adjustment. nothing is connected to th backlight supply. IS this ,my problem , From the other post you mentionned, The gentlemen did not have a problen and the backlight was not connected. Mine does.
    Last edited by lerameur; - 15th January 2007 at 05:51.

  32. #272
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    I have a big ass heat sink, about 9 times he size of the chip.
    I believe I was under th wattage recommended (or maybe just on it, cause the battery was fully charged at 12.85 and @ 1.9 amp 24.7 watt.
    would that of killed it.

    I looked at comse circuit for making my own H-bridge, but is seems a bit messy.
    I have some IRFZ44N N mos, maybe get their brother P's and work with that, you have any schematic ?
    I found this: http://www.armory.com/~rstevew/Publi...d/nch-brdg.htm
    but I dont know


    update:
    I tried one IRFZ44N , it become very hot with just 5watt. I know I can put a heat sink, but this thing is suppose to support 94 watt. Is there somehting I am not getting ??
    Well, like I said, the only way something can dissipate heat is if it has resistance in the first place, zero ohms across a device = zero volts dropped across it = zero watts dissipated in it. If that MOSFET is a standard MOSFET, and you're driving it with 5v, it isn't going to work very well. You need a logic level MOSFET, one that's designed to be driven with 5v. And monster heat sinks only work well up to a point. You can only get rid of so much heat so fast, they got limits too.
    Why not post a schematic...we'll get a better idea of what you're up to. (on a side note, I haven't gotten over to the L298N datasheet yet).

  33. #273
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    well eventually I would like to use 15v at 2 amps, so that h-bridge might to be ideal for now.
    To follow your idea on using MOSfet, I found a web site talking about the IRF540, which is very similar to the one I have IRFZ44N., Except they use Pmos also, I guess I can use 4 Nmos and using an inverter instead of using 2 Nmos and 2 Pmos.

  34. #274
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    what about driving one L298 per motor instead of two motors ?
    will it be creating less heat ?

  35. #275
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default B A

    Quote Originally Posted by lerameur View Post
    I have a big ass heat sink, about 9 times he size of the chip.
    Sounds good, how about some "B/A" bypass capacitors, or snubber diodes to protect those transistors, motors throw off some outrageous spikes which may well cause your bridge to get "Kentucky Fried".

    Quote Originally Posted by lerameur View Post
    what about driving one L298 per motor instead of two motors ?
    will it be creating less heat ?
    Always better, I think.
    Last edited by Archangel; - 15th January 2007 at 20:40. Reason: Add

  36. #276
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    well eventually I would like to use 15v at 2 amps, so that h-bridge might to be ideal for now.
    To follow your idea on using MOSfet, I found a web site talking about the IRF540, which is very similar to the one I have IRFZ44N., Except they use Pmos also, I guess I can use 4 Nmos and using an inverter instead of using 2 Nmos and 2 Pmos.
    You got it, for the most part. In the end, you get 2 control lines, one for on/off, and one for direction. But, you will have to use 2 N's and 2 P's and an inverter (which you can also use a couple of small MOSFETs and a couple of resistors and make your own inverter from components rather than a 7404), N channel on top, P channel on bottom. Remember (in basic terms), N channel MOSFETs work by applying a ground to a circuit, P channel's apply power to the circuit.

    And yes, some snubber caps and protection diodes, just in case. Motors are ugly in some ways...

  37. #277
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I put back the circuit together with one L298.
    added caps, Its really hard to make them stick onto the motors, any thoughts?
    Also it was not working at first, I realized that my Pic chip was not putting some pins at high. I changed the program so the pin output went from portC to portD and it worked. I reprogrammed the chip a few times, those couple of pins on PortC are not working no more. Can I revived them ? what happened..

  38. #278
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    I put back the circuit together with one L298.
    added caps, Its really hard to make them stick onto the motors, any thoughts?
    Also it was not working at first, I realized that my Pic chip was not putting some pins at high. I changed the program so the pin output went from portC to portD and it worked. I reprogrammed the chip a few times, those couple of pins on PortC are not working no more. Can I revived them ? what happened..
    Post your circuit, otherwise it's hopeless...

  39. #279
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    basically I am driving the h_bridge directly from microcontroller. Some one told me to use an opto coupler. BUt the output of the microcontroller is hooked up to the enable of the h-bridge, how can that fry my pins. I just fried my ccp pin..
    Also, would it be better to use a seperate power supply for the controlelr and h-bridge?

  40. #280
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    basically I am driving the h_bridge directly from microcontroller. Some one told me to use an opto coupler. BUt the output of the microcontroller is hooked up to the enable of the h-bridge, how can that fry my pins. I just fried my ccp pin..
    Also, would it be better to use a seperate power supply for the controlelr and h-bridge?
    Like I said, post the circuit! We can hook you up with good info much quicker that way.

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. serout and serin problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th April 2006, 19:44
  4. Replies: 11
    Last Post: - 13th July 2005, 19:26
  5. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54

Members who have read this thread : 1

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