communication pc picaxe whith c#

Hello
I'm trying to creat a winform (in c#) which can swich on/off a del via the serial port
this is the form and the c# program
1.JPG
2.JPG
 
it looks like this
3.JPG

And here, two programms tested whith picaxe the first one work the second bot
4.JPG
so the picaxe can detect the "0" information
it can detect that an information is not a zero
but it doesn't recognize the "1" information
 

lewisg

Senior Member
If all you are wanting to send from the PC to the Picaxe is a simple 1 or 0 it would be easier to do that with one of the RS232 status lines instead of data over Rx/Tx.
 

AllyCat

Senior Member
Hi,

Your (wrong) code is setting "Port 1" High, but clearing "Port 0" to Low.

But you really should be using the Port.Pin format now, e.g. Low c.1 for modern PICaxes.

Cheers, Alan.
 
hi
answer to lewisg :This programm is just the begining. After i want to send complex data. that's the reason why i use rx/tx
answer to allycat:you're right i'm testing this program whith an old 28x1. But it doesn't explain why it can't read the binary "00000001" value
 

srnet

Senior Member
All PICAXEs apart from the X2s default to 4800baud for SERRXD, see manual2 page 207.

What baud are the characters being sent to the PCIAXE at ?
 

srnet

Senior Member
g6ejd gives the answer : "Change your C to 4800baud not 2400 "
Its often not as simple as that.

For two devices to communicate successfully on SERTXD, you need to ensure that the baud rate, polarity and start and stop bits are the same for both ends of the link.

So if it does not work, you can always check the manuals to see what the default settings are.
 
Top