Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

call delay command

Status
Not open for further replies.

frankenstein

New Member
my code is below, i am tring to remove the delay between flashes of different leds. the current delay is 250ms and i tried simply deleting call delay between the off mesages but in mplab this fails quick build and creates a bunk hex file. waht do i need to add?

Main BSF PORTA,2 ; Turn on LED connected to RA2
CALL delay
BCF PORTA,2 ; Turn off LED connected to RA2
CALL delay
BSF PORTA,3 ; Turn on LED connected to RA3
CALL delay
BCF PORTA,3 ; Turn off LED connected to RA3
CALL delay
GOTO Main
 
frankenstein said:
my code is below, i am tring to remove the delay between flashes of different leds. the current delay is 250ms and i tried simply deleting call delay between the off mesages but in mplab this fails quick build and creates a bunk hex file. waht do i need to add?

Main BSF PORTA,2 ; Turn on LED connected to RA2
CALL delay
BCF PORTA,2 ; Turn off LED connected to RA2
CALL delay
BSF PORTA,3 ; Turn on LED connected to RA3
CALL delay
BCF PORTA,3 ; Turn off LED connected to RA3
CALL delay
GOTO Main

I don't see any problem with deleting any, or all, of the 'CALL delay' lines, try writing the code in notepad, and using MPASM to assemble it.
 
thanks that seems to have worked.

imm verry new to this so i really appriciate the help.

also:any one know why mouser (a large electronics distributer) would list all microchip controllers as "products not recomended for new designs"?
 
frankenstein said:
thanks that seems to have worked.

imm verry new to this so i really appriciate the help.

also:any one know why mouser (a large electronics distributer) would list all microchip controllers as "products not recomended for new designs"?

I've just had a quick look, they don't list 'all' MicroChip PIC's as that, only the older ones. The 16F84 series are all marked as that (as they should be, they were replaced by the 16F628 a good while ago), also the older version chips 16F876, 16F628 etc. are listed like that, but the new 876A, 628A etc. aren't. Basically they are advising not to start a new design using an old chip, presumably they are no longer in production, having been replaced by the A versions.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top