I want to build a running hours module based upon those ACS712 Current sensing modules sold on fleabay for 99p to display the running hours on my air compressor. Being a 'canny Geordie' I have never though much of re-inventing the wheel however the learning is in working out what makes it turn.
Ideally I want to use an RTC and one of those small 128 x 64 OLED Displays so as when the compressor draws current it increments the running time from a resettable 000 and total overall running time.
My main iterests with this project other than the obvious 'need' is in developing and advancing my personal knowledge with driving OLED displays from the I2C bus.
I'm fairly sure someone may have done this before to where they may be willing to part with some scratch code snippits or if this is of interest to anyone else, please jump in and do it together as a documented GCB project.
Many thanks for taking the time to read this.
Keith
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Look in the DEMO folder for the GLCD demos. What is the explicit chipset of the OLED? this is very important. We support many types but you need to choose the right one.
I have a ACS712 on my bench - I will look to post code for you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The display is a bog standard SSD1306. I have seen your video using this module but I don't particularly want to use an ATMEG processor - still not up to speed with those beasts...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
At this stage I'm open to suggestions. I think you said It needed a minimum 1k of Ram for the display, but I woild rather stay clear of the huge 40 pin types as I have to program them in ICSP mode which is a pain.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I will put up some videos of various chips over the weekend. Programming via ICSP is not the only option. .. we have a very robust serial bootloader. I will include the bootloader in these videos.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your choices of PICs is relatively limited. You need an 8-bit chip with greater than 1324 bytes of RAM - 16f18326 or the 16f18346? Lots of 18f's but only ~47 chips could potentially meet the requirement of RAM. Add the max pin count of 28, add the 32mhz requirement... 12 chips... then, for performance 64mhz ... 4 chips. Not a lot of choice.
I used an 18f to prove the code is easily portable but you need to do some research to get the correct chip.
I will post a link to the video when it has uploaded - but, porting takes seconds and was not a issue beyond looking at the datasheet... oh and finding a chip that meets the requirements. :-)
Last edit: Anobium 2017-03-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please, please, please give tghe Video a thumbs up. No thumbs up and the YouTube search engine will not return these videos in a search. :-( I need thumbs up.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
On a roll. I just hooked up a 16f18326. Works a treat at 32mhz. I used PPSTOOL to setup PPS, changed the I2C ports to set the direction, used IPE to load the code via a PK3 to the chip. Port completed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just went back there and clicked "Like" even though I haven't viewed it yet. I fully expected it to up chuck it, since it's not even available. To my surprise it accepted it. :-)
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Splendid Evan... It will take me a day or two to get to the point to where I can see any results on my display. Have you posted the code for this or is it in the Demo Folder? If it isn't can I please have a copy.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You need to choose a chip. Which one will you go with? I think this is the most important decision.
Will need Great Cow BASIC v0.97.01 plus the very, very latest patches. I did post a set of .h files today which you WILL need. I also have improved the performance of the GLCD drivers.
I have the demos here for the chips I tested. 18f and the 16f. I can post when you need them. Choose that chip first.
I also did this... I used the 16f18326 TinyBootloader+. Works a treat -saves using MP-IPE to load the firmware (once you have loaded the TinyBootloader+ firmware). See video here .
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have order a couple of thos 18F25K50's as in your tube demo bit big perhaps for the task in hand but I don't want dopey results which will cloud my thinking (it doesen't take much no a day's!!) and I have updated my GCB instance to 97.01 last week,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After spending some time with the datasheets for both devices 16F18326 and 18F25K50 I have had a major mind change. the 18F25K50 device is way above my knowledge base and is huge by comparison the the 16F18326.
I have both device in front of me now, I have an updated v.097.02 and I now need to find/buy the tinybootloader program you mention and I should be just about ready to start writing to my display (HOPE 8) )
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to install the bootloader firmware you sent to me but my PicKit3 will not look at the 16F18326, it says it is an unsupported device. I'm sure I have read somewhere that I need to update the filedevice.dat file, but I don't seem to be able to find any further info.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Still beavering away with this project which is going forward in leaps and bounds but I am hitting a bit of a wall with some of the string handling syntax.
What I have is really messy, but it works:
GLCDPrint ( 1 , 4, pad(str(day), 2 ) )
GLCDPrint ( 14 , 4, ":")
GLCDPrint ( 19 , 4, pad(str(month), 2 ) )
GLCDPrint ( 29 , 4, ":")
GLCDPrint ( 33 , 4, pad(str(year), 2 ) )
GLCDPrint ( 72 , 4, pad(str(hours), 2 ) )
GLCDPrint ( 83 , 4, ":")
GLCDPrint ( 88 , 4, pad(str(minutes), 2 ) ) ; Print a padded string
GLCDPrint ( 100 , 4, ":")
GLCDPrint ( 105 , 4, pad(str(seconds), 2 ) ) ; Print a padded string
line 0,16,120,16
What I want to do is to join the variables day,(:) month, (:) year into one pad string as with hours minutes and seconds and somehow include the leading zero's
As always, any help is greatly appreciated.
Keith
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to build a running hours module based upon those ACS712 Current sensing modules sold on fleabay for 99p to display the running hours on my air compressor. Being a 'canny Geordie' I have never though much of re-inventing the wheel however the learning is in working out what makes it turn.
Ideally I want to use an RTC and one of those small 128 x 64 OLED Displays so as when the compressor draws current it increments the running time from a resettable 000 and total overall running time.
My main iterests with this project other than the obvious 'need' is in developing and advancing my personal knowledge with driving OLED displays from the I2C bus.
I'm fairly sure someone may have done this before to where they may be willing to part with some scratch code snippits or if this is of interest to anyone else, please jump in and do it together as a documented GCB project.
Many thanks for taking the time to read this.
Keith
Yes, Should be a fast project to put together.
Look in the DEMO folder for the GLCD demos. What is the explicit chipset of the OLED? this is very important. We support many types but you need to choose the right one.
I have a ACS712 on my bench - I will look to post code for you.
The display is a bog standard SSD1306. I have seen your video using this module but I don't particularly want to use an ATMEG processor - still not up to speed with those beasts...
The code is the same for a PIC. Just change the processor type.
What chip are you planning to use? I can quickly test.
At this stage I'm open to suggestions. I think you said It needed a minimum 1k of Ram for the display, but I woild rather stay clear of the huge 40 pin types as I have to program them in ICSP mode which is a pain.
I will put up some videos of various chips over the weekend. Programming via ICSP is not the only option. .. we have a very robust serial bootloader. I will include the bootloader in these videos.
Thanks again Evan, I will let you know how I get on when I have viewed them.
Last edit: Keith 2017-04-13
Works ok. I will post a video shortly.
Your choices of PICs is relatively limited. You need an 8-bit chip with greater than 1324 bytes of RAM - 16f18326 or the 16f18346? Lots of 18f's but only ~47 chips could potentially meet the requirement of RAM. Add the max pin count of 28, add the 32mhz requirement... 12 chips... then, for performance 64mhz ... 4 chips. Not a lot of choice.
I used an 18f to prove the code is easily portable but you need to do some research to get the correct chip.
I will post a link to the video when it has uploaded - but, porting takes seconds and was not a issue beyond looking at the datasheet... oh and finding a chip that meets the requirements. :-)
Last edit: Anobium 2017-03-26
See the video here
Please, please, please give tghe Video a thumbs up. No thumbs up and the YouTube search engine will not return these videos in a search. :-( I need thumbs up.
On a roll. I just hooked up a 16f18326. Works a treat at 32mhz. I used PPSTOOL to setup PPS, changed the I2C ports to set the direction, used IPE to load the code via a PK3 to the chip. Port completed.
Evan, Youtube is not making your video available. It says "We're processing this video. Please check back later".
Chris
Video still not available.
Still uploading. The upload speed seems to be a function of the 'Thumbs Up'. :-) Very slow today.
I just went back there and clicked "Like" even though I haven't viewed it yet. I fully expected it to up chuck it, since it's not even available. To my surprise it accepted it. :-)
Chris
All sorted now. I will post part two....
Splendid Evan... It will take me a day or two to get to the point to where I can see any results on my display. Have you posted the code for this or is it in the Demo Folder? If it isn't can I please have a copy.
:-)
I have order a couple of thos 18F25K50's as in your tube demo bit big perhaps for the task in hand but I don't want dopey results which will cloud my thinking (it doesen't take much no a day's!!) and I have updated my GCB instance to 97.01 last week,
You will need an update. Email me when you commence your project. These updates will be in any build after v.0.97.02
After spending some time with the datasheets for both devices 16F18326 and 18F25K50 I have had a major mind change. the 18F25K50 device is way above my knowledge base and is huge by comparison the the 16F18326.
I have both device in front of me now, I have an updated v.097.02 and I now need to find/buy the tinybootloader program you mention and I should be just about ready to start writing to my display (HOPE 8) )
TinyBootloader program was installed when you installled Great Cow BASIC. You should have a lovely icon or look in ..\GCB@Syn\TinyBootLoader
I have sent you a bootloader directly to you.
I am trying to install the bootloader firmware you sent to me but my PicKit3 will not look at the 16F18326, it says it is an unsupported device. I'm sure I have read somewhere that I need to update the filedevice.dat file, but I don't seem to be able to find any further info.
You will have to use MPLAB-IPE for this. Hence, the boot loader is very attractive....no MPLAB-IPE
Still beavering away with this project which is going forward in leaps and bounds but I am hitting a bit of a wall with some of the string handling syntax.
What I have is really messy, but it works: