CrazyEngineers
  • Help needed for PC-controlled Wireless Notice Board on USART

    stalk3r21

    stalk3r21

    @stalk3r21-t4e62s
    Updated: Oct 16, 2024
    Views: 1.2K
    Hey guys,
    I'm doing a project on wireless notice board, and my codes are in assembly language
    1. The wireless module is zigbee, and it's from pc to PIC,
    2. The display is dot-matrix and data will be taken from EEPROM to be displayed
    3. Only one way communication using USART from Zigbee to PIC6f628A
    4. PIC will receive new data whenever available from ZigBee and store in EEPROM
    5. The PC will be sending data through a ZigBee transmitter to the receiver.

    So, currently I've got my display unit to work and everything, and can display 128 characters. All of which is pre-loaded into the EEPROM.
    I'm having trouble with the communications part. How do I use USART to receive a data string and store into EEPROM one byte at a time? Plus I don't want to do the polling method.

    Attached is the codings that i've written.
    1. The original code is working fine and i need to embed the USART part into it
    2. The Usart RC file is the one I've written for serial communication with ZigBee that needs to be embedded.

    The code should work as: Displaying out data from EEPROM and when new data is received, it will take it and store into EEPROM and then start displaying all over again. Please help. Thanks

    Here is the Usart part:
    org     0x04        ;interrupt service vector
        movwf    W_Save
        movf     STATUS,W
        clrf     STATUS
        movwf    STATUS_Save
        movf     PCLATH,W
        movwf     PCLATH_Save
    
        movlw    0x00
        movwf    eefile
        
    goto    RCINT
    
        movf    PCLATH_Save
        movwf    PCLATH,W
        movf    STATUS_Save
        movwf    STATUS,W
        movf    W_Save
        retfie
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
        movlw    0xC0    ;setting up the interrupt, goes into the main part
        movwf    INTCON
        movlw    0x00
        movwf    PIR1
    
        movlw    0x68
        bsf    STATUS,RP0
        movwf    SPBRG
        movlw    0xA0
        movwf    PIE1
        bcf    TXSTA,BRGH
        bcf    TXSTA,SYNC
        bcf    STATUS.RP0
    
        bsf    RCSTA,SPEN
        bsf    RCSTA,CREN
        bcf    RCSTA,RX9
    
        bsf    STATUS,RP0
        movlw    0x02
        movwf    TRISB        ;RB1 is the rx pin
    
        end
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    RCINT    movf    RCREG,W
        bsf    STATUS,RP0
        movwf    EEDATA
        bcf    STATUS,RP0
    
        movf    eefile
        bsf    STATUS,RP0
        movwf    EEADR
        bcf    STATUS,RP0
        call    write
        
        incf    eefile,F
        movf    eefile
        bsf    STATUS,RP0
        movwf    EEDATA
        movlw    0x7F
        movwf    EEADR
        bcf    STATUS,RP0
        call     write
    
        bcf    PIR1,RCIF
        retfie    
    
    write    bsf    STATUS,RP0    ;select bank1    ;writes it to EEPROM
        bsf    EECON1,WREN    ;enable write
        bcf    INTCON,GIE        
        movlw    0X55        ;unlock codes
        movwf    EECON2
        movlw    0xAA
        movwf    EECON2
        bsf    EECON1,WR    ;write begins
        bsf    INTCON.GIE
        bcf    STATUS,RP0    ;select bank0        
    writeA    btfss    PIR1,EEIF    ;wait for write to complete
        goto    writeA
        bcf    PIR1,EEIF
        bsf    STATUS,RP0    ;select bank1
        bcf    EECON1,WREN    ;disable other writes
        bcf    STATUS,RP0    ;select bank0                    
        retlw    00    
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Harshad Italiya

    MemberFeb 27, 2011

    can you post your Project's Circuit diagram please.
    Are you sure? This action cannot be undone.
    Cancel
  • stalk3r21

    MemberFeb 28, 2011

    Hey there,
    Here it is the hardware design.
    [​IMG][​IMG]#-Link-Snipped-#
    (sorry, I don't know how to upload a picture here)

    [​IMG]The Dot-Matrix is common cathode. And PIC will only receive serial data from PC through ZigBee and will not send any serial data out.
    Are you sure? This action cannot be undone.
    Cancel
  • RNR

    MemberMay 28, 2012

    hey, can you explain about the working of the wireless notice board using zigbee technology.
    If possible give the circuit diagram also........
    Are you sure? This action cannot be undone.
    Cancel
  • Harshad Italiya

    MemberMay 29, 2012

    RNR
    hey, can you explain about the working of the wireless notice board using zigbee technology.
    If possible give the circuit diagram also........
    what range you want to cover using zigbee?
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register