Shop OBEX P1 Docs P2 Docs Learn Events
Another SX programming question — Parallax Forums

Another SX programming question

Alex41Alex41 Posts: 112
edited 2007-06-13 17:10 in General Discussion
I do have a question about programming the SX.

I just ordered the SX tech tool kit. I don't have it yet, but I am playing with the Basic stamp and learning PBasic.
I am trying to build a freqncy to frequency converter. I would like the amount of frequency adjustment to be adjustable·with a pot - or anything else if anyone has any ideas. The frequency range would be about 50 - 500hz or so - nothing real fast.
I can see how the programming would work with a stamp, but·since it is a slower proccessor I can see how it wouldn't·work, specifically using the RCTIME command to read a pot adjustment. This would interrupt the program in·producing the output frequency.

I can see how a faster proccessor is neccessary. In an· earlier post I asked how and what I need to do this. I was referred to the SX or the Propeller chip.

Since I just ordered the SX kit, let me try that for now. I know the SX is much faster than the Stamp, but·it could still have the same problem couldn't it? I mean the·program has to stop and wait for the RCTIME command to measure the pot, right?·Let's say just for the sake or arguement that the RCTIME command takes 5ms to read the pot.·Regardless of how fast the proccessor is, it still has to stop and wait for the command to complete, in this time it would be disrupting the freq output for 5ms? Am I correct in this, or can the SX run more than one program at a time? Or would I need another processor to complete this?·The SX is priced very reasonable, so another one wouldn't break the bank by anymeans, but I do believe in simplicity.

I'm just learning this stuff now and would like to stay with the Pbasic for the SX for programming. At this point·I don't believe the program would be very large so memory isn't a big concern.


Thanks for any help,
Alex
·

Comments

  • JonnyMacJonnyMac Posts: 8,945
    edited 2007-06-13 17:10
    You could use an ISR-driven ADC so that the pot setting is constantly monitored; see Guenther Daubach's [noparse][[/noparse]excellent] book, "Programming the SX Microcontroller" for code.
Sign In or Register to comment.