Multiple definitions of RXPPS. Do not use RXPPS for I2C SCL and SDA. The data sheet is confusing on the requirements for bi-directional pins. I2C tested with PPS, and Input registers do not need to be set.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Serial output is working if I remove the PORTA.4 stuff
As for Serial input I have no clue.......
I've been trying to toggle RA4 and having no luck, also MCLR RA3 no longer resets the chip.
Its like pwr reset is not setting defaults , Yesterday reset was working....
I was thinking MCLR_ON in config controlled...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
12.3 imply's input must be tied to output And it worked about 2 hrs yesterday right after I did that,
Then I must have changed something that started the tail spin.
By the way.. thx for the code, will keep for ref.....
Right not I'm hung up on toggling porta.4
I just love using a new pic and figuring out the gottcha's , and unfamiliar compiler
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Section 12.3 implys input mut be tied to output, And this worked about 2 hours yesterday,
I must of changed something...
MCLR no longer works, I cant toggle RA4
Serial Output works until RA4 code was added
NO clue if Serial input works
Thx for your code... will look at it
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Digital outputs should not be defined in PPS, they should be default condition. The PortA.4 toggling is being used as a switch input and port output at the same time. Use another port pin for the input or output.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Wher do you see RA4 being used for input ?
I was trying to tell device to use LATA , as for defaults I think the are changing randomly
MCLR no longer works
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I modified a device file on Proton basic and was able to get a good compile after remarking out error s
It would not run with defaults, so I added the following just before Main
....
PPSLOCK = 0x55
PPSLOCK = 0xAA
PPSLOCK.0 = 0 'unlock PPS
RXPPS=0x15'Pin RC5 source is an input for RXRC4PPS=0x14'Pin RC4 source is TX/CKSSP1CLKPPS=0x10'RC0 input SCL I2cRC0PPS=0x18' identify clkSSP1DATPPS=0x11'RC1 input SDA I2c RC1PPS=0x19' identify dataPPSLOCK = 0x55PPSLOCK = 0xAAPPSLOCK.0=1''ED=0x01'lock PPS
The I2c is working and serial output is working, have not tested Serial input....
I can toggle RA4 with no issues [ tried demo pgm on GCB just to toggle Rcx and added RA4, could not get to work]
I now have to figure out the counters and interrupt stuff ...
So it looks like the pps stuff is good.....
will do more checking the get back to GCB
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your posted code barely resembles what GCB code should look like. Honestly it is a complete mess and I am somewhat surprised it works at all.
When changing to a new compiler, it is probabably a good idea to take the time to learn the cababilities of the new compiler, and how to take advantage of its capabilities before attempting to stuff code from another compiler into it.
I imagine that about half of your code is unnecessary and most of the other half ignores the capabilites of GCB.
My suggestion is to take the time to study the help file, learn the syntax, learn how to use the included libraries and GCB interupt handling, and then build you code from scratch, once section at a time. IMO, stuffing code from Proton into GCB is a waste of GCB capabilites,.
The demos are included as a learning tool as are the examples included in the help.
Good Luck
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Of course the 1st posted code was a mess , I chopped and sliced to get a clean compile.
I did'nt want to reinvent the wheel, and needed support for 16F18326, and GCB offers it,
unfortunately I encounterd problems, Unfortunately Microchip poorly documented the PPS section.
You most read between the lines and examine the mini/micro notes carefully,then guess as to
whats needed...As for using the default settings, they are poorly documented, I still don't know what the default Tx setting is.
With GCB I encounter the following problems, I might be doing something wrong, like not setting some subtle value somewhere, I just don't know.
I tried the Hardware Serial Demo,, Output worked after setting PPS, the program doesn't check input, so input may be an issue?
I tried a flash the led demo.... It did NOT work.. [ may be 16F18326 related ] probably some Reg not
being setup..
I tried HI2C discovery code , after several trys, and finally changing PPS[incorrect values I think?], It did work for about 2 hrs then stopped, was it a fluke? Probably, or did I make a subtle change? ,I don't know, I never could get it to work again, The Clock and data lines are not being toggled per oscope..
I did have an instance that setting TRISC to what SB the correct values. GCB issued In/Out warning while compiling, but pgm would not run., had to add DIR cmd...It's like GCB ignores
direct TRISC changes?
Another instance of running pgm tried adding TRISC , program compiled fine but would not run
Disabling TRISC setting program ran - still courious about that...
Why set TRISA or TRISC it save code lines and code space
Literal -> W -> REG vs. Set/Clear bit, Set/Clear bit, Set/Clear bit, Set/Clear bit, etc..
The Probs may all be related to the PPS settings, I've been unable to Google 16F18326 related
issues.
Will keep trying GCB on this Chip to see If I can figure out what I'm doing wrong, or whats going on..
Last edit: xtal10 2016-07-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I will get a chip tomorrow. I will validate GCB is good and where it is not (which I would be very surprised) we can correct.
Look through the demos. You need to look at the temperature demos and the look at the digital ADC (do a search on MCPxxxxxx).
If I were you. Take a copy of the Xpress demos. Start at number 1 and work your way thru from flashing an LED this will teach you Great Cow BASIC and the host of great simple features.
I reviewed you code yesterday when I was assisting you. I think that your code can be written in Great Cow BASIC in a structured manner (no goto's or use of labels), using the standard Great Cow BASIC libraries and no assembler.
You are joining the most supported forum I have ever been part of - please try to understand our advice.
I will await the chip from Microchip. Out.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@All. Microchip has just informed me that there more than a few errors in the errors in the datasheet, and, the MMC does not support this chip (I reported this to them) and, the Microchip support files are also incorrect/missing.
There will be a new release of the Microchip MPLAB patch kit 31st July to address these issues. We will check our support files when this patch is released.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is the 2nd time you mentioned Xpress demos ? All I can find is GreatCowBasic\Demos
Are thes Xpress Demos somthing different, if so where are they????......
As for the goto's and Lables, I grew up with them , I love them, also functions/subs/macros..
I suspect that people that grew up with structed programming love it. Personally I dislike the structured stuff. I find it hard to follow, so as long as I have a choice I stick with goto's, labels, subroutines, and Functions and Macros [ which are non existant / lacking in Proton Basic]
I prefer Basic, but unfortunately basic has very liberal / NO STANDARD, each vendor has their own flavor and restrictions..
I dislike C++, but use it on Arduino / ESP8266, I have problems with { } crap and othe cryptic magic...
The original code is to capture POOL Temperature, PH, PPM + more. Then passinfo to ESP8266, then to Internet or Intranet..
I will revisit the flash LED , Its normally a no brainer.
FYI using DS18B20, MCP3221, Internal ADC, and RA5 counter input[alternate ppm]
Last edit: xtal10 2016-07-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"This is the 2nd time you mentioned Xpress demos ? All I can find is GreatCowBasic\Demos
Are thes Xpress Demos somthing different, if so where are they????......"
Look on the Toolbar and click on "view demos" it is a shortcut to the path you already found.
scroll down the folder list to "Vendor Boards" and double click.
look for the folder "Xpress Evaluation Board" and double click.
Work your way through from 01 to 25 and have fun :)
you said:
"As for the goto's and Labels, I grew up with them , I love them, also functions/subs/macros.."
Line Numbers, and gotos were rendered obsolete in the 80's, I know I learned BASIC on an HP-TTY system in the 70's and I have not used a goto since the zx spectrum.
If you use C++ on the Arduino then you already know the various flow control constructs that make goto obsolete. If you would like the other users in the GCBasic community to be able to help you you really should use a structure that we can all read. Many people here are not old enough to know what a GOTO statement is :)
As you can tell from Anobium’s posts we are taking your problem seriously and so is Microchip, please bare with us but also please try to use the language itself and use a structured approach to help us help you.
Cheers
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1 Won't work changed to #chip 16f18326,32 dir porta out porta=0 porta.4=1
a>portapinsappeartobeininputstate-nopullups[floating]b>addedANSELA=0,stillportapinsappeartobeininputstate-nopullupsc>addedLVP_OFFtoconfig,,stillportapinsappeartobeininputstate-nopullupsFrompreviousScan[when serial working]ofPPSvaluesTHERA0-5PPS=0[LATA]{ItrirdstripingthesetupcodefromthePBpgmthatishalfworkingPortA.4toggles}Iseethesameresults,portapinsappeartobeininputstate-nopullups[floating]Iamnowtotallybewildered.......backtothedatasheet
Last edit: xtal10 2016-07-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does Microchip have ERRATA on this chip listed anywhere?
I havn't found any....
For Microchip products, the latest published Errata for any given product should be listed in the Documentation Section of the Product Sheet. If is is not there, then whatever errata that is known by Microphip is not generally available.
@XTAL10. I have removed you specfic email address for obvious reasons. Not a good idea to publish your specific email address on an open forum. These forums are 'publish and subscribe' and therefore the serach engines will pick up email addresses. If you do not know what 'publish and subscribe' please do a Google search.
The message? You will reveive a URL to these personal message in your inbox of the email system that you used during the SourceForge registration process. As this was only four days ago... I think you may remember which email address that was. If you chose an email address that gets lots of spam then change.
I have sent you a message to this email address you provided.
Osmosis. Read the Help! See here When you created your sourceforge account the registration process created this for you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anobium
If I interpet this correctly The PM's would be sent to the email accout I listed when I registered..
I have found no emails from sourceforge or with 18326 subject line... please resend.....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Multiple definitions of RXPPS. Do not use RXPPS for I2C SCL and SDA. The data sheet is confusing on the requirements for bi-directional pins. I2C tested with PPS, and Input registers do not need to be set.
Serial output is working if I remove the PORTA.4 stuff
As for Serial input I have no clue.......
I've been trying to toggle RA4 and having no luck, also MCLR RA3 no longer resets the chip.
Its like pwr reset is not setting defaults , Yesterday reset was working....
I was thinking MCLR_ON in config controlled...
12.3 imply's input must be tied to output And it worked about 2 hrs yesterday right after I did that,
Then I must have changed something that started the tail spin.
By the way.. thx for the code, will keep for ref.....
Right not I'm hung up on toggling porta.4
I just love using a new pic and figuring out the gottcha's , and unfamiliar compiler
Section 12.3 implys input mut be tied to output, And this worked about 2 hours yesterday,
I must of changed something...
MCLR no longer works, I cant toggle RA4
Serial Output works until RA4 code was added
NO clue if Serial input works
Thx for your code... will look at it
Digital outputs should not be defined in PPS, they should be default condition. The PortA.4 toggling is being used as a switch input and port output at the same time. Use another port pin for the input or output.
Wher do you see RA4 being used for input ?
I was trying to tell device to use LATA , as for defaults I think the are changing randomly
MCLR no longer works
@Guys. May I ask that we move this conversation to Google chat or analternative or email
I am having to search through the RSS feeed's for other forum postings.
Beg your pardon I see the logic now. Modified code for 16f1704 PPS and works just fine. So suggest this is a hookup or hardware problem. Out.
Kent
Have to stop for the day-- wife has planes.... thx
I modified a device file on Proton basic and was able to get a good compile after remarking out error s
It would not run with defaults, so I added the following just before Main
....
PPSLOCK = 0x55
PPSLOCK = 0xAA
PPSLOCK.0 = 0 'unlock PPS
The I2c is working and serial output is working, have not tested Serial input....
I can toggle RA4 with no issues
[ tried demo pgm on GCB just to toggle Rcx and added RA4, could not get to work]
I now have to figure out the counters and interrupt stuff ...
So it looks like the pps stuff is good.....
will do more checking the get back to GCB
@Xtal10
Your posted code barely resembles what GCB code should look like. Honestly it is a complete mess and I am somewhat surprised it works at all.
When changing to a new compiler, it is probabably a good idea to take the time to learn the cababilities of the new compiler, and how to take advantage of its capabilities before attempting to stuff code from another compiler into it.
I imagine that about half of your code is unnecessary and most of the other half ignores the capabilites of GCB.
My suggestion is to take the time to study the help file, learn the syntax, learn how to use the included libraries and GCB interupt handling, and then build you code from scratch, once section at a time. IMO, stuffing code from Proton into GCB is a waste of GCB capabilites,.
The demos are included as a learning tool as are the examples included in the help.
Good Luck
Of course the 1st posted code was a mess , I chopped and sliced to get a clean compile.
I did'nt want to reinvent the wheel, and needed support for 16F18326, and GCB offers it,
unfortunately I encounterd problems, Unfortunately Microchip poorly documented the PPS section.
You most read between the lines and examine the mini/micro notes carefully,then guess as to
whats needed...As for using the default settings, they are poorly documented, I still don't know what the default Tx setting is.
With GCB I encounter the following problems, I might be doing something wrong, like not setting some subtle value somewhere, I just don't know.
I tried the Hardware Serial Demo,, Output worked after setting PPS, the program doesn't check input, so input may be an issue?
I tried a flash the led demo.... It did NOT work.. [ may be 16F18326 related ] probably some Reg not
being setup..
I tried HI2C discovery code , after several trys, and finally changing PPS[incorrect values I think?], It did work for about 2 hrs then stopped, was it a fluke? Probably, or did I make a subtle change? ,I don't know, I never could get it to work again, The Clock and data lines are not being toggled per oscope..
I did have an instance that setting TRISC to what SB the correct values. GCB issued In/Out warning while compiling, but pgm would not run., had to add DIR cmd...It's like GCB ignores
direct TRISC changes?
Another instance of running pgm tried adding TRISC , program compiled fine but would not run
Disabling TRISC setting program ran - still courious about that...
Why set TRISA or TRISC it save code lines and code space
Literal -> W -> REG vs. Set/Clear bit, Set/Clear bit, Set/Clear bit, Set/Clear bit, etc..
The Probs may all be related to the PPS settings, I've been unable to Google 16F18326 related
issues.
Will keep trying GCB on this Chip to see If I can figure out what I'm doing wrong, or whats going on..
Last edit: xtal10 2016-07-21
Xtal10. Please read this.
I will get a chip tomorrow. I will validate GCB is good and where it is not (which I would be very surprised) we can correct.
Look through the demos. You need to look at the temperature demos and the look at the digital ADC (do a search on MCPxxxxxx).
If I were you. Take a copy of the Xpress demos. Start at number 1 and work your way thru from flashing an LED this will teach you Great Cow BASIC and the host of great simple features.
I reviewed you code yesterday when I was assisting you. I think that your code can be written in Great Cow BASIC in a structured manner (no goto's or use of labels), using the standard Great Cow BASIC libraries and no assembler.
You are joining the most supported forum I have ever been part of - please try to understand our advice.
I will await the chip from Microchip. Out.
@All. Microchip has just informed me that there more than a few errors in the errors in the datasheet, and, the MMC does not support this chip (I reported this to them) and, the Microchip support files are also incorrect/missing.
There will be a new release of the Microchip MPLAB patch kit 31st July to address these issues. We will check our support files when this patch is released.
Thx for the info Anobium....
This is the 2nd time you mentioned Xpress demos ? All I can find is GreatCowBasic\Demos
Are thes Xpress Demos somthing different, if so where are they????......
As for the goto's and Lables, I grew up with them , I love them, also functions/subs/macros..
I suspect that people that grew up with structed programming love it. Personally I dislike the structured stuff. I find it hard to follow, so as long as I have a choice I stick with goto's, labels, subroutines, and Functions and Macros [ which are non existant / lacking in Proton Basic]
I prefer Basic, but unfortunately basic has very liberal / NO STANDARD, each vendor has their own flavor and restrictions..
I dislike C++, but use it on Arduino / ESP8266, I have problems with { } crap and othe cryptic magic...
The original code is to capture POOL Temperature, PH, PPM + more. Then passinfo to ESP8266, then to Internet or Intranet..
I will revisit the flash LED , Its normally a no brainer.
FYI using DS18B20, MCP3221, Internal ADC, and RA5 counter input[alternate ppm]
Last edit: xtal10 2016-07-21
"This is the 2nd time you mentioned Xpress demos ? All I can find is GreatCowBasic\Demos
Are thes Xpress Demos somthing different, if so where are they????......"
Look on the Toolbar and click on "view demos" it is a shortcut to the path you already found.
scroll down the folder list to "Vendor Boards" and double click.
look for the folder "Xpress Evaluation Board" and double click.
Work your way through from 01 to 25 and have fun :)
you said:
"As for the goto's and Labels, I grew up with them , I love them, also functions/subs/macros.."
Line Numbers, and gotos were rendered obsolete in the 80's, I know I learned BASIC on an HP-TTY system in the 70's and I have not used a goto since the zx spectrum.
If you use C++ on the Arduino then you already know the various flow control constructs that make goto obsolete. If you would like the other users in the GCBasic community to be able to help you you really should use a structure that we can all read. Many people here are not old enough to know what a GOTO statement is :)
As you can tell from Anobium’s posts we are taking your problem seriously and so is Microchip, please bare with us but also please try to use the language itself and use a structured approach to help us help you.
Cheers
Chris
Xpress #1
1 Won't work changed to #chip 16f18326,32 dir porta out porta=0 porta.4=1
Last edit: xtal10 2016-07-22
Please wait till I get my chips here. They did arrive in the mail this morning - which is when I typically get them. Maybe tomorrow.
I will confirm operation.
As Chris pointed out - I have open tickets on this chip with Microchip.
Please wait until I have it tested on a test bed here.
Does Microchip have ERRATA on this chip listed anywhere?
I havn't found any....
Please refer to post https://sourceforge.net/p/gcbasic/discussion/579125/thread/cabf072d/?limit=25&page=1#6edc
I am working with them on the issue but I need a chip to test with.
and, I have sent you a personal message - can you please review.
For Microchip products, the latest published Errata for any given product should be listed in the Documentation Section of the Product Sheet. If is is not there, then whatever errata that is known by Microphip is not generally available.
http://ww1.microchip.com/downloads/en/DeviceDoc/80000668C.pdf
Where do I see this msg?
It might be easier to send Email ccxxcx@charter.net , This account gets 100+ spams a day,
osmosis isn't working ,,,, How do I see the PM??
Last edit: Anobium 2016-07-22
@XTAL10. I have removed you specfic email address for obvious reasons. Not a good idea to publish your specific email address on an open forum. These forums are 'publish and subscribe' and therefore the serach engines will pick up email addresses. If you do not know what 'publish and subscribe' please do a Google search.
The message? You will reveive a URL to these personal message in your inbox of the email system that you used during the SourceForge registration process. As this was only four days ago... I think you may remember which email address that was. If you chose an email address that gets lots of spam then change.
I have sent you a message to this email address you provided.
Osmosis. Read the Help! See here When you created your sourceforge account the registration process created this for you.
Anobium
If I interpet this correctly The PM's would be sent to the email accout I listed when I registered..
I have found no emails from sourceforge or with 18326 subject line... please resend.....
Send new message I sent myself a cc copy - I have received my own message, so, it works.