Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Serial Bug (I Think)
Author | Message | ||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi It seems there maybe an issue with the serial code Can somebody please else confirm this 10 SETPIN 17, 8 : SETPIN 18, 8 : SETPIN 19, 8 : SETPIN 20, 8 20 OPEN "COM1:9600" AS #1 30 PRINT #1, "Any Text" This will not output anything on the serial port 10 SETPIN 17, 8 : SETPIN 19, 8 : SETPIN 20, 8 ' SETPIN 18 removed and it now works 20 OPEN "COM1:9600" AS #1 30 PRINT #1, "Any Text" If i include a SETPIN for pin 18 it kills the serial port ? Regards John |
||||
BobDevries Senior Member Joined: 08/06/2011 Location: AustraliaPosts: 266 |
John, according to the manual (page 22) COM1 uses pin 15 for receive, 16 for transmit, 17 for RTS, and 18 for CTS. COM2 uses pin 19 for receive and 20 for transmit. When a serial port is opened the pins used by the port are automatically set to input or output as required and the SETPIN and PIN commands are disabled for the pins. When the port is closed (using the CLOSE command) all pins used by the serial port will be set to a not configured state and the SETPIN command can then be used to reconfigure them. Hope that helps Regards, Bob Devries Dalby, QLD, Australia |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Thanks Bob It is not pin18 that stops it is the serial that stops I am not using rts or cts so pins 18 and 19 should be free for use Thanks John |
||||
Bill.b Senior Member Joined: 25/06/2011 Location: AustraliaPosts: 226 |
Hi John I do not know if this applies to maximite but when I used serial comms via a uart and if you did not require CTS and RTS, you had to bridge CTS and RTS for comms to work. In the interests of the environment, this post has been constructed entirely from recycled electrons. |
||||
seco61 Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 205 |
Hi John. I have just checked the source code and their is a bug in the code. In the SerialOpen routine, the following line: com1_fc = true; Should be com1_fc = fc; So, COM1 is always being opened with flow control enabled. However the code is correctly setting the pin status as it is using "fc" for that check - which means that when you set the pin as a digital output the code is waiting for a valid CTS signal - which it can not get. If you are able to compile the code then you can make the above change and that should fix your issue. Regards Gerard (vk3cg/vk3grs) |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Thanks Gerard I have not tried to complie the code yet Any chance I could be a real pain and ask you to post the fixed Complied code here Many thanks John |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
Hi John, I found this bug a few days ago. I did list it on my website http://geoffg.net/Downloads/Maximite/Firmware_V2.6_Bug_List. txt but I must admit that you need to know where to look! I did not figure that it was a major issue as there are plenty of other I/O pins available so I was going to leave the fix until ver 2.7 (due out in about 5 weeks). Is it a big issue for you? Geoff Geoff Graham - http://geoffg.net |
||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
you should have written it as this 10 'initalise i/o pins 20 setpin (pin) 30 setpin (pin) and so forth you are using one line to set all pins hope this helps sparkey....regards "i may be wrong but i may be write""... technicians do it with least resistance |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Nope not really just got confused as to why the serial comms was not going Thanks John |
||||
Print this page |