drjaymz
Registered: 16/12/11
Posts: 27
|
| Posted 02/03/12 at 06:14 AM | Reply with quote #1 |
|
| I have been banging my head against the table for a couple of days but it is not helping the situation.
I can talk to my 24PT display just dandy at 9600 Baud. But there is no way to change it to 256000 which is what I need.
You'd think you could use the set baudrate cmd of 0x51 followed by 0x0F wouldn't you? Nope. The problem is that using the netduino and others when you change the baudrate you need to close and reopen the serial port.
Here's what I know.
1) The Picaso does not acknowledge the command at the rate at which you send it, it waits 100ms or so and then replies at the new speed. Dumb, but ok I can live with that. 2) when closing and reopening the serial port in the netduino the TX line will be undefined during the transition. 3) this transition results in the picaso thinking there is a start bit. 4) the picaso will then no longer respond.
So far the answer would seem that you're stuffed. I have read half a dozen complaints about setting the default rate and I can see now why. The only thing I can think of is a weak pull up resistor on the TX line, but with the serial port defined I don't know if it is driven at this point or not.
I thought about sending garbage at the new rate and get the picaso into a known state. At least if I get a NAK who cares as long as we are all friends now at 256k.
Another bodge seems to be adding an autoexec file on an SD card, but come on.
I'm quite peeved because I raved about the Goldilocks but I was ok with that because it would autodetect the baudrate. At the moment the only thing I can do with my new display is use it to fix a wonky table leg.
Please restore my faith in Australian engineering? Come on, all you've invented so far is the rotary washing line...  __________________ Regardz
James |
| Loading... | |
ESPsupport
Moderator
Registered: 27/01/09
Posts: 4,256
|
| Posted 02/03/12 at 07:21 AM | Reply with quote #2 |
|
You should be able to find this in this forum, but I will repeat it here.
When you set the display for 256000 you should set your system to 282353.
This is caused by 'rounding' errors inside the Picaso chip.
Why is waiting 100ms and then sending an ACK at the new speed 'Dumb'? Surely an ACK at the old speed would be way dumber?
Since 'even windows' can change the baud rate without closing the comms port I would suggest you need to get netduino 'fixed', if, indeed, there is a problem, we can't help you there.
We will be adding a settable startup baud rate option to DISP in the near future. We just hope we wont see an increase in warranty claims for 'it doesn't work' just because people have changed the default baud rate and forgotten what they set it to. |
| Loading... | |
drjaymz
Registered: 16/12/11
Posts: 27
|
| Posted 02/03/12 at 08:05 AM | Reply with quote #3 |
|
| Ok, here's one...
Called the set baudrate and actually set it to 9600 i.e. unchanged - there is no response from picaso. It then no longer responds to any further commands. If I don't ever set the baudrate there is no problem except that its too slow to draw the stuff I am drawing. I had no problem with the goldilocks. It sucks that I cannot use this display instead.
I think its all down to the fact that the TX line must alter when the speed is set. From there the picaso gets into a deadlock that you cannot recover from. I will try a weak pull up to prevent a start bit. That said - if there was an error on communication it should ignore the byte or respond with NAK.
I can't change the way the serial ports work so I guess thats the end of that. __________________ Regardz
James |
| Loading... | |
drjaymz
Registered: 16/12/11
Posts: 27
|
| Posted 02/03/12 at 08:18 AM | Reply with quote #4 |
|
PS - I say its dumb because if you specified an invalid number or it wanted to send a NAK you would never know about it. And by dumb I meant it as in you wouldn't get a response if the command failed - or you might but it would be total garbage. Then you don't know where you are. __________________ Regardz
James |
| Loading... | |
ESPsupport
Moderator
Registered: 27/01/09
Posts: 4,256
|
| Posted 02/03/12 at 01:26 PM | Reply with quote #5 |
|
Quote: Called the set baudrate and actually set it to 9600 i.e. unchanged - there is no response from picaso. Are you saying that if you set the baud rate to 9600 and just wait on the netduino that you don't get an ACK after just over 100ms? |
| Loading... | |
drjaymz
Registered: 16/12/11
Posts: 27
|
| Posted 02/03/12 at 06:35 PM | Reply with quote #6 |
|
| What I am saying is that when I send 9600 I get no response after closing and opening the serial port. I will get to the bottom of this fricking thing. My next test when I get home will be to send hello world then close and open the serial port, add a 100ms delay or so and then send 'world hello' and see what happens. This will rule out any issues with the netduino not being able to support that (which is fair fundamental you would have thought). The source for the tinyclr basically reads that if m_PortOpen then it throws an exception on baudrate change. Now - if I was feeling really brave I could fiddle that and recompile it but things like that tend to be done for a reason.
If that doesn't work then its back to the netduino forums. If that does work then we have to find our why the picaso doesn't respond after the port has been closed and opened again on the baud change. I will try a pull up to stop that level changing. If it is driven to some other value then plan c will be to bodge it with a transistor from another GPIO.
I will post back so that anyone else using a netduino will know what happens. __________________ Regardz
James |
| Loading... | |
Atilla

Moderator
Registered: 18/03/07
Posts: 812
|
| Posted 02/03/12 at 08:14 PM | Reply with quote #7 |
|
| James, Have you considered using the GFX platform? It gives you lots of freedom, you can set your baud rate to whatever speed you like. You can completely off load all your graphics to the Picaso and write your screen routines in 4DGL. You can then setup a simple serial (or i2c) coms link with the netduino and implement your own simple/complex protocol. If you can code in C or .net you can code in 4DGL. There are many Netduino users who have done some nifty aplications, I'm sure if you contact them they'll be more than happy to help.
Here are some youtube vids from one of the users:
Hope this helps! __________________ Atilla |
| Loading... | |
ESPsupport
Moderator
Registered: 27/01/09
Posts: 4,256
|
| Posted 02/03/12 at 08:47 PM | Reply with quote #8 |
|
Not sure how the display connects to the netduino, but closing and reopening the port will not 'reset' the display unless DTR is toggled during the close and reopen process. |
| Loading... | |
drjaymz
Registered: 16/12/11
Posts: 27
|
| Posted 02/03/12 at 09:24 PM | Reply with quote #9 |
|
| I have considered it, and the majority of the project is completed, but I have opted for a different display because the OLED display was not suitable for a cockpit, and to be honest was a little small.
I then wanted to replace the 128x128 with the 2.4" display and I knew there would be come recoding, but I cannot get it to communicate at the speed I need. Simple as that.
As for reset being toggled with DTR this is irrelevant as the TX/RX are connected to a UART I/O and the Reset is to a GPIO pin - 3 pins and power - simple. As I keep saying when changing the baud rate the netduino has to close the port and reopen which shouldn't affect anything but in doing so the picaso interprets it as a start bit and then I cannot recover the picaso after that since the picaso doesn't seem to have any recovery from a communication error except for a reset which of course then puts you back at 9600. It wouldn't even matter if the picaso sent a NAK back but at least then we could send valid commands and we'd be fine but it doesn't it remains quiet permanently.
What is the effect of a communications error on the protocol for the SGC? Lets say it received an 0xEF in between valid commands? I would have thought it would return an invalid transaction code of some description, but it doesn't it just sits there being dumb until its reset. OR the netduino has a problem with close and reopen. I will find out for sure later on and share.
So it doesn't look like I can use this display for this project. All I wanted is the baudrate to be set at >200kbd. That is all. __________________ Regardz
James |
| Loading... | |
drjaymz
Registered: 16/12/11
Posts: 27
|
| Posted 03/03/12 at 05:19 AM | Reply with quote #10 |
|
| Update - my problem is not caused by the netduino at all. If I close and open the port all is well. As long as I do not select any speed other than 9600. I did see some characters on the Serial port but they were gibberish - which suggested it was simply not the correct Baud. I wrote a program that tests all speeds in 200 bps increments and left it running whilst I had a beer. There were no valid results. Basically changing the Baud craps it out.
I connected up the FAT controller using an approved USB level converter and this is what happens.
First we are at 9600:
Version 0.015 [56 00] <01 10 20 24 32> Get Status 0.000 [7A] <08> Version 0.094 [56 01] Micro-LCD Hardware Revision: 10 Firmware Revision: 20 H res: 240 V res: 320
you call version and you get everything you didn't really want to know but anyway it is valid data.
Set Comm Speed 128000 0.156 [51 0E] <06>
You then call set baud to lets say 128000 (but it doesn't matter none work above 115200)
Version 0.405 [56 01] <No response>
and 'oh no' its buggered. Seems the official tool don't get any better luck than I did with my netduino.
Erase Screen 0.109 [45] <No response> Erase Screen 0.109 [45] <No response>
Just to make sure you can poke all you want its dead now unless you reset it.
So you see, once you set a speed there is no longer a response so it wasn't me going nuts. It doesn't work properly. They all work to 115200 then after that you don't get any response. I am running Rev20 with the latest controller.
Game over. __________________ Regardz
James |
| Loading... | |
ESPsupport
Moderator
Registered: 27/01/09
Posts: 4,256
|
| Posted 03/03/12 at 07:16 AM | Reply with quote #11 |
|
Have you read this post? http://4d.websitetoolbox.com/post/unable-to-change-baudrate-4627662?highlight=129032 It describes the steps needed to communicate faster than 115200. I'm sure there is a more concise description of the hows and whys somewhere, but I can't find it at the moment.  |
| Loading... | |
drjaymz
Registered: 16/12/11
Posts: 27
|
| Posted 03/03/12 at 08:35 AM | Reply with quote #12 |
|
| I have seen this post and tried the setting. I have used the FAT controller - I have noted the wonky baudrate but it doesn't work above 115200 no matter what I do. And if you stick a scope on it the display isn't sending a 0x06 anyway I thought I could measure the bit width and talk to it at that speed which was nothing like what you mentioned and it doesn't respond anyway. So the result is the display don't work.
I am talking directly with the USB TTL interface right now and its the one from 4D. Basically it doesnt work properly at 115200 and not at all above that on all settings. __________________ Regardz
James |
| Loading... | |
ESPsupport
Moderator
Registered: 27/01/09
Posts: 4,256
|
| Posted 03/03/12 at 09:05 AM | Reply with quote #13 |
|
Here's a log from a CE5 to a uLCD-24PT showing a change of baud rate to 128k and 256k with a couple of commands at both Quote: Version 0.000 [56 00] <01 10 20 24 32> 4DRom file not found, cannot simulate Display Get Status 0.000 [7A] <08> Version 0.109 [56 01] Micro-LCD Hardware Revision: 10 Firmware Revision: 20 H res: 240 V res: 320 Erase Screen 0.032 [45] <Ack> Set Comm Speed 128/129 0.140 [51 0E] <06> Version 0.094 [56 01] Micro-LCD Hardware Revision: 10 Firmware Revision: 20 H res: 240 V res: 320 Erase Screen 0.032 [45] <Ack> Set Comm Speed 256/282 0.140 [51 0F] <06> Version 0.093 [56 01] Micro-LCD Hardware Revision: 10 Firmware Revision: 20 H res: 240 V res: 320 Erase Screen 0.031 [45] <Ack>
What is the model of the 'USB TTL interface'? What is the length of wire between the interface and the display? |
| Loading... | |
drjaymz
Registered: 16/12/11
Posts: 27
|
| Posted 03/03/12 at 06:23 PM | Reply with quote #14 |
|
If I could get it to do that I would not be having such a mare.
Its the CP2102 and the loom I am using is 15cm. I can post the result, but its the same, no response.
I wonder if the oscillator is out of spec? - Which should be more or less impossible. I will get a scope trace of the actual output of the display. __________________ Regardz
James |
| Loading... | |
ESPsupport
Moderator
Registered: 27/01/09
Posts: 4,256
|
| Posted 03/03/12 at 08:36 PM | Reply with quote #15 |
|
For the CP2102 you have to run the AN205SW as documented in the other post, using the 256/282 setting only works for the CE5. Have you done that? Can you verify that the settings have changed? It would seem highly improbable that the osc could be out of spec, but still 'close enough' to work at 9600baud, but not other speeds. What about 19200 and 38400? Does it work with them? |
| Loading... | |
drjaymz
Registered: 16/12/11
Posts: 27
|
| Posted 04/03/12 at 03:41 AM | Reply with quote #16 |
|
| AN205SW allows the setting of non-standard bauds. I will try this later on. And I agree crystals are extremely accurate. I also think that the netduino I am using has a baudrate generator that also has errors so I will let you know when I get a scope on it next week.
Hopefully there will be a setting where we can find a compromise. And when I figure it out I will post in this thread.
It would have been better however if the SGC operated at the frequencies indicated on the datasheet. __________________ Regardz
James |
| Loading... | |
drjaymz
Registered: 16/12/11
Posts: 27
|
| Posted 06/03/12 at 06:34 AM | Reply with quote #17 |
|
| Nope, using the driver to allow non-standard bauds does not work.
Version 0.109 [56 01] Micro-LCD Hardware Revision: 10 Firmware Revision: 20 H res: 240 V res: 320 Set Comm Speed 128/129 0.140 [51 0E] <06> Version 0.406 [56 01] <No response> Erase Screen 0.109 [45] <No response>
Would you be able to find the reference to AN205SW?
__________________ Regardz
James |
| Loading... | |
ESPsupport
Moderator
Registered: 27/01/09
Posts: 4,256
| |
endoracing
Registered: 05/03/12
Posts: 4
|
| Posted 09/03/12 at 03:51 AM | Reply with quote #19 |
|
Along these same lines...
I haven't tried it yet so this is just a preemptive question, does the cp2102 require modification to communicate at 9600 or is it when you switch to higher baud rates ?
Thanks
|
| Loading... | |
ESPsupport
Moderator
Registered: 27/01/09
Posts: 4,256
|
| Posted 09/03/12 at 06:52 AM | Reply with quote #20 |
|
It should be fine up to 115200. |
| Loading... | |
drjaymz
Registered: 16/12/11
Posts: 27
|
| Posted 09/03/12 at 11:18 PM | Reply with quote #21 |
|
Sometimesits ok at that speed, sometimes I get no response. Will record the trace and you can make your own mind up. Increasing the stop bit length seemed to make it more robust at this speed. But no joy at anything above that. __________________ Regardz
James |
| Loading... | |
drjaymz
Registered: 16/12/11
Posts: 27
|
| Posted 11/03/12 at 08:09 PM | Reply with quote #22 |
|
| OK - here is the answers - hopefully its of use to someone.
When using the Netduino with the Picaso SGC neither of them operate at the correct baudrate - so I wrote a program that used trial and error to work out what the settings should be.
For 115200 bps (0x0D) the netduino serial ports peed should be set to 113250. For 256kbps the netduino serial port speed should be set to 260900.
Then it all works dandy. So even if the Picaso was operating it the correct published speed it is unlikely that it would have worked anyway.
also change it like this: SetBaud(0x0F); //256K ChangePortSpeed(260900 , portName); Thread.Sleep(500); port.DiscardInBuffer(); port.DiscardOutBuffer();
where:
private bool ChangePortSpeed(int baudrate, string portName) {
Debug.Print("New Port Speed " + baudrate.ToString()); if (port != null) { port.Close(); port.Dispose(); }
port = new SerialPort(portName, baudrate, Parity.None, 8, StopBits.One); port.Open();
return true; }
/// <summary> /// tells the display to go to new baud rate /// </summary> /// <param name="Baud">parameter for baudrate see data sheet</param> public void SetBaud(byte Baud) { var bytes = new byte[] { 0x51, // cmd = B Baud }; Write(bytes); }
__________________ Regardz
James |
| Loading... | |
ESPsupport
Moderator
Registered: 27/01/09
Posts: 4,256
|
| Posted 12/03/12 at 06:37 AM | Reply with quote #23 |
|
Good to see you got it working, sorry about the difficulties you had. Hopefully someone else will benefit. |
| Loading... | |