Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Industrial versions of Arduino prototyped electronics

Status
Not open for further replies.

cc78

New Member
I am trying to find some options for industrial strength hardware. I am working on a project with another fellow and we have built a gadget that we would like to turn into a product. The prototypes we built were done with Arduino components and I am in the hunt for answers as to where to look for better hardware to flesh the product out. I have stumbled upon Atmel.com and Microchip.com and noticed that this hardware can be coded with Assembler as well as C but is this the place to look? Can some of the folks who have gone down this path give me a few ideas?

Thanks!
 
C is fine, if you use an good programmer you just buy blank ATMega328p. Or program the boot loader on a blank using an Arduino sketch.

As for me, I prefer PICs but both PIC and AVR are fine choices. I often use Swordfish BASIC as I can code in it very quickly, but I'm forcing myself to learn C.
 
I'm forcing myself to learn C.

I try to help folks learn C as best as I can.... If you know Basic... And a bit of ASM... Then the C syntax should be really easy to pick up.....

I have found that books teaching C, over-complicate the language... When I look at swordfish, the only thing I see differently is the use of these two punctuation symbols ; { .

Code:
dim op, n as byte
for n = 0 to 10 
   op = n
next n

C:
char op, n;
for( n = 0; n<11; n++)
   {
    op=n;
   }

The normal everyday stuff is virtually the same...

Structures are types.. Character array's are strings... Pointers are references...
 
I try to help folks learn C as best as I can.... If you know Basic... And a bit of ASM... Then the C syntax should be really easy to pick up.....

As I've previously mentioned, I'm also trying to learn C (again!!), and I've been doing so for a number of decades now :D

I originally learnt 6502 assembler, then Microsoft BASIC, bit's of 68000 assembler (Amiga) and even bought the VERY expensive Lattice C assembler, but failed to get anywhere with it. Moving to PC's I again used BASIC, and then progressed to Turbo Pascal - which I had no problems with. but further attempts with C proved a failure yet again :D. Incidentally, I did convert quite lot of C programs to Pascal though.

Next I moved to Windows, and Delphi - where as a learning experience I wrote the worlds first Windows PIC Programmer using Delphi, and various programs over the years (but again the occasional attempt at C failed - I do have a number of books on C though).

Anyway, my current attempt is using XC8, thanks to your C versions of my tutorials - and I'm currently using it to do some design and development for a friend, and it's going better than it ever has before :D

However, as for C syntax being 'easy to pick up', I've never found it so - and the error messages you get are generally less than helpful (such as missing off a curly bracket, or a semicolon, and you get some bizarre message on a line miles away).

But thanks again, I'm making better progress than ever before, thanks to your tutorials.

On an unrelated point, apart from I'm writing it in C, anyone got any good simple mounting tips for LCD text modules?.
 
On an unrelated point, apart from I'm writing it in C, anyone got any good simple mounting tips for LCD text modules?.

Okay! consider this thread Hi-jacked!!

Here is how I mount my 16x2 Fordata LCD..

Plastic ABS box....
Bottom cut out to suit the display part....
4 holes drilled to 4.5mm in line with the 4 mounting holes....
3mm hank nut pushed into the back of the box through the 4.5mm hole...
The display sits flush to the rear of the box..
Printed panel sits on the rear of the box held down by 4 anti vandal buttons...
 
Okay! consider this thread Hi-jacked!!

Here is how I mount my 16x2 Fordata LCD..

Plastic ABS box....
Bottom cut out to suit the display part....
4 holes drilled to 4.5mm in line with the 4 mounting holes....
3mm hank nut pushed into the back of the box through the 4.5mm hole...
The display sits flush to the rear of the box..
Printed panel sits on the rear of the box held down by 4 anti vandal buttons...

Do you have any pictures? :D
 
I was going to post them, But as I have just found out my web site is down... I have BT on the case but it'll be Tuesday before we're back up and running...

However I have pictures on my work computer... The nuts are actually called Clinch nuts

https://www.ebay.co.uk/itm/Grooved-...f2863&pid=100204&rk=20&rkt=29&sd=361205074936

display mount.png

Works quite well and I mount it all on a stainless steel bracket that I have made. ( the steel is sandwiched between the ABS box and the Front panel.

I use Sikaflex to stop water ingress....
 
This rather covers my feelings about "C". :rolleyes:

I find C rather Byzantine and although I'm starting to think in C it's still I have to look everything up. I guess punch cards made C a very terse language. It's actually not bad and I find Microchips XC8 wiki invaluable. https://microchip.wikidot.com/tls2101:start

The library's are still taking

I still really love Swordfish but it's only for the 18F parts. So easy. LCD / UART is easy in SwordfishBASIC, LCD / UART is bizarre in XC8 (why do I have to write a putch routine)? https://microchip.wikidot.com/faq:29
 
why do I have to write a putch routine
Because the stdio ( standard io ) is to the USART... If you use the serial port and you initialize it, then printf will spit out characters to it.... If you re-define putch and getch... The stdio will recieve chars from any device you design and will spit them out to any device you want it to..

In other words.... If you just set up the USART say at "9600 8 N 1" and use printf("Hello World"); If connected to a PC running a term program, you will see it there...

If you want the output to an LCD , re-declaring putch() means printf will send it to the LCD..
 
I was going to post them, But as I have just found out my web site is down... I have BT on the case but it'll be Tuesday before we're back up and running...

Hope it's back up soon :(

However I have pictures on my work computer... The nuts are actually called Clinch nuts

Yes, I know of them, but never had any (or even physically seen one) - I became aware of them as they were listed in the leaflet with my pop-riveter, and I always thought they looked useful (RS Components sell them).

I was thinking of something similar, but using countersunk 3mm screws from the front, and nuts on the back so you can adjust the mounting depth as you want. Do the clinch nuts happily give you the right depth?.
 
Do the clinch nuts happily give you the right depth?.
Yes.. Spot on... They allow me to tighten the screws down hard without deforming the PCB... The clearance to the steel bracket is gnat's hairs....... The perspex front is "Reversed" printed so it doesn't get scratched, and they can polarize it so its sun readable..

The LCD's without the backlight sit miles away so they look awful so I don't use them...
 
Sample code please :)

Perhaps I should start an old geezers learning XC8 thread.
After reading through!!! It seems as if you have to write a putch() for any STDIO...

C:
#include<xc.h>
#include<stdio.h>             // printf / sprintf are declared in here

#pragma config  FOSC = HS, MCLRE = OFF, WDTE = OFF

void delayUs(int x)             // Nearly 1uS accurate but not quite.
   {
   x>>=1;                 // divide by 2..
   while(x--)               // while takes about 12 cycles
     {
     NOP();               // + the three nops 3
     NOP();               // 16 cycles
     NOP();               // So 63 * 16 * .75uS =  1008uS.
     }
   }

void delayMs(int x)             //
   {
   while(x--)
     delayUs(1000);           // Basic delays
   }

void OpenUsart(void)
   {
   SPBRG = 129;             // 20Mhz works out a SPRG of 129 with BRGH high.
   BRGH = CREN = TXEN = SPEN = 1;     // all need to be high!!
   SYNC = 0;               // asychronous please...
   }

void putch(char c)             // output through serial port!
   {
   while(!TRMT);             // wait till last char has left the building!!
   TXREG = c;
   }

void main(void)               // Main entry point.
   {
   OpenUsart();             // sort out RS232 bits and bobs...         
   while(1)
     {
     printf("Hello World\n\r");     // test string!!
     delayMs(1000);           // Just to test the delay!!!
     }                  // forever loop...       
   }

If you had a data out to the LCD screen you would write it in this function...Its cool because you can take care of
carriage returns, new lines and character wrap...
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top