A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
|
I want to remote measure temperature (sensor has 2-4 volt swing but can easily be modified, even to a freq output(10-100hz) if needed) and rotation speed (sq wave 5volt, expected frq 75hz max). I have designed and tested the sensors, but I am having problems with pic basic, IE I am useless....... I have one spare PC serial port, so I want to be able to poll each pic with the one port by maybe sending a request code (say PICx where x is the pic number) and the piuc then sends its value back, at say 9600? For temp I would need to use an analog in on the pic, but for freq simple measurement would be ok, both need to have accuracy of around 5%-10% max so not rocket science if I use freq output of temp sensor could I use a smaller pic like the simple 8 pin type? Do any such source files have examples I can modifiy to accomplish this or is it lots of coffee and a year off the day job? |
|
|
|
The smaller 8 pin PICs don't have a serial port. This isn't impossible since you can simulate serial on the chip (aka "bit banged port") but I'm not sure any Basics out there do that. I'd use a 16F819 as it has ADC and serial I/O in an 18 pin package. glitchbuster has them for 2.68 If you can handle a bit banged serial I/O port, the 8 pin 12F675 has ADC and is $1.68 from glitchbuster. mouser is slightly cheaper but has higher shipping costs. I think you will find that all the PIC Basics have built in support for serial and ADC (if the chip supports it). Frequency measurement might be harder (though not THAT hard but you'll need to figure out how to do timing). --- In , lez_briddon <no_reply@y...> wrote: > I want to remote measure temperature (sensor has 2-4 volt swing but > can > easily be modified, even to a freq output(10-100hz) if needed) and > rotation > speed (sq wave 5volt, expected frq 75hz max). > > I have designed and tested the sensors, but I am having problems > with pic > basic, IE I am useless....... > > I have one spare PC serial port, so I want to be able to poll each > pic with > the one port by maybe sending a request code (say PICx where x is > the pic > number) and the piuc then sends its value back, at say 9600? > > For temp I would need to use an analog in on the pic, but for freq > simple > measurement would be ok, both need to have accuracy of around 5%- 10% > max so > not rocket science > > if I use freq output of temp sensor could I use a smaller pic like > the > simple 8 pin type? > > Do any such source files have examples I can modifiy to accomplish > this or > is it lots of coffee and a year off the day job? |
|
Hi, The other day, after spending many hours with an oscilloscope getting the timings right, I managed to write some code to send RS-232 (TTL of course) data from a PIC, without using the built-in serial port commands. It is meant to work at 9600bps, 8 data bits, 1 parity (odd) bit, and 1 stop bit, but could easily be modified for other speeds and modes. It's written in Proton+ Basic format, and will post it later on if anyone is interested. Regards, Mike ----- Original Message ----- From: "Phil" <> To: <> Sent: Sunday, June 20, 2004 6:21 PM Subject: [piclist] Re: pic as remote temp sensor > The smaller 8 pin PICs don't have a serial port. This isn't > impossible since you can simulate serial on the chip (aka "bit banged > port") but I'm not sure any Basics out there do that. > > I'd use a 16F819 as it has ADC and serial I/O in an 18 pin package. > glitchbuster has them for 2.68 If you can handle a bit banged > serial I/O port, the 8 pin 12F675 has ADC and is $1.68 from > glitchbuster. mouser is slightly cheaper but has higher shipping > costs. > > I think you will find that all the PIC Basics have built in support > for serial and ADC (if the chip supports it). Frequency measurement > might be harder (though not THAT hard but you'll need to figure out > how to do timing). > > --- In , lez_briddon <no_reply@y...> wrote: > > I want to remote measure temperature (sensor has 2-4 volt swing but > > can > > easily be modified, even to a freq output(10-100hz) if needed) and > > rotation > > speed (sq wave 5volt, expected frq 75hz max). > > > > I have designed and tested the sensors, but I am having problems > > with pic > > basic, IE I am useless....... > > > > I have one spare PC serial port, so I want to be able to poll each > > pic with > > the one port by maybe sending a request code (say PICx where x is > > the pic > > number) and the piuc then sends its value back, at say 9600? > > > > For temp I would need to use an analog in on the pic, but for freq > > simple > > measurement would be ok, both need to have accuracy of around 5%- > 10% > > max so > > not rocket science > > > > if I use freq output of temp sensor could I use a smaller pic like > > the > > simple 8 pin type? > > > > Do any such source files have examples I can modifiy to accomplish > > this or > > is it lots of coffee and a year off the day job? > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > Yahoo! Groups Links |
|
|
|
gawd, I love this list! Note, there are lots of assembly bit banged implimentations out there. Probably more in various flavors of Basic. --- In , "Michael Puchol" <mpuchol@s...> wrote: > Hi, > > The other day, after spending many hours with an oscilloscope getting the > timings right, I managed to write some code to send RS-232 (TTL of course) > data from a PIC, without using the built-in serial port commands. It is > meant to work at 9600bps, 8 data bits, 1 parity (odd) bit, and 1 stop bit, > but could easily be modified for other speeds and modes. It's written in > Proton+ Basic format, and will post it later on if anyone is interested. > > Regards, > > Mike > ----- Original Message ----- > From: "Phil" <phil1960us@y...> > To: <> > Sent: Sunday, June 20, 2004 6:21 PM > Subject: [piclist] Re: pic as remote temp sensor > > The smaller 8 pin PICs don't have a serial port. This isn't > > impossible since you can simulate serial on the chip (aka "bit banged > > port") but I'm not sure any Basics out there do that. > > > > I'd use a 16F819 as it has ADC and serial I/O in an 18 pin package. > > glitchbuster has them for 2.68 If you can handle a bit banged > > serial I/O port, the 8 pin 12F675 has ADC and is $1.68 from > > glitchbuster. mouser is slightly cheaper but has higher shipping > > costs. > > > > I think you will find that all the PIC Basics have built in support > > for serial and ADC (if the chip supports it). Frequency measurement > > might be harder (though not THAT hard but you'll need to figure out > > how to do timing). > > > > --- In , lez_briddon <no_reply@y...> wrote: > > > I want to remote measure temperature (sensor has 2-4 volt swing but > > > can > > > easily be modified, even to a freq output(10-100hz) if needed) and > > > rotation > > > speed (sq wave 5volt, expected frq 75hz max). > > > > > > I have designed and tested the sensors, but I am having problems > > > with pic > > > basic, IE I am useless....... > > > > > > I have one spare PC serial port, so I want to be able to poll each > > > pic with > > > the one port by maybe sending a request code (say PICx where x is > > > the pic > > > number) and the piuc then sends its value back, at say 9600? > > > > > > For temp I would need to use an analog in on the pic, but for freq > > > simple > > > measurement would be ok, both need to have accuracy of around 5%- > > 10% > > > max so > > > not rocket science > > > > > > if I use freq output of temp sensor could I use a smaller pic like > > > the > > > simple 8 pin type? > > > > > > Do any such source files have examples I can modifiy to accomplish > > > this or > > > is it lots of coffee and a year off the day job? > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > > Yahoo! Groups Links > > > > > > > > > > > |
|
Hi Phil, Thanks for the info - if you can point (URL) to one such implementation in a Basic language for PICs, it would be nice - I had spent quite some time before hacking it myself looking for one, and finding none. They all relied on the compiler's commands to send data (eg Serout). Regards, Mike ----- Original Message ----- From: "Phil" <> To: <> Sent: Sunday, June 20, 2004 8:25 PM Subject: [piclist] Re: pic as remote temp sensor > gawd, I love this list! > > Note, there are lots of assembly bit banged implimentations out > there. Probably more in various flavors of Basic. > > --- In , "Michael Puchol" <mpuchol@s...> wrote: > > Hi, > > > > The other day, after spending many hours with an oscilloscope > getting the > > timings right, I managed to write some code to send RS-232 (TTL of > course) > > data from a PIC, without using the built-in serial port commands. > It is > > meant to work at 9600bps, 8 data bits, 1 parity (odd) bit, and 1 > stop bit, > > but could easily be modified for other speeds and modes. It's > written in > > Proton+ Basic format, and will post it later on if anyone is > interested. > > > > Regards, > > > > Mike > > > > > > ----- Original Message ----- > > From: "Phil" <phil1960us@y...> > > To: <> > > Sent: Sunday, June 20, 2004 6:21 PM > > Subject: [piclist] Re: pic as remote temp sensor > > > > > > > The smaller 8 pin PICs don't have a serial port. This isn't > > > impossible since you can simulate serial on the chip (aka "bit > banged > > > port") but I'm not sure any Basics out there do that. > > > > > > I'd use a 16F819 as it has ADC and serial I/O in an 18 pin > package. > > > glitchbuster has them for 2.68 If you can handle a bit banged > > > serial I/O port, the 8 pin 12F675 has ADC and is $1.68 from > > > glitchbuster. mouser is slightly cheaper but has higher shipping > > > costs. > > > > > > I think you will find that all the PIC Basics have built in > support > > > for serial and ADC (if the chip supports it). Frequency > measurement > > > might be harder (though not THAT hard but you'll need to figure > out > > > how to do timing). > > > > > > --- In , lez_briddon <no_reply@y...> wrote: > > > > I want to remote measure temperature (sensor has 2-4 volt swing > but > > > > can > > > > easily be modified, even to a freq output(10-100hz) if needed) > and > > > > rotation > > > > speed (sq wave 5volt, expected frq 75hz max). > > > > > > > > I have designed and tested the sensors, but I am having problems > > > > with pic > > > > basic, IE I am useless....... > > > > > > > > I have one spare PC serial port, so I want to be able to poll > each > > > > pic with > > > > the one port by maybe sending a request code (say PICx where x > is > > > > the pic > > > > number) and the piuc then sends its value back, at say 9600? > > > > > > > > For temp I would need to use an analog in on the pic, but for > freq > > > > simple > > > > measurement would be ok, both need to have accuracy of around > 5%- > > > 10% > > > > max so > > > > not rocket science > > > > > > > > if I use freq output of temp sensor could I use a smaller pic > like > > > > the > > > > simple 8 pin type? > > > > > > > > Do any such source files have examples I can modifiy to > accomplish > > > > this or > > > > is it lots of coffee and a year off the day job? > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > > instructions > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > Yahoo! Groups Links |
|
|
|
I dont know of any specific ones - I was just commenting that since you've done one there should be others... At this point, you may be THE expert! There are a number of ASM ones that you might get some ideas from. BASIC isn't exactly designed for precision timing (puts on helmet, ducks into foxhole) needed for serial I/O. If it were me doing it for BASIC, I'd see how I could hook in assembler routines to inplement serin/serout bit banged. --- In , "Michael Puchol" <mpuchol@s...> wrote: > Hi Phil, > > Thanks for the info - if you can point (URL) to one such implementation in a > Basic language for PICs, it would be nice - I had spent quite some time > before hacking it myself looking for one, and finding none. They all relied > on the compiler's commands to send data (eg Serout). > > Regards, > > Mike > > ----- Original Message ----- > From: "Phil" <phil1960us@y...> > To: <> > Sent: Sunday, June 20, 2004 8:25 PM > Subject: [piclist] Re: pic as remote temp sensor > > gawd, I love this list! > > > > Note, there are lots of assembly bit banged implimentations out > > there. Probably more in various flavors of Basic. > > > > --- In , "Michael Puchol" <mpuchol@s...> wrote: > > > Hi, > > > > > > The other day, after spending many hours with an oscilloscope > > getting the > > > timings right, I managed to write some code to send RS-232 (TTL of > > course) > > > data from a PIC, without using the built-in serial port commands. > > It is > > > meant to work at 9600bps, 8 data bits, 1 parity (odd) bit, and 1 > > stop bit, > > > but could easily be modified for other speeds and modes. It's > > written in > > > Proton+ Basic format, and will post it later on if anyone is > > interested. > > > > > > Regards, > > > > > > Mike > > > > > > > > > ----- Original Message ----- > > > From: "Phil" <phil1960us@y...> > > > To: <> > > > Sent: Sunday, June 20, 2004 6:21 PM > > > Subject: [piclist] Re: pic as remote temp sensor > > > > > > > > > > The smaller 8 pin PICs don't have a serial port. This isn't > > > > impossible since you can simulate serial on the chip (aka "bit > > banged > > > > port") but I'm not sure any Basics out there do that. > > > > > > > > I'd use a 16F819 as it has ADC and serial I/O in an 18 pin > > package. > > > > glitchbuster has them for 2.68 If you can handle a bit banged > > > > serial I/O port, the 8 pin 12F675 has ADC and is $1.68 from > > > > glitchbuster. mouser is slightly cheaper but has higher shipping > > > > costs. > > > > > > > > I think you will find that all the PIC Basics have built in > > support > > > > for serial and ADC (if the chip supports it). Frequency > > measurement > > > > might be harder (though not THAT hard but you'll need to figure > > out > > > > how to do timing). > > > > > > > > --- In , lez_briddon <no_reply@y...> wrote: > > > > > I want to remote measure temperature (sensor has 2-4 volt swing > > but > > > > > can > > > > > easily be modified, even to a freq output(10-100hz) if needed) > > and > > > > > rotation > > > > > speed (sq wave 5volt, expected frq 75hz max). > > > > > > > > > > I have designed and tested the sensors, but I am having problems > > > > > with pic > > > > > basic, IE I am useless....... > > > > > > > > > > I have one spare PC serial port, so I want to be able to poll > > each > > > > > pic with > > > > > the one port by maybe sending a request code (say PICx where x > > is > > > > > the pic > > > > > number) and the piuc then sends its value back, at say 9600? > > > > > > > > > > For temp I would need to use an analog in on the pic, but for > > freq > > > > > simple > > > > > measurement would be ok, both need to have accuracy of around > > 5%- > > > > 10% > > > > > max so > > > > > not rocket science > > > > > > > > > > if I use freq output of temp sensor could I use a smaller pic > > like > > > > > the > > > > > simple 8 pin type? > > > > > > > > > > Do any such source files have examples I can modifiy to > > accomplish > > > > > this or > > > > > is it lots of coffee and a year off the day job? > > > > > > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > > > instructions > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > > Yahoo! Groups Links > > > > > > > > > > > |
|
Hi Phil, > I dont know of any specific ones - I was just commenting that since > you've done one there should be others... At this point, you may be > THE expert! I very much doubt it - I can't code ASM to save my life (puts on helmet, ducks into foxhole), and it was a matter of trial and error and some o'scope watching until the timings were right. > There are a number of ASM ones that you might get some ideas from. > BASIC isn't exactly designed for precision timing (puts on helmet, > ducks into foxhole) needed for serial I/O. Hehe don't need to duck - I completely agree that BASIC languages aren't meant for timing, there are instructions to delay execution by a number of miliseconds or even microseconds, but when it comes to working out how long it takes to do something (for example a for...next loop) then it's a nightmare. You are better off going down to the generated ASM (if any) and counting it there, and even then you need to be able to read ASM at least at a basic level. I suppose the built-in serial commands in the BASIC compilers have been time-optimized so as to work correctly in most situations, but in my case, I could not find one that was able to send out 8 data bits plus an odd or even parity. > If it were me doing it for BASIC, I'd see how I could hook in > assembler routines to inplement serin/serout bit banged. Well - sometimes it comes down to that - on another project that involved using the internal flash of an 18F452 as datalogger memory (not frequently written to, so no burnout problems there), I was stuck on having data written to positions that had previously been used becoming corrupt, turned out that the memory had to be erased before it could be written to again. I had to drop a few lines of ASM to do the 64-byte page erase part, into the Proton+ code,as there was no specific erase command. I guess I'll have to learn ASM this summer.... :-) Best regards, Mike |
|
So after looking at this thread I started, it seems my options are to use a larger pic and use a/d, and find a routine for serial io in asmembler, and try to cut it into my basic routines. OR........ If I can find some time to learn enough assembler I could write a simple freq measurement routine, and not need a/d so use could use an 8 pin pic, one io pin for freq mesurement and the other for serial out and a third for serial in. I suppose the other io pin could be used to check another freq, and save on pics.... It might be worth someone with a spare afternoon looking into this, say for a 12c508 etc, would make a very useful electronic building block as it could be used to measure all kinds of things, and would not the same code work on bigger pics with more inputs including a/d ? seems a simple serial protocol would be to send pic a simple 'PICXXXYYY' when XXX is pic id number and YYY is port number to be measured and pic responds with PICxxxyyyzzz' where xxx is again id, yyy is again port, and zzz is value It would surely cure a lot of my problems! I need some good pic books........ |
|
|
|
www.oshonsoft.com --- Michael Puchol <> wrote: > Hi Phil, > > Thanks for the info - if you can point (URL) to one > such implementation in a > Basic language for PICs, it would be nice - I had > spent quite some time > before hacking it myself looking for one, and > finding none. They all relied > on the compiler's commands to send data (eg Serout). > > Regards, > > Mike > > ----- Original Message ----- > From: "Phil" <> > To: <> > Sent: Sunday, June 20, 2004 8:25 PM > Subject: [piclist] Re: pic as remote temp sensor > > gawd, I love this list! > > > > Note, there are lots of assembly bit banged > implimentations out > > there. Probably more in various flavors of Basic. > > > > --- In , "Michael Puchol" > <mpuchol@s...> wrote: > > > Hi, > > > > > > The other day, after spending many hours with an > oscilloscope > > getting the > > > timings right, I managed to write some code to > send RS-232 (TTL of > > course) > > > data from a PIC, without using the built-in > serial port commands. > > It is > > > meant to work at 9600bps, 8 data bits, 1 parity > (odd) bit, and 1 > > stop bit, > > > but could easily be modified for other speeds > and modes. It's > > written in > > > Proton+ Basic format, and will post it later on > if anyone is > > interested. > > > > > > Regards, > > > > > > Mike > > > > > > > > > ----- Original Message ----- > > > From: "Phil" <phil1960us@y...> > > > To: <> > > > Sent: Sunday, June 20, 2004 6:21 PM > > > Subject: [piclist] Re: pic as remote temp sensor > > > > > > > > > > The smaller 8 pin PICs don't have a serial > port. This isn't > > > > impossible since you can simulate serial on > the chip (aka "bit > > banged > > > > port") but I'm not sure any Basics out there > do that. > > > > > > > > I'd use a 16F819 as it has ADC and serial I/O > in an 18 pin > > package. > > > > glitchbuster has them for 2.68 If you can > handle a bit banged > > > > serial I/O port, the 8 pin 12F675 has ADC and > is $1.68 from > > > > glitchbuster. mouser is slightly cheaper but > has higher shipping > > > > costs. > > > > > > > > I think you will find that all the PIC Basics > have built in > > support > > > > for serial and ADC (if the chip supports it). > Frequency > > measurement > > > > might be harder (though not THAT hard but > you'll need to figure > > out > > > > how to do timing). > > > > > > > > --- In , lez_briddon > <no_reply@y...> wrote: > > > > > I want to remote measure temperature (sensor > has 2-4 volt swing > > but > > > > > can > > > > > easily be modified, even to a freq > output(10-100hz) if needed) > > and > > > > > rotation > > > > > speed (sq wave 5volt, expected frq 75hz > max). > > > > > > > > > > I have designed and tested the sensors, but > I am having problems > > > > > with pic > > > > > basic, IE I am useless....... > > > > > > > > > > I have one spare PC serial port, so I want > to be able to poll > > each > > > > > pic with > > > > > the one port by maybe sending a request code > (say PICx where x > > is > > > > > the pic > > > > > number) and the piuc then sends its value > back, at say 9600? > > > > > > > > > > For temp I would need to use an analog in on > the pic, but for > > freq > > > > > simple > > > > > measurement would be ok, both need to have > accuracy of around > > 5%- > > > > 10% > > > > > max so > > > > > not rocket science > > > > > > > > > > if I use freq output of temp sensor could I > use a smaller pic > > like > > > > > the > > > > > simple 8 pin type? > > > > > > > > > > Do any such source files have examples I can > modifiy to > > accomplish > > > > > this or > > > > > is it lots of coffee and a year off the day > job? > > > > > > > > > > > > > > > > > > > > to unsubscribe, go to > http://www.yahoogroups.com and follow the > > > instructions > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com > and follow the > instructions > > Yahoo! Groups Links > > > > > > > > > > > __________________________________ |
|
So after looking at this thread I started, it seems my options are to use a larger pic and use a/d, and find a routine for serial io in asmembler, and try to cut it into my basic routines. OR........ If I can find some time to learn enough assembler I could write a simple freq measurement routine, and not need a/d so use could use an 8 pin pic, one io pin for freq mesurement and the other for serial out and a third for serial in. I suppose the other io pin could be used to check another freq, and save on pics.... It might be worth someone with a spare afternoon looking into this, say for a 12c508 etc, would make a very useful electronic building block as it could be used to measure all kinds of things, and would not the same code work on bigger pics with more inputs including a/d ? seems a simple serial protocol would be to send pic a simple 'PICXXXYYY' when XXX is pic id number and YYY is port number to be measured and pic responds with PICxxxyyyzzz' where xxx is again id, yyy is again port, and zzz is value It would surely cure a lot of my problems! I need some good pic books........ |
|
|
|
You lost me somewhere. The 12F675 has ADC and only 8 pins. Chad --- lez_briddon <> wrote: > So after looking at this thread I started, it seems my options are > to use a > larger pic and use a/d, and find a routine for serial io in > asmembler, and > try to cut it into my basic routines. > > OR........ > > If I can find some time to learn enough assembler I could write a > simple > freq measurement routine, and not need a/d so use could use an 8 pin > pic, > one io pin for freq mesurement and the other for serial out and a > third for > serial in. > > I suppose the other io pin could be used to check another freq, and > save on > pics.... > > It might be worth someone with a spare afternoon looking into this, > say for > a 12c508 etc, would make a very useful electronic building block as > it could > be used to measure all kinds of things, and would not the same code > work on > bigger pics with more inputs including a/d ? > > seems a simple serial protocol would be to send pic a > simple 'PICXXXYYY' > when XXX is pic id number and YYY is port number to be measured and > pic > responds with PICxxxyyyzzz' where xxx is again id, yyy is again > port, and > zzz is value > > It would surely cure a lot of my problems! > > I need some good pic books........ ===== My software has no bugs. Only undocumented features. __________________________________ |
|
Pic simulator ide has a nice cheep basic that does bitbanged serial on the 12f675 http://www.oshonsoft.com Peter --- Michael Puchol <> wrote: > Hi Phil, > > Thanks for the info - if you can point (URL) to one > such implementation in a > Basic language for PICs, it would be nice - I had > spent quite some time > before hacking it myself looking for one, and > finding none. They all relied > on the compiler's commands to send data (eg Serout). > > Regards, > > Mike > > ----- Original Message ----- > From: "Phil" <> > To: <> > Sent: Sunday, June 20, 2004 8:25 PM > Subject: [piclist] Re: pic as remote temp sensor > > gawd, I love this list! > > > > Note, there are lots of assembly bit banged > implimentations out > > there. Probably more in various flavors of Basic. > > > > --- In , "Michael Puchol" > <mpuchol@s...> wrote: > > > Hi, > > > > > > The other day, after spending many hours with an > oscilloscope > > getting the > > > timings right, I managed to write some code to > send RS-232 (TTL of > > course) > > > data from a PIC, without using the built-in > serial port commands. > > It is > > > meant to work at 9600bps, 8 data bits, 1 parity > (odd) bit, and 1 > > stop bit, > > > but could easily be modified for other speeds > and modes. It's > > written in > > > Proton+ Basic format, and will post it later on > if anyone is > > interested. > > > > > > Regards, > > > > > > Mike > > > > > > > > > ----- Original Message ----- > > > From: "Phil" <phil1960us@y...> > > > To: <> > > > Sent: Sunday, June 20, 2004 6:21 PM > > > Subject: [piclist] Re: pic as remote temp sensor > > > > > > > > > > The smaller 8 pin PICs don't have a serial > port. This isn't > > > > impossible since you can simulate serial on > the chip (aka "bit > > banged > > > > port") but I'm not sure any Basics out there > do that. > > > > > > > > I'd use a 16F819 as it has ADC and serial I/O > in an 18 pin > > package. > > > > glitchbuster has them for 2.68 If you can > handle a bit banged > > > > serial I/O port, the 8 pin 12F675 has ADC and > is $1.68 from > > > > glitchbuster. mouser is slightly cheaper but > has higher shipping > > > > costs. > > > > > > > > I think you will find that all the PIC Basics > have built in > > support > > > > for serial and ADC (if the chip supports it). > Frequency > > measurement > > > > might be harder (though not THAT hard but > you'll need to figure > > out > > > > how to do timing). > > > > > > > > --- In , lez_briddon > <no_reply@y...> wrote: > > > > > I want to remote measure temperature (sensor > has 2-4 volt swing > > but > > > > > can > > > > > easily be modified, even to a freq > output(10-100hz) if needed) > > and > > > > > rotation > > > > > speed (sq wave 5volt, expected frq 75hz > max). > > > > > > > > > > I have designed and tested the sensors, but > I am having problems > > > > > with pic > > > > > basic, IE I am useless....... > > > > > > > > > > I have one spare PC serial port, so I want > to be able to poll > > each > > > > > pic with > > > > > the one port by maybe sending a request code > (say PICx where x > > is > > > > > the pic > > > > > number) and the piuc then sends its value > back, at say 9600? > > > > > > > > > > For temp I would need to use an analog in on > the pic, but for > > freq > > > > > simple > > > > > measurement would be ok, both need to have > accuracy of around > > 5%- > > > > 10% > > > > > max so > > > > > not rocket science > > > > > > > > > > if I use freq output of temp sensor could I > use a smaller pic > > like > > > > > the > > > > > simple 8 pin type? > > > > > > > > > > Do any such source files have examples I can > modifiy to > > accomplish > > > > > this or > > > > > is it lots of coffee and a year off the day > job? > > > > > > > > > > > > > > > > > > > > to unsubscribe, go to > http://www.yahoogroups.com and follow the > > > instructions > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com > and follow the > instructions > > Yahoo! Groups Links > > > > > > > > > > > __________________________________ |
|
Having tried some of this, the 'smallest' PIC I would recommend using would be the 16F628. 18-pin, narrow DIP, on-chip oscillator at 4 Mhz, pin-compatible with the (older, but popular) 16F84. I believe it even has an on-chip UART, and an A to D converter. The 8-pin PIC's, while very cute, have too few pins or functions to be really useful. You CAN make one into a software UART -- but that's about all it can do. --- In , lez_briddon <no_reply@y...> wrote: > So after looking at this thread I started, it seems my options are > to use a > larger pic and use a/d, and find a routine for serial io in > asmembler, and > try to cut it into my basic routines. > > OR........ > > If I can find some time to learn enough assembler I could write a > simple > freq measurement routine, and not need a/d so use could use an 8 pin > pic, > one io pin for freq mesurement and the other for serial out and a > third for > serial in. > > I suppose the other io pin could be used to check another freq, and > save on > pics.... > > It might be worth someone with a spare afternoon looking into this, > say for > a 12c508 etc, would make a very useful electronic building block as > it could > be used to measure all kinds of things, and would not the same code > work on > bigger pics with more inputs including a/d ? > > seems a simple serial protocol would be to send pic a > simple 'PICXXXYYY' > when XXX is pic id number and YYY is port number to be measured and > pic > responds with PICxxxyyyzzz' where xxx is again id, yyy is again > port, and > zzz is value > > It would surely cure a lot of my problems! > > I need some good pic books........ |
|
|
|
628: uart - yes, ADC - no. The 16F819 does have both, as the astute reader may recall me recommending yesterday. I have to somewhat disagree on the 8 pin PICs. they are limited but still have a lot of value. you can get 6 usable pins and do a lot with that. You can do serial I/O with 2 but probably need a crystal (2 more) so that would leave 2 left over pins which is sufficient for lots of applications. plus, the 12F629 costs a little more than a buck each from mouser. --- In , "Allan Lane" <allan.lane@h...> wrote: > Having tried some of this, the 'smallest' PIC I > would recommend using would be the 16F628. > > 18-pin, narrow DIP, on-chip oscillator at 4 Mhz, > pin-compatible with the (older, but popular) 16F84. > I believe it even has an on-chip UART, and an > A to D converter. > > The 8-pin PIC's, while very cute, have too few > pins or functions to be really useful. You CAN make > one into a software UART -- but that's about all it > can do. > > --- In , lez_briddon <no_reply@y...> wrote: > > So after looking at this thread I started, it seems my options are > > to use a > > larger pic and use a/d, and find a routine for serial io in > > asmembler, and > > try to cut it into my basic routines. > > > > OR........ > > > > If I can find some time to learn enough assembler I could write a > > simple > > freq measurement routine, and not need a/d so use could use an 8 > pin > > pic, > > one io pin for freq mesurement and the other for serial out and a > > third for > > serial in. > > > > I suppose the other io pin could be used to check another freq, and > > save on > > pics.... > > > > It might be worth someone with a spare afternoon looking into this, > > say for > > a 12c508 etc, would make a very useful electronic building block as > > it could > > be used to measure all kinds of things, and would not the same code > > work on > > bigger pics with more inputs including a/d ? > > > > seems a simple serial protocol would be to send pic a > > simple 'PICXXXYYY' > > when XXX is pic id number and YYY is port number to be measured and > > pic > > responds with PICxxxyyyzzz' where xxx is again id, yyy is again > > port, and > > zzz is value > > > > It would surely cure a lot of my problems! > > > > I need some good pic books........ |
|
|
|
I love the 16F628, especially since I can use MCLR as an input. However, it
utilizes on-chip comparators and does not have A/D in the conventional sense.
Best,
Scotty
|
|
--- Allan Lane <> wrote: > Having tried some of this, the 'smallest' PIC I > would recommend using would be the 16F628. > > 18-pin, narrow DIP, on-chip oscillator at 4 Mhz, > pin-compatible with the (older, but popular) 16F84. > I believe it even has an on-chip UART, and an > A to D converter. > > The 8-pin PIC's, while very cute, have too few > pins or functions to be really useful. You CAN make > one into a software UART -- but that's about all it > can do. Really now?? > --- In , lez_briddon <no_reply@y...> wrote: > > So after looking at this thread I started, it seems my options are > > to use a > > larger pic and use a/d, and find a routine for serial io in > > asmembler, and > > try to cut it into my basic routines. > > > > OR........ > > > > If I can find some time to learn enough assembler I could write a > > simple > > freq measurement routine, and not need a/d so use could use an 8 > pin > > pic, > > one io pin for freq mesurement and the other for serial out and a > > third for > > serial in. > > > > I suppose the other io pin could be used to check another freq, and > > > save on > > pics.... > > > > It might be worth someone with a spare afternoon looking into this, > > > say for > > a 12c508 etc, would make a very useful electronic building block as > > > it could > > be used to measure all kinds of things, and would not the same code > > > work on > > bigger pics with more inputs including a/d ? > > > > seems a simple serial protocol would be to send pic a > > simple 'PICXXXYYY' > > when XXX is pic id number and YYY is port number to be measured and > > > pic > > responds with PICxxxyyyzzz' where xxx is again id, yyy is again > > port, and > > zzz is value > > > > It would surely cure a lot of my problems! > > > > I need some good pic books........ ===== My software has no bugs. Only undocumented features. __________________________________ |
|
|
|
> The 8-pin PIC's, while very cute, have too few > pins or functions to be really useful. You CAN make > one into a software UART -- but that's about all it > can do. I have not followed this thread closely so maybe this advice is OK for the question at hand, but generally spaeking I find the 8-pin PIC very usefull, and I can't wait to get my hands on the new 6-pin PICS. But value-for-money wise I think the 14-pin PICs deserve more attention that they seem to get. My advice as 'first PIC' used to be the 16F628(A), but now it would be the 16F630. Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products |
|
|
|
and all others 8/14 pin PIC users will agree with Phil... top 10 wishes, Vasile http://surducan.netfirms.com On Mon, 21 Jun 2004, Phil wrote: > 628: uart - yes, ADC - no. The 16F819 does have both, as the astute > reader may recall me recommending yesterday. > > I have to somewhat disagree on the 8 pin PICs. they are limited but > still have a lot of value. you can get 6 usable pins and do a lot > with that. You can do serial I/O with 2 but probably need a crystal > (2 more) so that would leave 2 left over pins which is sufficient for > lots of applications. plus, the 12F629 costs a little more than a > buck each from mouser. > > --- In , "Allan Lane" <allan.lane@h...> wrote: > > Having tried some of this, the 'smallest' PIC I > > would recommend using would be the 16F628. > > > > 18-pin, narrow DIP, on-chip oscillator at 4 Mhz, > > pin-compatible with the (older, but popular) 16F84. > > I believe it even has an on-chip UART, and an > > A to D converter. > > > > The 8-pin PIC's, while very cute, have too few > > pins or functions to be really useful. You CAN make > > one into a software UART -- but that's about all it > > can do. > > > > --- In , lez_briddon <no_reply@y...> wrote: > > > So after looking at this thread I started, it seems my options > are > > > to use a > > > larger pic and use a/d, and find a routine for serial io in > > > asmembler, and > > > try to cut it into my basic routines. > > > > > > OR........ > > > > > > If I can find some time to learn enough assembler I could write a > > > simple > > > freq measurement routine, and not need a/d so use could use an 8 > > pin > > > pic, > > > one io pin for freq mesurement and the other for serial out and a > > > third for > > > serial in. > > > > > > I suppose the other io pin could be used to check another freq, > and > > > save on > > > pics.... > > > > > > It might be worth someone with a spare afternoon looking into > this, > > > say for > > > a 12c508 etc, would make a very useful electronic building block > as > > > it could > > > be used to measure all kinds of things, and would not the same > code > > > work on > > > bigger pics with more inputs including a/d ? > > > > > > seems a simple serial protocol would be to send pic a > > > simple 'PICXXXYYY' > > > when XXX is pic id number and YYY is port number to be measured > and > > > pic > > > responds with PICxxxyyyzzz' where xxx is again id, yyy is again > > > port, and > > > zzz is value > > > > > > It would surely cure a lot of my problems! > > > > > > I need some good pic books........ > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > Yahoo! Groups Links |
|
On Tue, 22 Jun 2004, Wouter van Ooijen wrote: > I have not followed this thread closely so maybe this advice is OK for > the question at hand, but generally spaeking I find the 8-pin PIC very > usefull, and I can't wait to get my hands on the new 6-pin PICS. > > But value-for-money wise I think the 14-pin PICs deserve more attention > that they seem to get. My advice as 'first PIC' used to be the > 16F628(A), but now it would be the 16F630. I found 16F630 and 16F676 very nice and friendly PICs. Whith just one problem: some of them does not oscillate with external crystal or resonator. The OSC2 amplitude is below the schmitd trigger level. INTOSC is correcting partially the problem, but the problem is there. A 16F676 with an internal 20MHz oscillator is just I want. Vasile http://surducan.netfirms.com |