Search found 737 matches
- 26 September 2017, 2:44 AM
- Forum: ZBasic IDE
- Topic: Compiling for Arduino 328 target
- Replies: 9
- Views: 4657
I do not know for a fact that the ZA-328 is assuming the 28 or 32 pin package. As I recall the 32 pin has 2 extra analog-only pins and I am not using those in the project in question. For my needs it is not critical to have the ZA-328 target function properly because I have a generic license. And ma...
- 25 September 2017, 19:12 PM
- Forum: ZBasic IDE
- Topic: Compiling for Arduino 328 target
- Replies: 9
- Views: 4657
- 25 September 2017, 18:46 PM
- Forum: ZBasic IDE
- Topic: Compiling for Arduino 328 target
- Replies: 9
- Views: 4657
- 25 September 2017, 9:19 AM
- Forum: ZBasic IDE
- Topic: Compiling for Arduino 328 target
- Replies: 9
- Views: 4657
Hmmmm... Good Question! I thought it was in one of the manuals for ZBasic. But I don't see it now. As I recall, it was a chart showing a few ATMega processors in one column and then another column listing Optiboot, and maybe another bootloader as some sort of option for that CPU. But the chart did n...
- 25 September 2017, 7:57 AM
- Forum: ZBasic IDE
- Topic: Compiling for Arduino 328 target
- Replies: 9
- Views: 4657
Thanks Don, I will send you the source code for you to try. My ZBasic installation is a fresh brand new installation on a Win10 laptop. I originally developed the program on my Win7 desktop running an OLD version of the compiler and IDE. I have been compiling there using the generic 328P as the targ...
- 25 September 2017, 4:29 AM
- Forum: ZBasic IDE
- Topic: Compiling for Arduino 328 target
- Replies: 9
- Views: 4657
Compiling for Arduino 328 target
I see that the newest IDE/Compiler seems to have the ability to compile for an arduino target. I have some Nano clones that I might be able to use. I selected the ZA-328 as the target for the compiler. When I compiled my pre-existing code (used for a generic ATMeg-328P, 16 MHz), I received the follo...
- 24 September 2017, 12:20 PM
- Forum: ZBasic Language
- Topic: ReadPin() return value
- Replies: 2
- Views: 3038
- 24 September 2017, 4:52 AM
- Forum: ZBasic Language
- Topic: ReadPin() return value
- Replies: 2
- Views: 3038
ReadPin() return value
I am FINALLY, after a LONG hiatus getting back to a project. It is some software to interface to an IEEE-488 (GPIB) bus. As usual, It is MUCH MUCH easier to do development in ZBasic rather than C/Arduino. In the documentation of PinRead() it says a non-zero return value indicates a logic high Is thi...
- 26 March 2016, 15:03 PM
- Forum: ZBasic Language
- Topic: PWM'ing a hardware LED
- Replies: 10
- Views: 2952
Re: Looping a WaitForInterrupt() independently of the main c
FWIW, I suggest that you use Halls; IMO dealing with contact bounce is wasted time, and I've had reed switches stick closed. Wow, you made those units really well! I agree, a hall sensor will work well in this application. In general I like the simplicity of reed switches, but it would be no proble...
- 26 March 2016, 8:55 AM
- Forum: ZBasic Language
- Topic: PWM'ing a hardware LED
- Replies: 10
- Views: 2952
Short pulses could be a problem in the general case. I am not sure how short the pulses will actually be. I have what is in effect a rotating bar magnet. And I will either use a reed switch or a hall sensor. The reed switch is susceptible to bounce and this could require extra hardware/effort to de...
- 26 March 2016, 6:36 AM
- Forum: ZBasic Language
- Topic: PWM'ing a hardware LED
- Replies: 10
- Views: 2952
Don, I actually got the WaitForInterrupt() working without having to ask a question. Actually, as I wrote the forum post, it made me think about it clearly. My main problem was my thinking in terms of a C ISR that will get executed automatically for every interrupt whereas in ZBasic I need to create...
- 26 March 2016, 6:21 AM
- Forum: ZBasic Language
- Topic: Looping a WaitForInterrupt() independently of the main code
- Replies: 1
- Views: 1165
Looping a WaitForInterrupt() independently of the main code
I am trying to detect a Hall sensor and count the number of switching events. I can use a pin change interrupt, and once the interrupt is serviced, I want it to be ready to run again. As I wrote this message, it made my sit down and explain what I was doing, and I realized that 1) The WaitForInterru...
- 26 March 2016, 6:08 AM
- Forum: ZBasic Language
- Topic: PWM'ing a hardware LED
- Replies: 10
- Views: 2952
Re: PWM'ing a hardware LED
If you look at the diagram in the datasheet showing the structure of an I/O pin it looks like the pin change won't be seen unless the pin is in an input mode. To test this hypothesis, modify your code to sense a pin change on a different pin and hard wire B.3 to that pin. Now that you mention it, I...
- 25 March 2016, 14:27 PM
- Forum: ZBasic Language
- Topic: PWM'ing a hardware LED
- Replies: 10
- Views: 2952
Re: PWM'ing a hardware LED
There are two issues in the code you've used...... Ah, that solved it. I set it to phase correct and got the frequency down to 28.2Hz. I can just barely see a flicker in the LED at 50% duty. Now the next problem. I have never used WaitForInterrupt() before. I want to use B.3 (being toggled by the t...
- 25 March 2016, 9:27 AM
- Forum: ZBasic Language
- Topic: PWM'ing a hardware LED
- Replies: 10
- Views: 2952
PWM'ing a hardware LED
I have a ZX-328nu device. It has an active low Red LED on pin 14 (B.3) which is the PWM A output for Timer/Counter2. I have a stupid question. I know I have successfully done this before, but it has been a while. I want to PWM this LED, and do it slow enough to see it by eye. So, 1-4Hz and 50% duty ...