Serial port questions
Re: Serial port questions
I'm not sure, maybe you should try to use '&' when it is needed, so instead of
Edit:
Oh, that was a bad sample.
I thought Serial_ReadOneByte needs an unsigned char*.
- Code: Select all
SerialBufferedTransmitOneByte(buffer[i])
- Code: Select all
SerialBufferedTransmitOneByte(&buffer[i])
- Code: Select all
SerialBufferedTransmitOneByte(buffer + i)
Edit:
Oh, that was a bad sample.
I thought Serial_ReadOneByte needs an unsigned char*.
Last edited by Casimo on Thu Mar 07, 2013 4:48 pm, edited 1 time in total.
- SimonLothar
- Senior Member
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: Serial port questions
The hardware handshake is accomplished by the pins DCD, DTR, DSR, RTS and/or CTS. The CASIO-calculators serve the pins RD and TD, only. T. i. the hardware handshake is disabled inherently.happy wrote:But how do I disable hardware flow control?
Are you sure, that your receiving device does not need some line terminating sequence like CR, LF or CRLF, before it accepts a command?
I'll be back!
- helder7
- Senior Member
- Posts: 369
- Joined: Tue Jan 03, 2012 11:24 pm
- Calculators: Casio Afx 1.0, Casio fx-9860GII SD, Casio Classpad 330, Casio fx-CG20, Casio Classpad fx-CP400
Re: Serial port questions
What is the "receiving device" (I read that you wanted to do something wifi)? For you be sure that is a code problem and since you have a cable "serial to 3 pin" I suggest you do the test (rs232 logger) with pc.
A good rs232 logger freeware for windows is this.
If you're using mac os x goSerial should do the same (not tested by me).
A good rs232 logger freeware for windows is this.
If you're using mac os x goSerial should do the same (not tested by me).
SiO2 + CaCO3 ----------> CaSiO3 + CO2
Re: Serial port questions
SimonLothar wrote:Are you sure, that your receiving device does not need some line terminating sequence like CR, LF or CRLF, before it accepts a command?
Nothing in the manual suggests this. http://serialio.com/support/wifi/WiSnap_User_Guide_2.21.pdf
helder7 wrote:What is the "receiving device" (I read that you wanted to do something wifi)?
WiSnap
helder7 wrote:For you be sure that is a code problem and since you have a cable "serial to 3 pin" I suggest you do the test (rs232 logger) with pc.
I am hoping it is code problem. But what is this supposed to do? Print/log anything that is sent from the calculator's serial port? For my addin, it doesn't (I used goSerial, thanks). It doesn't print anything for Flourish or fxMouse either. May be I have set up wrong?
Re: Serial port questions
Aargh. I wrote this long post and accidentally closed my browser tab. I was trying to analyse where I stand with this problem. Here goes:
1) 3pin - serial cable works: Tested by transferring files using FA-124 (connected the cable to laptop via a USB-Serial adapter)
2) WiSnap works: Connected it to the laptop using the same USB-Serial adapter and configured using Macwise.
3) WiSnap's "blue LED" lights up whenever data comes to its serial port. This is as per the manual. Also confirmed this during (2). Whenever I pressed a key on the laptop (while connection is on in Macwise), the LED would light up.
4) Connected WiSnap to calculator using the 3pin-serial cable and ran my addin. Addin writes to the serial buffer whenever EXE is pressed. So whenever I pressed EXE, blue LED on WiSnap should've lit up. It didn't. No LED even with Flourish or fxMouse (I'm assuming something gets written to the Serial buffer whenever UP, DOWN, VAR etc. is pressed?)
So, even though the manual doesn't say anything about it, Simon's guess is plausible. But how do I confirm this? And what do I send?
Another thought: is the connection between 3pin-serial's female and WiSnap's male plug loose (though I can assure you I have pressed them together as much as possible)? Am I clutching at straws here?
1) 3pin - serial cable works: Tested by transferring files using FA-124 (connected the cable to laptop via a USB-Serial adapter)
2) WiSnap works: Connected it to the laptop using the same USB-Serial adapter and configured using Macwise.
3) WiSnap's "blue LED" lights up whenever data comes to its serial port. This is as per the manual. Also confirmed this during (2). Whenever I pressed a key on the laptop (while connection is on in Macwise), the LED would light up.
4) Connected WiSnap to calculator using the 3pin-serial cable and ran my addin. Addin writes to the serial buffer whenever EXE is pressed. So whenever I pressed EXE, blue LED on WiSnap should've lit up. It didn't. No LED even with Flourish or fxMouse (I'm assuming something gets written to the Serial buffer whenever UP, DOWN, VAR etc. is pressed?)
So, even though the manual doesn't say anything about it, Simon's guess is plausible. But how do I confirm this? And what do I send?
Another thought: is the connection between 3pin-serial's female and WiSnap's male plug loose (though I can assure you I have pressed them together as much as possible)? Am I clutching at straws here?
Re: Serial port questions
SimonLothar wrote:The hardware handshake is accomplished by the pins DCD, DTR, DSR, RTS and/or CTS. The CASIO-calculators serve the pins RD and TD, only. T. i. the hardware handshake is disabled inherently.
Didn't understand any of this (:-
From the manual: The “WiSnap” radio module is a complete standalone embedded wireless LAN access device. The device has an on-board TCP/IP stack and requires only 4 pins (POWER, TX, RX, GND) to design in. Once initial configuration is set, the radio can automatically access the Wi-Fi network and send/receive serial data over UART.
What does this mean? Will this support Casio calculators..?
- SimonLothar
- Senior Member
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: Serial port questions
I tried your code.
You must close the serial channel after you finished.
Even if you switch off the calculator, the OS remembers an open serial channel.
Place
while( Serial_Close( 0 ) == 5 ){};
before serialSend exits. This call waits until the interrupt handler has finished its task.
To check for a terminating sequence, try
serialSend( "1w-ab-d7\x00D" );
serialSend( "1w-ab-d7\x00A" );
serialSend( "1w-ab-d7\x00D\x00A" );
You must close the serial channel after you finished.
Even if you switch off the calculator, the OS remembers an open serial channel.
Place
while( Serial_Close( 0 ) == 5 ){};
before serialSend exits. This call waits until the interrupt handler has finished its task.
To check for a terminating sequence, try
serialSend( "1w-ab-d7\x00D" );
serialSend( "1w-ab-d7\x00A" );
serialSend( "1w-ab-d7\x00D\x00A" );
I'll be back!
- SimonLothar
- Senior Member
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: Serial port questions
happy wrote:SimonLothar wrote:The hardware handshake is accomplished by the pins DCD, DTR, DSR, RTS and/or CTS. The CASIO-calculators serve the pins RD and TD, only. T. i. the hardware handshake is disabled inherently.
Didn't understand any of this (:-
No worries. Hardware handshake is something ancient. And they happily handshaked ever after. As the WiSnap manual says, you do not need hardware handshake.
The Casio calculators won't supply the POWER. But I understood that the WiSnap has its own power supply. Concerning TX, RX and GND the Casio calculators are very reliable and standardized serial devices.happy wrote:From the manual: The “WiSnap” radio module is a complete standalone embedded wireless LAN access device. The device has an on-board TCP/IP stack and requires only 4 pins (POWER, TX, RX, GND) to design in. Once initial configuration is set, the radio can automatically access the Wi-Fi network and send/receive serial data over UART.
What does this mean? Will this support Casio calculators..?
I'll be back!
Re: Serial port questions
SimonLothar wrote:As the WiSnap manual says, you do not need hardware handshake.
But I understood that the WiSnap has its own power supply. Concerning TX, RX and GND the Casio calculators are very reliable and standardized serial devices.
Thanks. Powered by 2 AAA batteries.
SimonLothar wrote:while( Serial_Close( 0 ) == 5 ){};
serialSend( "1w-ab-d7\x00D" );
serialSend( "1w-ab-d7\x00A" );
serialSend( "1w-ab-d7\x00D\x00A" );
Did all this, no luck..
Who is online
Users browsing this forum: No registered users and 54 guests