+ Reply to Thread
Page 7 of 9
First ... 3 4 5 6 7 8 9 Last
Results 91 to 105 of 131

Thread: where do i learn bout PIC ?

  1. #91
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    so is it that i can only use mplab to upload program to the PIC thru microchip programmers.. and for uploading via serial port .. i will need bootloader together with the bootloader software?? the one shown below?? are all bootloaders the same ?? meaning that i can just download any bootloaders and run with this software, Tiny bootloader??
    Attached Images


  2. #92
    eblc1388 Excellent eblc1388 Excellent eblc1388 Excellent eblc1388 Excellent eblc1388 Excellent
    Join Date
    Jan 2005
    Location
    UK
    Posts
    2,226

    Default

    Quote Originally Posted by kupikupi
    so is it that i can only use mplab to upload program to the PIC thru microchip programmers..
    MPLAB is a development enviornment where the asm file is compiled/assembled into a HEX file. You can use either Microchip's programmers or other programmers or even build one yourself to send the HEX into the PIC. See here:

    A home made programmer

    Quote Originally Posted by kupikupi
    .. and for uploading via serial port ..
    This is an option that requires no programmer except a standard RS232 serial connection to the PC. Suitable for people who do not have access to programmers at home, like you are now.

    Quote Originally Posted by kupikupi
    i will need bootloader together with the bootloader software?? the one shown below?? are all bootloaders the same ?? meaning that i can just download any bootloaders and run with this software, Tiny bootloader??
    All bootloaders are different. Of course they are if not why we have so many?

    Every bootloader need a specific software to work. For some, that specific software is simply the terminal program like Hyperterm. For others, like TinyBootloader, you have to run it's software for it to work.
    L.Chung

  3. #93
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    eblc1388 ... i got it .. very clear explanation ... so now ... since im using the tiny bootloader codes, i'll have to use the software tinybootloader provides.. thanx alot....

    do u know how the IR module works with the PIC?? where is the receiver placed and where is the transmitter placed ?? wat components does the IR consist of and do i get it part by part or it's sold as 1 set?? if i use a joystick to control the direction of the motor .. how does a joystick send signal to the PIC?? and is the transmitter connected to the joystick ???

  4. #94
    eblc1388 Excellent eblc1388 Excellent eblc1388 Excellent eblc1388 Excellent eblc1388 Excellent
    Join Date
    Jan 2005
    Location
    UK
    Posts
    2,226

    Default

    Quote Originally Posted by kupikupi
    do u know how the IR module works with the PIC?? where is the receiver placed and where is the transmitter placed ??
    The receiver is placed such that the IR beam from the transmitter can be seen.

    Quote Originally Posted by kupikupi
    wat components does the IR consist of and do i get it part by part or it's sold as 1 set??
    IR transmitter is just a diode like LED. It sends out IR instead of visible light. You can "see" the beam if you view it using a camera phone.

    The receiver is sold as a complete module, mostly with three pins. Two for supply and one for signal output. The signal is the ON/OFF pattern of IR beam.

    Quote Originally Posted by kupikupi
    if i use a joystick to control the direction of the motor .. how does a joystick send signal to the PIC?? and is the transmitter connected to the joystick ???
    You'll need an interface between joystick and IR transmitter. You either build one or buy a cheap universal remote, use the internal components and wire the joystick switches to replace the original keys. You connect the receiver to one port pin of the PIC and using software to decode what command is being sent from the transmitter.
    L.Chung

  5. #95
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    ;************************************************* ****************
    title "PIC PowerBoard: Program pre PIC18F452"
    subtitle "Version 1.00 (c) Jay.slovak 2005"
    ;************************************************* ****************
    list p=18F452 R=DEC ; wat is this for
    #include <P18F452.INC>

    ERRORLEVEL 2 ; is it neccesary to put this?

    ;********** Definovanie uzivatelskych registrov *******************
    Fosc equ 20 ;Frekvencia Oscilatora v Mhz

    ZDRZ0 equ D'000' ;
    ZDRZ1 equ D'001'
    ZDRZ2 equ D'002'


    ;********** Zaciatok pamati programu ******************************
    ORG 0x0004 ; does it ont always start at 0?
    GOTO INIT
    ;********** Inicializacia procesora *******************************
    ORG 0x002A
    INIT MOVLW h'07' ; some led blinking program
    MOVWF ADCON1,a ; doesnt have this , will it still
    ; work??
    CLRF PORTA
    CLRF PORTB
    CLRF PORTC
    CLRF PORTD
    CLRF PORTE
    CLRF TRISA
    CLRF TRISB
    CLRF TRISC
    CLRF TRISD
    CLRF TRISE

    GOTO START
    ;********** Podprogramy Zdrzania @20Mhz *******************
    Zdrz8s CALL Zdrz4s ; this is the delay part, by how
    GOTO Zdrz4s ; much is the delay ?is it the
    ; same a the delay just below?
    Zdrz4s CALL Zdrz2s
    GOTO Zdrz2s

    Zdrz2s CALL Zdrz1s
    GOTO Zdrz1s

    Zdrz1s CALL Zdrz500m
    GOTO Zdrz500m

    Zdrz500m NOP
    MOVLW D'121'
    MOVWF ZDRZ0 ; i think Zdrz500m delays by
    MOVLW D'171' ; 500ms, but how is it here?
    MOVWF ZDRZ1 ;121+171+13?
    MOVLW D'13'
    MOVWF ZDRZ2
    GOTO Zdrz


    Zdrz100m NOP ; why do we use a nop ?? to delay ??
    NOP ; but i thought delay is done already ?
    MOVLW D'122'
    MOVWF ZDRZ0
    MOVLW D'137'
    MOVWF ZDRZ1
    MOVLW D'3'
    MOVWF ZDRZ2
    GOTO Zdrz

    Zdrz15m CALL Zdrz5m
    CALL Zdrz5m
    GOTO Zdrz5m

    Zdrz5m CALL Zdrz1m
    CALL Zdrz1m
    CALL Zdrz1m
    CALL Zdrz1m
    GOTO Zdrz1m

    Zdrz2m CALL Zdrz1m
    GOTO Zdrz1m

    Zdrz1m MOVLW D'140'
    MOVWF ZDRZ0
    MOVLW D'7'
    MOVWF ZDRZ1
    MOVLW D'1'
    MOVWF ZDRZ2
    NOP
    NOP
    GOTO Zdrz

    Zdrz100 CALL Zdrz40
    CALL Zdrz40
    CALL Zdrz10
    GOTO Zdrz10

    Zdrz40 CALL Zdrz10
    CALL Zdrz10
    CALL Zdrz10
    GOTO Zdrz10

    Zdrz10 MOVLW D'10'
    MOVWF ZDRZ0
    MOVLW D'1'
    MOVWF ZDRZ1
    MOVLW D'1'
    MOVWF ZDRZ2
    NOP
    NOP
    GOTO Zdrz

    Zdrz DECFSZ ZDRZ0,F
    GOTO Zdrz
    DECFSZ ZDRZ1,F
    GOTO Zdrz
    DECFSZ ZDRZ2,F
    GOTO Zdrz
    Return

    ;********** Hlavny Program *******************************
    Start SETF PORTA
    SETF PORTB
    SETF PORTC
    SETF PORTD
    SETF PORTE
    CALL Zdrz1s
    CLRF PORTA ; this part turns off the LED?
    CLRF PORTB
    CLRF PORTC
    CLRF PORTD
    CLRF PORTE
    CALL Zdrz1s

    GOTO Start
    end



    hi guys, i think i more or less understand the whole program , just that
    i'm a little confuse with the delay part, and for the one in bold that i commented , could u help me check if it's correct??

  6. #96
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    You'll need an interface between joystick and IR transmitter. You either build one or buy a cheap universal remote, use the internal components and wire the joystick switches to replace the original keys. You connect the receiver to one port pin of the PIC and using software to decode what command is being sent from the transmitter.
    any circuit diagrams or guide on how to do that ?? wat is a universal remote?
    i dun understand how to do it.. thanx

    is there any particular name for every IR module ?
    wat does"Serial port controlled infrared transmitter with PIC" means?
    is it the one i need to use ?? to control the direction of the wheelchair?? i am going to get the components soon, but i dont know how to buy it ? which one to choose ,
    i just repeat wat i need IR for ..
    i need to control the direction of the wheelchair manually ( with a sony joystick i guess, ) so the joystick tranmits the signal to the PIC to drive the motors ... so wat kind of IR module do i need??? is there any guide on how to connect all these parts? thanx alot

  7. #97
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    Jay .... i tried to use the Tiny bootloader ... but it can't seem to work it shows this
    Attached Images

  8. #98
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    hi guys,

    i just need some advice, i'm rushing to finish my current project and i'm really confuse, i don't know whether to learn c language or assembly, i need to submit my project in 3 weeks but i dont think i have time to learn either of them .. i tried to learn assembly but i think think it would really take quite some time to understand the whole thing... my C is a little ok ... well , at least it looks simpler and i could understand program i see quite fast, so i need some advice from u Pros to help me decide ... is there any tutorials about programming in C ?? i really need it urgently..

  9. #99
    Super Moderator Jay.slovak Good Jay.slovak Good Jay.slovak Good
    Join Date
    Jan 2005
    Location
    Slovakia
    Posts
    1,740

    Default

    Quote Originally Posted by kupikupi
    Jay .... i tried to use the Tiny bootloader ... but it can't seem to work it shows this
    Did you program that PIC with bootloader HEX before with normal programmer? It won't work without it.

  10. #100
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    Quote Originally Posted by Jay.slovak
    Did you program that PIC with bootloader HEX before with normal programmer? It won't work without it.
    yes... i did .. i changed this
    Code:
    LIST      P=18F4320	; change also: Configure->SelectDevice from Mplab 
    xtal EQU 20000000		; you may want to change: _XT_OSC_1H  _HS_OSC_1H  _HSPLL_OSC_1H
    baud EQU 115200			; standard TinyBld baud rates: 115200 or 19200
    
    to

    Code:
    LIST      P=18F452	; change also: Configure->SelectDevice from Mplab 
    xtal EQU 20000000		; you may want to change: _XT_OSC_1H  _HS_OSC_1H  _HSPLL_OSC_1H
    baud EQU 19200			; standard TinyBld baud rates: 115200 or 19200
    
    it's correct rite??

    but i think there might be a problem with the mplab in the lab.. i think i'll convert it to hex at home then try again ...

    thanx Jay ...

  11. #101
    Super Moderator Jay.slovak Good Jay.slovak Good Jay.slovak Good
    Join Date
    Jan 2005
    Location
    Slovakia
    Posts
    1,740

    Default

    it is correct, but why did you lower the Baud rate?
    Are you sure that your PIC and MAX232 have good connection to com port? Did you select correct com port? Did you RESET the PIC after you pressed the PROGRAM/WRITE FLASH button?

  12. #102
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    Quote Originally Posted by Jay.slovak
    it is correct, but why did you lower the Baud rate?
    Are you sure that your PIC and MAX232 have good connection to com port? Did you select correct com port? Did you RESET the PIC after you pressed the PROGRAM/WRITE FLASH button?
    for the Baud rate, i just used the same one as when i run the terminal program, that was wat the lecturer told us to, but can i ask, is it that it's better to set a higher Baud rate?? for the com ports, i'm sure i had it right and working but i din reset the PIC after i write flash. i'll try again later // thanx Jay...

  13. #103
    Super Moderator Jay.slovak Good Jay.slovak Good Jay.slovak Good
    Join Date
    Jan 2005
    Location
    Slovakia
    Posts
    1,740

    Default

    Lower Baud rate will just make programming longer for a few seconds..

  14. #104
    eblc1388 Excellent eblc1388 Excellent eblc1388 Excellent eblc1388 Excellent eblc1388 Excellent
    Join Date
    Jan 2005
    Location
    UK
    Posts
    2,226

    Default

    Quote Originally Posted by kupikupi
    Code:
    LIST      P=18F4320	; change also: Configure->SelectDevice
    
    Why have you chosen to use the 18F4320 asm file to match your 18F452?

    You should use the 18F252 asm file instead. The author has use the following name for this file:

    "tinybld18F.asm"
    L.Chung

  15. #105
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    Quote Originally Posted by eblc1388
    Quote Originally Posted by kupikupi
    Code:
    LIST      P=18F4320	; change also: Configure->SelectDevice
    
    Why have you chosen to use the 18F4320 asm file to match your 18F452?

    You should use the 18F252 asm file instead. The author has use the following name for this file:

    "tinybld18F.asm"
    well... i thought that was the closest one... so should i use the asm file for F252 now ??

+ Reply to Thread
Page 7 of 9
First ... 3 4 5 6 7 8 9 Last

Tags for this Thread