PDA

View Full Version : pic16f877 problem repeating serial data



TomRiddle
- 6th February 2008, 11:31
ok.. i have here a pic16f877a ... and i'm trying to send this hex commands to the serial port... FF 03 00 01 02 FA

the program sends the hex strigs... but it sends it more than 1 time... it sends..
FF 03 00 01 02 FA FF 03 00 01 02 FA FF 03 00 01 02 FA

is there a way to just.. send the hex string once and then stop the serial communication??
10x in advance.. here's my code

DEVICE = 16F877
XTAL = 4
DECLARE SERIAL_DATA 8
LOOP:
SEROUT PORTA.0 , 16468 , [ $FF, $03, $00, $01, $02, $FA ]


DELAYMS 3000
GOTO LOOP

mackrackit
- 6th February 2008, 12:40
Take the SEROUT out of the loop. Add a button or something so when it is pushed then send data.

skimask
- 6th February 2008, 14:56
DEVICE = 16F877
XTAL = 4
DECLARE SERIAL_DATA 8
DELAYMS 3000


And try the correct forum.
You'd have a heck of a time trying to get the above lines to compile with melabs PicBasic or PicBasicPro.