Problem runing my code


Results 1 to 34 of 34

Threaded View

  1. #7
    Join Date
    May 2009
    Posts
    66


    Did you find this post helpful? Yes | No

    Angry i solved that code joe thank u for help

    the big problem i have now is to wake up pic 16f628 from sleep using usart interrupt hserin i tested PIR1 it occur but in sleep mode it doesnt occur . i donno i think im runing usart on synchronous slave mode thats what says the datasheet but i donno wheres my problem .my project is to transmet data to pic then wake it up . here is my code .
    Code:
     @ DEVICE WDT_ON, PWRT_OFF,MCLR_ON,CPD_OFF, BOD_OFF, PROTECT_OFF,INTRC_OSC_NOCLKOUT
          Include "modedefs.bas"
          
    DEFINE OSC 4
    RCSTA=$90'DEFINE HSER_RCSTA 90H
    TXSTA = $20'DEFINE HSER_TXSTA 20h
    DEFINE HSER_BAUD 2400
    DEFINE HSER_SPBRG 25
    'DEFINE HSER_EVEN 1
    'DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    'DEFINE HSER_TIMEOUT 1 ' Clear overflow automatically  
    
    PORTA = %00000
    PORTB = %00000010
    TRISA = %00000
    TRISB = %00000010
    intcon = 0		
    vrcon = 0
    CMCON = 7	     
    j var  BYTE
    led var portb.7
    
    LOOP:
    j = j + 1
    if j = 255 then SLP
    high led2
    HSERIN 10,main,[DEC4 b0]
    
    goto loop
    
    ' here will be  my programe 
    SLP:
    low led
    RCSTA.4=0
     pause 100
    INTCON.6 = 1
    RCSTA.4 = 1
    PIE1.5 = 1
    PIR1.5 = 0
    @ SLEEP
    @ NOP
    PAUSE 1000
    HIGH PORTB.6
    PAUSE 1000
    LOW PORTB.6
    GOTO LOOP
    END
    please help i had read all the usart datasheet and i did what it says but nothings i think the problem in sync slave mode or the osc goes off during sleep or usart not reciving data even i did set it to recive data and interrupt..
    and acetronics says (Alain

    ... and now, just use " Wake up on interrupt " ... as you have the interrupt flag !!! i donno where to put on interupt i trayed it many ways but nothings when it goes to sleep it die just like my nan bless her ..
    Last edited by Mus.me; - 27th November 2009 at 01:14.
    HELLO

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. 16F883 Code Verify Problem
    By munromh in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th February 2009, 11:47
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. problem with my code
    By civicgundam in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 3rd February 2008, 01:52
  5. Code problem
    By chai98a in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th May 2006, 04:43

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