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 : Dontronics Maximite Serial Ports
Author | Message | ||||
grbl Newbie Joined: 01/12/2011 Location: AustraliaPosts: 4 |
Hi all. This is my first post. I recently purchased the Dontronice Maximite and a Dual RS232 board from Hamfield. Everything works as it should except for the RS232 output data. It is all garbage. I have tried different firmware versions, checked for bad solder joints, and examined the signal levels at the ports on a CRO- +/- 5v. All looks good. Has anyone had this problem and, more importantly, found a solution |
||||
Budgebrewer Newbie Joined: 20/11/2011 Location: AustraliaPosts: 3 |
I've just been reading Geoff's article in this month's SC. I'm guessing this would have everything to do with the reversal of Hamfield's 26-pin I/O compared with that of the MM ? A reversed interconnecting cable might be the go. |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Or perhaps mismatched baud rates. I know this might seem obvious but it is sure way to get garbage from a serial port. Regards, Anthony. |
||||
djuqa Guru Joined: 23/11/2011 Location: AustraliaPosts: 447 |
My thoughts exactly. Incorrect connection would more likely give no output rather than garbage. VK4MU MicroController Units |
||||
rhamer Senior Member Joined: 06/06/2011 Location: AustraliaPosts: 174 |
For the record my connectors are not reversed per the original silicon chip published circuit, and the one published with the Altronics kit. The reversal was actually in Geoff's build of the Maximite, and his solution was to just change the circuit to match the reversed connector. This was the subject of a long debate very early on, and as I was the only one with hardware in the field, I lost. The solution is simple and can be solved in any one of three different ways, but unfortunately it is now made to appear that my boards are incompatible. This is absolutely incorrect, you just have to use the correct cable and they are 100% compatible. Also the reason I chose to continue manufacturing them this way was to avoid even more confusion with 2 versions of my boards, especially as the fix is so simple. Why this was such an important point to make in the latest Silicon Chip article I don't know, but I would have been nice if the real cause was mentioned instead of insinuating that it was a fault in my design. All this has now done is give me a full time job answering email queries from justifiably confused purchasers about something that is not an issue in practice and well explained in my documentation. Regards Rohan Rohan Hamer HAMFIELD Software & Hardware Solutions Makers of the Maximite Expander. http://www.hamfield.com.au |
||||
rhamer Senior Member Joined: 06/06/2011 Location: AustraliaPosts: 174 |
As the others have posted, the most likely cause is mismatched settings between the Maximite and whatever you are communicating with. Can you describe your setup, including which port your using, it's settings and what you are receiving the garbage data on. Also how are you powering the interface board? The RS-232 voltage swings should be more like +-12v. And lastly, are you seeing any activity on the LED's for that port? Regards Rohan Rohan Hamer HAMFIELD Software & Hardware Solutions Makers of the Maximite Expander. http://www.hamfield.com.au |
||||
grbl Newbie Joined: 01/12/2011 Location: AustraliaPosts: 4 |
Thanks for the input. All the above are relevant and I think I have covered them all. I have the reversed cable and it works fine, and the baud rates are correct along with the other comport parameters. I have activity on the leds and +/-6v on the rs232 port pins. The power is from a 9vDC supply. I thought the signal should be +/- 12 but it should work at that level anyway. It is the same on both ports. Port Parameters are 9600,n,8,1 and I have looked at the data out with a couple of different terminals-,a hardware hand terminal and Terraterm on the PC. I have also tried different baud rates and even different rates on the send/ receive ends but no luck. |
||||
grbl Newbie Joined: 01/12/2011 Location: AustraliaPosts: 4 |
Further testing reveals the following. If the following code is used 90 open "com1:9600" as #1 100 dat1$="b" 110 print #1,dat1$; 115 close #1 120 goto 90 i can transmit 1 character continuously. If the semicolon is removed from line 110 I get garbage. If dat1$ is more than 1 character long I get garbage. |
||||
rhamer Senior Member Joined: 06/06/2011 Location: AustraliaPosts: 174 |
try using this code and tell me what happens. 90 open "com1:9600" as #1
100 dat1$="Hello" 110 print #1,dat1$; 111 pause 1000 112 goto 110 115 close #1 You might have to check the pause command syntax. Regards Rohan Rohan Hamer HAMFIELD Software & Hardware Solutions Makers of the Maximite Expander. http://www.hamfield.com.au |
||||
grbl Newbie Joined: 01/12/2011 Location: AustraliaPosts: 4 |
Thanks Rohan I am getting some sense now. There is clearly some crucial timing between the "PRINT" command and when the port is to be closed and further code at least in this instance. It seems to be the "PRINT_ CLOSE- OPEN port sequence that can cause the problems. I can now get data out of both ports. BTW your serial board works fine with the cable made as you describe. |
||||
rhamer Senior Member Joined: 06/06/2011 Location: AustraliaPosts: 174 |
Normally you open a port do all the sending and receiving and after you have finished, close it. However in your example above, I suspect the issue is one of port speed. You are trying to push data out the serial port at a much much slower rate than you are generating it in your loop. I dont know how the MM-Basic uarts work behind the scenes, but it is very likely you are overflowing the TX buffer. Anyway, i'm glad you are making progress. Cheers Rohan Rohan Hamer HAMFIELD Software & Hardware Solutions Makers of the Maximite Expander. http://www.hamfield.com.au |
||||
Print this page |