DigiSpark to Picaxe

julianE

Senior Member
I recently bought one of these,
http://www.ebay.com/itm/Digispark-Kickstarter-Attiny85-Micro-USB-Development-Board-for-Arduino-ATtiny-MC-/192024551548?epid=867830558&hash=item2cb58e207c:g:OrAAAOSwal5YJZBz

My hope was to use it as a helper chip to picaxe. I have it setup and flashing, next step is to connect to it with picaxe through a serial connection. The board is limited by it's USB feature, a resource drag for attiny85. I'm curious if anyone has tried it. Might be just the thing for interfacing to fancy LCD displays.
 

steliosm

Senior Member
Why not doing this with a Pro Mini: http://www.ebay.com/itm/191679508570
It's about the same money with the DigiSpark, but you don't get the USB connection. The question here is, if you are going to use another chip as a 'driver' to fancy hardware (neopixels, OLEDs, etc.) why not use the same chip to run the logic as well? Is it worth it having a 08m2 controlling an atmega328p chip?
 

julianE

Senior Member
Why not doing this with a Pro Mini: http://www.ebay.com/itm/191679508570
It's about the same money with the DigiSpark, but you don't get the USB connection. The question here is, if you are going to use another chip as a 'driver' to fancy hardware (neopixels, OLEDs, etc.) why not use the same chip to run the logic as well? Is it worth it having a 08m2 controlling an atmega328p chip?
All good points, I find the picaxe much easier to use then other platforms. Everything is simpler in picaxe, I spent hours interfacing cheap rf modules in great cow basic and it's trivial in picaxe. I've tried numerous platforms and nothing is nearly as good as picaxe, if it were faster it would be peerless. I do like Pi/Python combo which works really well with picaxe.
 

steliosm

Senior Member
I've been searching to find a 'secondary' platform to use when I can't get things done with a Picaxe, usually when I need more speed. I found GreatCow Basic recently and I have been testing it with a Pro Mini (Arduino). Seems simple enough for simple tasks. On the other hand, I could just use the Arduino C-like language with the Pro Mini as the secondary platform.
Where do you run the GreatCow Basic code?
 

julianE

Senior Member
I've used it on Microchip equivalents of 08M2 and 20X2, 12F1840 and 18F14K22 respectively. It's been almost a year since I've tinkered but I do remember GCB being decent. There was talk on their forum to have examples of picaxe to GCB code but it did not go very far.
I can stumble my way through duino C it's not terribly difficult I just find the syntax pretentious, people showing off. Not unlike "the python way" where people write very sophisticated programs with 10 lines of code, downside being that it's unintelligible. It's very rare that I need more speed then Picaxe provides.
 

steliosm

Senior Member
Arduino-C feels a bit weird in the beginning, not very fond of it.
What was the problem with cheap RF modules and GCB?
It's pretty rare in my case to, but I have a project on my 'to-do' list that includes Neopixels :)
 

julianE

Senior Member
This is one of my favorite commands in Picaxe,

serin C.1, N1200, ("abc"), b1

I'm sure it can be ported to GCB but it will not be as elegant. If I can find the time I'll dig up my GCB test boards and try to write the equivalent command.
 

steliosm

Senior Member
Yes, I see you point. Serial communications are usually an issue when you have to take care of everything by yourself.
Anyway, I think you wont have any issues using the DigiSpark. You don't need to use the USB in your application unless you have to (e.g. to talk to a PC), which will also free 2 more pings on the board and get a total of 6.
Now that I'm thinking of, maybe I should just get a couple of Digispark boards and try to make a Neopixel driver for my picaxe!
 

julianE

Senior Member
Now that I'm thinking of, maybe I should just get a couple of Digispark boards and try to make a Neopixel driver for my picaxe!
I looked it up and there is a library for driving Neopixel with Digispark. The Digispark board uses very little board space, tiny.
 

bpowell

Senior Member
This is one of my favorite commands in Picaxe,

serin C.1, N1200, ("abc"), b1
Agreed...I'd like to see how that is implemented in code...

When I'm working in C, I typically have a receive buffer (maybe 60 to 80 bytes) (NMEA for example) and I use interrupt-driven serial receive...if a byte is received, check it for something (end-line or "*") and then either set the "Message received" flag, or the "Message incoming" flag...I suppose I could do something like that with "ABC" but it would be less elegant I'm sure...
 

steliosm

Senior Member
@julian yes, they have a library for Neopixel over at Arduino-land. Most Neopixel projects are done through Arduino and very few through esp8266 (still programmed in Wiring).
 

julianE

Senior Member
Agreed...I'd like to see how that is implemented in code...

When I'm working in C, I typically have a receive buffer (maybe 60 to 80 bytes) (NMEA for example) and I use interrupt-driven serial receive...if a byte is received, check it for something (end-line or "*") and then either set the "Message received" flag, or the "Message incoming" flag...I suppose I could do something like that with "ABC" but it would be less elegant I'm sure...
Yes interrupt-driven serial receive is the way to go. In case of my example you receive 4 bytes (abc and b1), store the 4 bytes in an array then test the first three bytes for "abc" and then strip the last byte, the payload if you will. Of course you have to have time outs of serial, define arrays, define all the variables and one line of Picaxe code becomes 20+ lines of code. I even looked at the paid compilers and they are no less difficult then GCB. It's also best to use hardware serial since software serial is not all that good for everyone but Picaxe. I was frustrated with a compiler a while back and for amusement I set up 4 serials on a 20X2 and they all transmitted without a hitch to serial LCDs. Honestly, the folks at Picaxe do not get anywhere the credit they deserve.
To get back to the original posting I think I'll use some of the other platforms for doing heavy tasks like FP math or high speed LED control but have the picaxe in charge.
 
Top