Serial LCD display for PIC projects ?

zorgloub

Member
Greetings to the Community.
Would you have a serial display to propose to me, compatible with PIC projects (Kit, schematic or website).
In fact, also user of MCU Basic picaxe I have the serial displays AXE 133 and 134 (2x16 and 4 x 20 OLED display), driven by a Picaxe.
But these do not display correctly the signals coming from a PIC Port leaving a SEROUT signal ...

Thanks in advance.
 

Goeytex

Senior Member
Not precisely sure what you are asking. But I am guessing that you may be wanting to know how to drive an AXE033 with a PIC that is not using Picaxe Basic.

If this is the case then the serial out to the AXE033 must be inverted @2400 baud. On many PIC micro-controllers this means you need to set the SCKP bit of the BAUDCON register to invert the serial out data.. How this is done depends upon the compiler you are using.

If my guess is wrong, please fully explain what you are trying to do and provide your code so that folks can help.
 

hippy

Technical Support
Staff member
I have removed posts which link to third-party products and promote non Rev-Ed alternatives - This forum isn't here to promote other manufacturers products - Most search engines should cover the range of alternatives available.
 

zorgloub

Member
Greetings to the community.
@hippy.
There are certainly fans of BASIC programming in general on this forum!
For my part, I started with Basic Stamp2sx (relatively expensive) whose programs could be transposed into a PIC thanks to the (expensive) PicBasicPro Compiler.
I then started, a long time ago, with Picaxes... and I don't intend to turn away from them... be reassured!
If you go on my site you will see that all the programs are written for Picaxes !
I use the AXE 134 interface (OLED display 4x40Char) and I have to admit that I'm trying to understand the timing of the SEROUT N2400_16 or N2400_4 command of the picaxes!
I thought the SEROUT command was "universal" but it doesn't seem to me.
Indeed, when I try to display a SEROUT N2400 signal from a Pic, it displays anything!
The chronogram is moreover different! (see attached picture).
I thus sought to understand and use these commands SEROUT!
Thank you already to all.
 

Attachments

zorgloub

Member
Not precisely sure what you are asking. But I am guessing that you may be wanting to know how to drive an AXE033 with a PIC that is not using Picaxe Basic.

If this is the case then the serial out to the AXE033 must be inverted @2400 baud. On many PIC micro-controllers this means you need to set the SCKP bit of the BAUDCON register to invert the serial out data.. How this is done depends upon the compiler you are using.

If my guess is wrong, please fully explain what you are trying to do and provide your code so that folks can help.
@Goeytex
Hi
But the N parameter of the N2400 parameter automatically indicates a signal inversion, am I wrong?
I'm trying to understand the shape of a SERIAL signal which I thought was "universal" (but my chronograms prove me wrong) and does this speed depend on the working frequency of the MCU?
(So I use PicBasicPro Compiler to write and compile my programs in Basic for PIC.But I think I understood that this is not here the place to publish PBP code ;) How can I contact you "in private"? )
Thank you.
 
Last edited:

Goeytex

Senior Member
@zorgrloub

I do not use PicBasicPro so I can't help you with that.

Am I correct that you are trying to use a PIC16F630 with code compiled with PicBasicPro to send serial data to an AXE033?

Yes or No?

The PIC16F630 has no UART peripherial so the serial must be bit-banged(software) by whatever compiler you use. The Picaxe serout command uses either "N" or "T" to to set the serial polarity to either Inverted(N) or True(T). Inverted means that the TX data idles low and that a "1" is low and a zero is high. True means that the TX data line Idles high and that a "1" is high and a zero is low.

The Axe033 expects the serial signal to idle low ( inverted). This is uncommon and pretty much unique to Picaxe as most serial devices expect a True polarity. It also expects a baud rate of 2400. This equates to a bit width of 1,00000 / 2400 or ~416.6 microseconds.

With PicBasicPro you will need to use what ever command they use to send software serial data at 2400 baud with the signal inverted.

I am looking at your signals ... The baud and polarity seem ok with the difference being the space between bytes. If there is a way to do it with PBP try to setup the serial to use 2 or 3 stop bits to add space between the transmitted data bytes. Alternatively there may be a way to add a short delay ( 1ms) between sending bytes. This delay between bytes may be necessary to allow the AXE033 to keep up with the data being sent.

Looking at the PBP manual ... (page212) it seems you can add a 1 ms space between bytes with "DEFINE CHAR_PACING 1000" . Suggest you try that.

For more specific help with PicBasicPro, I am sure they have a help forum of some kind.

Goey
 
Last edited:

zorgloub

Member
Hi goeytex

I have indeed just solved the problem and managed to correctly display the Serout data from the Pic16F630 on the Picaxe AXE133/AXE134 OLED Display.
In fact, the PIC transmission is much faster than the Picaxe, in the sense that the Picaxe puts a space of about 1 msec between each byte sent, unlike the Pic which puts almost no delay!
But the PBP compiler allows to force the Pic to also place a space as important between its transmitted bytes.
It is indeed the CHAR_PACING 500 command which, in my case, places a delay of 500µsec+420µsec for this Pic clocked at 16Mhz.
Thanks and Happy Basic to all.
 

Flenser

Senior Member
zorgloub,

The main difference in your chronogram appears to be the length of the space between characters.

I've never used PicBasicPro but I found the manual online and it has this comment:
"In some cases, the transmission rates of SEROUT instructions may present characters too quickly to the receiving device." and suggests using the "DEFINE CHAR_PACING" command to change the time between characters in microseconds.

Try adding "DEFINE CHAR_PACING 1000" to specify a 1 millsecond pause between characters to see if this helps.
 

hippy

Technical Support
Staff member
In fact, the PIC transmission is much faster than the Picaxe, in the sense that the Picaxe puts a space of about 1 msec between each byte sent, unlike the Pic which puts almost no delay!
Glad you got things working.

A fairly long inter-byte gap period is used with SEROUT to cater for when a user may have used multiple SERIN to read sequential bytes and the small overheads the PICAXE has in storing a byte when it has received one. It makes inter-PICAXE communications more reliable.

The AXE133 uses a PICAXE and it needs time to take a byte, put it to the display, and be ready for the next. This usually works fine for a PICAXE sending to an AXE133, but it will be necessary to add that inter-byte gap to ensure the AXE133 doesn't miss bytes or receive corrupted data when sending with HSEROUT or from some other microcontroller.
 

zorgloub

Member
Hi Hippy,
Didn't Rev Ed (Picaxe_Store) market such a serial LCD driver with a PIC programmed without interpreter for more speed ?
I can't find it on your site.
Could it be the small AXE131 but also driven by an 18M2?
 
Last edited:

Flenser

Senior Member
Oops. I missed zorgloub's update that he had already solved the problem when I posted my last reply.

The full AXE033 Serial LCD Module (LCD + PCB) is still available so the doco for the module/PIC chip is available and it operates at N2400 so the pre-programmed AXE033 PIC chip wouldn't be any faster than the AXE133 that zorgloub already has.

While the FRM010 is a programmed PIC chip it's data sheet specifies it operates at T2400.

The AXE033 module also supports I2C at at slow speed (i2cslow). I don't have any experience using I2C so don't know how the speed of i2cslow compares with serial at 2400 baud but the AXE033 doco makes the recommendation "Note that a 10ms delay (pause 10) should be placed between consequative writei2c commands to allow time for the data to be processed" which doesn't sound very fast.
 

Solar Mike

New Member
Alternative serial display drivers (Google LCD #117) that work at 19200 baud are readily available if you need a faster device.

Cheers
Mike
 

hippy

Technical Support
Staff member
I believe the FRM010 chip is now obsolete and the AXE033 is considered legacy. We would recommend using the AXE133 range of display module. For most PICAXE projects they should be plug-and-play.

There are numerous display modules out there, serial, I2C and SPI. The AXE133 range was developed to make things easier for PICAXE users, having a unified product range with standardised connections and firmware. The AXE133 also allows '18M2 plus display' projects to be created without the complexity of wiring up a parallel display.

We considered using a 20X2 instead of an 18M2 as the display driver but, as always, compromise comes into play. A 20X2 would be more capable but would have increased cost. Ultimately we determined PICAXE users preferred lower cost and most PICAXE projects would not require those additional capabilities so went with the 18M2.
 

julianE

Senior Member
Oh no, I have been using phanderson site for a long time, excellent service from both father and son, I just went in and put in an order, my last.
I guess I'll be ordering from sparkfun unless there is a better alternative. i sort of dislike sparkfun tho i have spent plenty of money there. It's the hipster cool smugness that grates on the nerves. Who does erco use for his picaxe needs, I am in the states.
 

hippy

Technical Support
Staff member
I just went in and put in an order, my last.
Due to this I am guessing "I will be selling out my stock of Picaxe and closing the store" or was there some other issue ?

It's the hipster cool smugness that grates on the nerves
It's the Young Un's it appeals to, apparently. It won't be long before youll be saying "judges look young these days" :)
 

julianE

Senior Member
Yes Hippy, it's because he's closing shop, phanderson was the best, I can see how it's probably a burden on his son.
Yea, you are right about age, I'm turning into a curmudgeon. I'm at that cusp where I'm just becoming invisible to younger people, in time I will completely disappear.

Thanks Goeytex for the RobotShop link, I wish the free shipping was a bit lower but prices are reasonable.
 

julianE

Senior Member
Got my order from RobotShop, bunch of 18M2 and 20M2, very good service and shipping wasn't bad at all. I also ordered their soil moisture sensor and it's much better made than the usual ebay offering.

I did not believe the media hoopla over shortages until i looked at mouser and digikey, hardly any microcontrollers in stock. 08M2 are next to impossible to get in the states, everyone is out, my guess is because the base PIC chip is unavailable.

I bought a bunch years ago and have more PIC chips than I have picaxe chips so I decided to try programming the native PICs using great cow basic, I'm having decent success with it but the documentation relative to the picaxe is terrible, takes me forever to accomplish a task that takes minutes with picaxe. I'm curious what others use to program raw pic, i don't mind learning another platform but i'd like something that isn't too burdensome like the offerings from microchip where it takes inordinate time to just set all the ports up and my pc struggles to load the IDE.
 
Last edited:

tmfkam

Senior Member
I use GCB. I don't care for the new or old IDE so use the compilers in an external editor.

GCB is fabulous though documentation can be terse or nonexistent. The forum is mostly very helpful. I have managed to figure most things out and I generally post a 'guide' if it took me a while to try to help others and to remind myself.

I looked at Positron Basic recently. Looks good and has decent documentation [which reminded me greatly of the PicAxe documentation] and a free trial available.
 

julianE

Senior Member
GCB is fabulous though documentation can be terse or nonexistent. The forum is mostly very helpful. I have managed to figure most things out and I generally post a 'guide' if it took me a while to try to help others and to remind myself.

I looked at Positron Basic recently. Looks good and has decent documentation [which reminded me greatly of the PicAxe documentation] and a free trial available.
Thanks very much for your suggestions. I too have managed to get things working in GCB but it's not easy, lots of trial and error and it takes time taking the chip out and moving it to a programmer. I will certainly look for your guides on the forum that is nowhere as helpful as the picaxe forum.
Only reason I'm interested in an alternative to picaxe is that i have a number of raw pics gathering dust and it could be fun learning something new.

I remember trying Proton basic (now Positron) many years ago, the new price is very reasonable, will read the documentation and then decide on the purchase, the cost is a trifle but hard to break old thrifty habits.
 

tmfkam

Senior Member
It looks as though Proton Basic has been made available as a legacy download at no charge [could be wrong, but it did work for the few hours I ran it]. I don't know how recent the device coverage is though.

Positron covers many devices, more than mikroBasic certainly. GCB also covers many, many devices possibly the most I'm aware of, including very old ones.
 

steliosm

Senior Member
There is also OshonSoft BASIC compilers for PICs that you might want to take a look at. It's not free but it's pretty cheap.
 

julianE

Senior Member
It looks as though Proton Basic has been made available as a legacy download at no charge [could be wrong, but it did work for the few hours I ran it]. I don't know how recent the device coverage is though.

Positron covers many devices, more than mikroBasic certainly. GCB also covers many, many devices possibly the most I'm aware of, including very old ones.
I perused the positron manual and it's very much like picaxe, serial communication looks almost as good and it has sleep which is a pain in GCB.
I can't find sertxd which is brilliant in picaxe and really good for troubleshooting. It's easy enough to set up a serial port for sending data but additional work compared to picaxe.

i have looked at oshonsoft before and came close to buying it at the old higher price. looks like GCB is pushing prices of compilers down.

The free proton download sounds like a fantastic deal but I'll most likely purchase the latest suite.
 

julianE

Senior Member
I have the latest Positron and have struggled to flash an LED, after many attempts i have it working but very poorly. I'm very underwhelmed, GCB is by far easier and Picaxe runs circles around them both.
 

tmfkam

Senior Member
Regarding 'Sleep' on GCB.

I wrote a clock program that is for a battery powered unit. I periodically switch the CPU frequency to the lowest level possible, do a few loops of 'NOP' [no operation in .asm] to give some approximate timing then return the CPU back to it's original speed [32MHz].

Measuring the difference in current drain between a 'standard' Wait [or pause] gave me an extension in battery life by some margin. Well worth the effort?

PicAxe is superbly easy, the simulation features make development much, much quicker. If OshonSoft were ever able to get their LCD 'pins' flexible in connections [not fixed to a port sequence] I would buy their simulator in a flash.
 

julianE

Senior Member
There is a way to get sleep to work in GCB using watchdog timer it's a pretty involved subroutine, I'm liking your method of just slowing the clock down. I am ready to throw in the towel as far as positron, spent many hours trying to get an led to flash.
Once the chip shortage subsides I'll stock up on picaxe chips, out of everything I have tried it's the most reliable, works every time solution.
 

julianE

Senior Member
Well, I tried the OshonSoft, nice that he let's you try before buy, led blinking away in 10 minutes time. I'm not sure how much better it is than GCB, I'll play with it some more.
 

steliosm

Senior Member
Indeed, Julian Picaxe its actually a small beast. You can do quite a lot of things with it without spending time trying to figure out how to code it. This is also a reason that although I bought the OshonSoft compilers years ago I never got around to actually using them.
 

tmfkam

Senior Member
In the few hours I played with Positron, I had the LED flash example running in a few minutes. Persuading it [and Windows] to correctly invoke my programmer so that I could see whether the device had, or had not, been programmed correctly was a long and drawn out affair. After I had done that I had no time to do any more!
 

julianE

Senior Member
I had to reach out to the Positron to get the flashing working with my chip. Had a response within a day and the chip is flashing away, very good customer support. Positron seems to be for the more knowledgeable user. What I want to use the compilers is for remote sensors, using a picaxe for a sender seems bit wasteful, a very inexpensive microcontroller is more than sufficient to send sensor data.
I'm reading the Oshon documentation , it supports the chips i have on hand so i can test out the code.
 
Top