PDA

View Full Version : uOLED-96-Prop_V4 & FullDuplexSerial



oceaneyes
01-19-2009, 02:12 AM
Hello everyone. I am trying to interface my computer with the uOLED-96-Prop hardware using the FullDuplexSerial.spin code. The problem seems to be that if I specify _clkmode and _xinfreq to get the serial communications code working, then the uOLED-96-Prop_V4 code doesn't work; in fact, neither does the serial communications code although I have verified the code to work without the uOLED-96-Prop_V4 on a different propeller chip. If these two constants aren't specified, as I'm sure most of you know, then the serial communications is mostly just garbage with a few characters recognizable occasionally; the uOLED-96-Prop_V4 code works perfectly, however.

I have been trying various things, using simpler code to isolate the problem but so far nothing is working. I was hoping that someone else may have encountered and solved this problem. Thanks in advance for any help!

Mark Swann
01-19-2009, 02:54 AM
oceaneyes,

Which version of the uOLED-96-Prop do you have? The original 8Mhz model, or the newest 10Mhz model?

In case you haven't tried this already here are the settings for both models.

10MHz: (64MHz)

· _clkmode = xtal1 + pll8x
··_xinfreq = 10_000_000

8MHz: (80MHz)

· _clkmode = xtal1 + pll16x
· _clkmode = xtal1 + pll8x ' (per duffer)
· _xinfreq = 8_000_000


Mark

Post Edited (Mark Swann) : 1/18/2009 7:51:26 PM GMT

Duffer
01-19-2009, 03:00 AM
There are two versions of the uOLED-96-PROP available. The earlier version has a 8MHz crystal and the later version has a 10MHz crystal. Look at the small "FOX" crystal on the back of the display. The frequency is marked on the component.

In either case, you will probably have to run the Prop's PLL at 8X and also set the _XINFREQ to either 8_000_000 or 10_000_000 depending on the crystal on your display. With the 8MHz xtal you'll only be running at 64MHz, but if you have the 10MHz xtal, you'll be running at higest recommended 80MHz.

· _CLKMODE····· = XTAL1 + PLL8X·······················
· _XINFREQ····· = 8_000_000

Or

· _CLKMODE····· = XTAL1 + PLL8X·······················
· _XINFREQ····· = 10_000_000

Best of luck,

Duffer

oceaneyes
01-19-2009, 03:06 AM
Mark,

Thanks a lot man, I guess I have the 10MHz model. I guess I'd like to understand a little more about how the propeller works...I'd been using the following to get serial communications working:

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000

...Actually, I think I understand a little better now. The Propeller Proto Board, which I've been using has a 5.000 MHz crystal oscillator whereas the uOLED has 10 Mhz so if I'm communicating with the computer using the proto board, then I would need _xinfreq to be 5_000_000, but that won't work for the uOLED. Right? I was actually scrolling through your code for the Sparkfun 128 pixel uOLED hoping something would be revealed there but now I see it wasn't a misunderstanding of the code on my part, but the hardware. Everything works great now, thanks for the help!

Mark Swann
01-19-2009, 03:47 AM
Actually duffer is right. I show the setting above for the 8MHz model wrong.

It's actually:

_clkmode = xtal1 + pll8x
_xinfreq = 8_000_000

not:

_clkmode = xtal1 + pll16x
_xinfreq = 8_000_000


I knew better, but I was working from memory.

I will correct my original post.

Mark

Post Edited (Mark Swann) : 1/18/2009 7:53:47 PM GMT

hippy
01-19-2009, 06:32 AM
oceaneyes said...
...Actually, I think I understand a little better now. The Propeller Proto Board, which I've been using has a 5.000 MHz crystal oscillator whereas the uOLED has 10 Mhz so if I'm communicating with the computer using the proto board, then I would need _xinfreq to be 5_000_000, but that won't work for the uOLED. Right?


That's right, _clkmode and _xinfreq has to be matched to the hardware you are running the code on. Once you've done that ( well written ) code should automatically adjust itself to take account of those settings, thus a serial out at 4800 baud will be 4800 regardless.